The Text Analysis API conforms to Representational State Transfer (REST) API usage principles, and can be used in any environment capable of making HTTP requests.
Learn more - Check out the Features and Functions.


 

Your first call is 3 steps away


for an account (or )

Try all of Rosette, free up to 10,000 calls/month!

Get your application keys

Generate your application keys on your API Credentials page,
so Rosette will know who is calling.

Run code samples

Here are code samples for various languages to help you get started.


Check out the cURL API documentation.

$ curl "https://api.rosette.com/rest/v1/ping"
  -H'X-RosetteAPI-Key: Your API key here'


Visit our GitHub page for the binding and documentation.

The Rosette binding supports version 2.7 and later of Python

$ pip install rosette_api
from rosette.api import API
api = API(user_key="Your API Key here")
result = api.ping()
print("/ping: ", result)

Visit our GitHub page for the binding and documentation.

The Rosette binding supports version 5.5 and later of PHP

Available through composer:

$ composer require "rosette/api"
<?php
require_once dirname(__FILE__) . '/../vendor/autoload.php';
use rosette\api\Api;
use rosette\api\RosetteException;
$options = getopt(null, array('key:', 'url::'));
if (!isset($options['key'])) {
    echo 'Usage: php ' . __FILE__ . " --key  --url=\n";
    exit();
}
$api = isset($options['url']) ? new Api($options['key'], $options['url']) : new Api($options['key']);
try {
    $result = $api->ping();
    var_dump($result);
} catch (RosetteException $e) {
    error_log($e);
}

Visit our GitHub page for the binding and documentation.

The Rosette binding supports version 7 and later of Java

For Maven, add the following dependency to your POM:

<dependency>
<groupId>com.basistech.rosette</groupId>
<artifactId>rosette-api</artifactId>
<version>${rosette.java.version}</version>
</dependency>

Visit our GitHub page for the binding and documentation.

Available through github:

library(devtools)
install_github("rosette-api/r-binding")
source("../R/Api.R")
library(rjson)
library("optparse")

option_list = list( make_option(c("-k", "--key"), action="store", default=NA, type='character',
              help="Rosette API key"))
opt_parser = OptionParser(option_list=option_list)
opt = parse_args(opt_parser)

if(is.null(opt$url)){
    result <- api(opt$key, "ping")
} else {
    result <- api(opt$key, "ping", NULL, NULL, opt$url)
}
print(result)

Visit our GitHub page for the binding and documentation.

The Rosette binding supports version 2.3 and later of Ruby

Available as a gem:

$ gem install rosette_api
require 'rosette_api'

api_key, url = ARGV

if !url
  rosette_api = RosetteAPI.new(api_key)
else
  rosette_api = RosetteAPI.new(api_key, url)
end
response = rosette_api.ping
puts JSON.pretty_generate(response)

Visit our GitHub page for the binding and documentation.

Available through nuget:

$ nuget install rosette_api
class ping
    {
        static void Main(string[] args)
        {
            string apikey = "Your API key";
            string alturl = string.Empty;

            if (args.Length != 0)
            {
                apikey = args[0];
                alturl = args.Length > 1 ? args[1] : string.Empty;
            }
            try
            {
                CAPI NewCAPI = string.IsNullOrEmpty(alturl) ? new CAPI(apikey) : new CAPI(apikey, alturl);
                Dictionary pingResult = NewCAPI.Ping();
                Console.WriteLine(new JavaScriptSerializer().Serialize(pingResult));
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception: " + e.Message);
            }
        }
    }

Visit our GitHub page for the binding and documentation.

The Rosette binding supports version 6.3 and later of Node.js

Available through npm:

$ npm install rosette-api
$ npm install argparse
"use strict";

var Api = require("../lib/Api");
var ArgumentParser = require("argparse").ArgumentParser;

var parser = new ArgumentParser({
  addHelp: true,
  description: "Send ping to check for reachability of Rosette API"
});
parser.addArgument(["--key"], {help: "Rosette API key", required: true});
parser.addArgument(["--url"], {help: "Rosette API alt-url", required: false});
var args = parser.parseArgs();

var api = new Api(args.key, args.url);
var endpoint = "ping";

api.rosette(endpoint, function(err, res){
	if(err){
		console.log(err)
	} else {
		console.log(JSON.stringify(res, null, 2));
	}
});




Notes: