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 Babel Street Analytics, free up to 2,000 calls/month (500 calls/day)!

Get your application keys

Generate your application keys on your API Credentials page,
so Babel Street Analytics 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://analytics.babelstreet.com/rest/v1/ping"
  -H'X-BabelStreetAPI-Key: Your API key here'


Visit our GitHub page for the binding and documentation.

The Analytics binding supports version 3.8 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 Analytics binding supports version 8.1 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 Analytics binding supports version 11 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.

The Analytics binding supports version 3.0 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 Analytics binding supports version 8.0.0 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 Analytics API"
});
parser.addArgument(["--key"], {help: "Analytics API key", required: true});
parser.addArgument(["--url"], {help: "Analytics 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:

  • All API requests go to https://analytics.babelstreet.com/rest/v1/
  • The /rest/v1/ part of the URI is the API version.
  • View the complete list of API endpoints and request parameters.