Skip to main content

Babel Street Analytics API

Using the Text Analytics Endpoints

Text Analytics Input Parameters

Note

All input parameters, including the text being analyzed and any relevant options, are defined in the request body.

The document, or text being analyzed, can be provided as either a string of text, a file, or the contents of a web page, specified by a URI.

To specify a string of text or a file, use the content parameter:

"content": "The Securities and Exchange Commission today announced the leadership \
of the agency’s trial unit.  Bridget Fitzpatrick has been named Chief Litigation Counsel \
of the SEC and David Gottesman will continue to serve as the agency’s Deputy Chief Litigation \
Counsel. Since December 2016, Ms. Fitzpatrick and Mr. Gottesman have served as Co-Acting Chief \
Litigation Counsel.  In that role, they were jointly responsible for supervising the trial unit \
at the agency’s Washington D.C. headquarters as well as coordinating with litigators in the SEC’s \
11 regional offices around the country." 

Processing Local Files

This cURL example assumes you have a file 
input.txt in the directory Users/user with 
your input data.

curl -H POST \ 
   -H "X-BabelStreetAPI-Key: your_api_key"\ 
   -F content=@/Users/user/input.txt \ 
   -F request='{"options": {"multilingual": true}}';\
type=application/json \
"https://analytics.babelstreet.com/rest/v1/language"

The bindings handle files or input streams differently depending on the programming language’s design. There are examples for each of the supported languages to show how they process the multipart/form-data type of input.

Processing URIs

https://raw.githubusercontent.com/rosette-api/curl-examples/develop/examples/categories.curl

The text or document being analyzed can be contained in a website, accessed through a URI. Processing URI content is supported by submitting contentUri in your requests instead of content.

This procedure is available for all the text analtyics endpoints.

  • contentUri must be a valid HTTP, HTTPS, or FTP URL

  • Supported MIME types include text and HTML.

  • The URL must be publicly accessible from the internet.

  • No authentication is supported.

  • No cookies or other persistence mechanism is supported.

  • Page content (HTML) dynamically generated by JavaScript cannot be downloaded.

  • Sites that deny programmatic (without a real browser controlled by an end user) requests cannot be downloaded.