How to Get Started with AYLIEN Text Analysis API

How to Get Started with AYLIEN Text Analysis API


Getting up and running with AYLIEN’s Text Analysis APIs couldn’t be easier. It’s a simple 3 part process from signing up to calling the API. This blog will take you through the complete process of creating an account, retrieving your API Key and Application ID, and making your first call to the API.

Part 1: Signing up for a Text API account

Navigate to and click on the “Subscribe” button. This will bring you to a sign up form which will ask for your details in order to setup your account and generate your credentials.

By signing up, you will get free access to our Text Analysis API which will allow you to make 1,000 API calls per day free of charge while you test it out. There is no credit card needed to get access to our basic plan. 😉

Part 2: Retrieving your API Key and Application ID

Upon signing up you will receive an email with an activation link.

Clicking on the link will activate your account and direct you to a sign in page ( Use the credentials you set in the sign up process to login.

Once signed in you will be brought to the Text Analysis API page where your API Key and Application ID will be displayed. (Make sure you make a note of these.)

Next make your way to our getting started guide by clicking on the getting started button.

Part 3: Creating your first application

Our getting started guide is designed to get you up and running with the API and making calls as quickly and as easily as possible. Here you will find information on the API Documentation, Features, Links to a demo and some code snippets.

We have included sample code snippets for you to use in the following languages.

  • Java
  • Node.js
  • Python
  • Go
  • PHP
  • C#
  • Ruby

To start making calls, while you’re on the getting started page, scroll down to the “Calling the API” section. Choose which language you wish to use and take a copy of the code snippet. In this example, we are going to use Node.js.

We are going to walk through two very simple examples of how to call the API. The first analyzing a simple piece of text for sentiment and language detection and the second, analyzing a URL.

First things first, copy your code snippet and paste into a text editor. Replace the YOUR_APP_KEY and YOUR_APP_ID constant placeholders in the code with the “Key” and “App ID” from your credentials and save the file. In this case I have called it codesnippet.js.


The code snippet is very simple; it sets up the parameters to use with the endpoints as ‘text’ with just one sentence to analyze i.e. ‘John is a very good football player!’. We are going to make two calls to the API to analyze the sentiment (whether it’s positive, negative or neutral) and to detect what language it is written in.

Sentiment Analysis:

var parameters = {'text': 'John is a very good football player!'};
call_api('sentiment', parameters, function(result) {

Language Detection:

call_api('language', parameters, function(result) {

To run the application on Windows open a command prompt and run the snippet by typing “node” followed by the path to your text file (assuming you have Node.js installed on your computer, if not you can get it from

The results will be displayed in the command prompt as follows:

c:Program Filesnodejs>node "c:UsersUserDocumentscodesnippet.js"
{ text: 'John is a very good football player!',
lang: 'en',
confidence: 0.9999970820218829 }
{ text: 'John is a very good football player!',
subjectivity: 'objective',
subjectivity_confidence: 0.9996820178364304,
polarity: 'positive',
polarity_confidence: 0.9999836594933543 }

So that’s a pretty simple example, but what if we want to do something a little more advanced like analyzing a URL.

Let’s say we have an article online that we want to analyze. We want to summarize it, extract any entities mentioned and generate optimal hashtags for that article so we can be sure we maximize its exposure.

In this case we are going to analyze an article about the iPhone 6. There is just a couple of changes we will need to make from the last example in order to summarize the article, extract the entities mentioned and generate some hashtags.

We need to change the var parameters:

var parameters = {'url': ''}

And use alternative API calls. You can find a full list of features and end-points in our documentation.


call_api('summarize', parameters, function(result) {

Entity Extraction:

call_api('entities', parameters, function(result) {

Hashtag Suggestion:

call_api('hashtags', parameters, function(result) {

Results will be shown as follows:

Article Summary:

  • Why the entry-level iPhone 6 has just 16GB of storage +nnThe lack of a strong reaction, either positive or negative, to the iPhone 6 series is largely due to the fact that the iPhone 6 and iPhone 6 Plus don’t introduce a lot of revolutionary new features – there are hardware updates aplenty, of course, but they’re generally incremental upgrades, bringing Apple’s top-end devices into relative parity with the latest from Samsung, et al.
  • ‘I love the old iPhone size so much, and I’ve spent so much time with it, that it’s going to take longer than a week to adjust to a new size – especially so when I spent half the week using the ginormous iPhone 6 Plus.’
  • ‘USA Today tech columnist Ed Baig was wowed by the iPhone 6 Plus’ display, construction and generally high level of polish:nn
  • These are the phones Apple devotees have been waiting for: iPhones that measure up to what’s fast becoming the new normal – the large, modern smartphone display.
  • Make no mistake: The most important new thing about the iPhone 6 and iPhone 6 Plus is their size.


    organization: ['Fine',
        'Bloomberg Businessweeks Joshua Topolsky '
    keyword: ['iPhone 6 and iPhone 6 Plus is their size',
        'iPhone 6 and iPhone',
        'iPhone 6 or iPhone',
        'iPhone size',
        'iPhones instantly make Apple',
        'iPhone 6 review',
        'iPhone 6 series',
        'iPhone user',
        'screen size',
        'phones Apple',
        'phones with larger screens',
        'impressed by the 6 series',
    date: ['Today'],
    person: ['John Gruber',
        'Ed Baig',
        'Jason Snell',
        'David Pierce',
    product: ['iPhone']

Hashtag Suggestions:

    language: 'en',
    hashtags: ['#BMW6Series',

There you have it, that’s how easy it is to get up and running with AYLIEN Text Analysis API.

Text Analysis API - Sign up

Let's Talk