API Clients

We have prepared API clients for following programming languages. Please follow the link and you will find the instructions how to setup API client.

If your programming language is not listed here, you can use JSON API directly.


JSON API Usage


Basic Detection

Simply submit HTTP request to http://ws.detectlanguage.com/0.2/detect
API produces results in JSON format.

Both GET and POST requests are supported. POST method is recommended for larger requests.

Request parameters

  • q - your text, mandatory
  • key - your API key, mandatory

Request example

http://ws.detectlanguage.com/0.2/detect?q=buenos+dias+señor&key=demo

Response format

API produces results in JSON format. Response contains array of language candidates.

Each object contains following values:

Response example

Batch Requests

It is possible to detect language of several texts using one query. This saves network bandwith and increases performance.

Note: batch request detections are counted as separate requests, i.e. if 3 texts were passed they will be counted as 3 separate requests.

Batch request example

To make batch request just pass array of texts in q parameter.

http://ws.detectlanguage.com/0.2/detect?q[]=buenos+dias+señor&q[]=hello+world&key=demo

Batch response example

Result is JSON array with detections listed in the same order as request texts.

Accessing Your Counters & Plan Details

User request and data counters can be accessed at http://ws.detectlanguage.com/0.2/user/status

Request parameters

  • key - your API key, mandatory

Response

  • date - today's date (UTC timezone)
  • requests - requests sent today
  • bytes - text bytes sent today
  • plan - plan code
  • plan_expires - plan expiration date
  • daily_requests_limit - requests limit per day
  • daily_bytes_limit - bytes limit per day