Get Your API Credentials

If you haven't already done so, you will need to sign up.

Sign up to our free plan here:

The Free plan allows you to make 1,000 calls/day for free. For further information on paid plans please visit our plans page.

Getting Started with AYLIEN Text Analysis API Using Java


  • JDK

Getting the SDK

Since Text Analysis API is published to Maven Central, it is enough to add the dependency to the POM:


And for SBT users:

"com.aylien.textapi" % "client" % "0.3.0"

Using the SDK

The following example demonstrates how to extract concepts mentioned in a URL and determine the language it's written in.

import com.aylien.textapi.TextAPIClient;
import com.aylien.textapi.parameters.*;
import com.aylien.textapi.responses.*;

class Example {
  public static void main(String[] args) throws Exception {
    TextAPIClient client = new TextAPIClient("YourApplicationId", "YourApplicationKey");
    URL url = new URL("");
    ConceptsParams.Builder builder = ConceptsParams.newBuilder();
    Concepts concepts = client.concepts(;
    for (Concept c: concepts.getConcepts()) {
      System.out.print(c.getUri() + ": ");
      for (SurfaceForm sf: c.getSurfaceForms()) {
        System.out.print(sf.getString() + " ");

    LanguageParams languageParams = new LanguageParams(null, url);
    Language language = client.language(languageParams);
    System.out.printf("\nLanguage is: %s (%f)\n", language.getLanguage(), language.getConfidence());