API Reference

Neurooo is an online machine translation solution making use of AI models (LLMs). You can translate text (and files) from and to 100+ languages in a matter of seconds.

Our official API, detailed below, allows developers to integrate machine translation seamlessly into their apps or workflows.

— API changes —

The API is considered stable in its current state. We will do our best not to introduce breaking changes.

Need help, have a question or found a bug?

Introduction

The Neurooo API is built on REST principles and conventions.

All requests must be made over HTTPS and most require authentication. Our API endpoints accept JSON parameters and return JSON-encoded responses.

The current version of the API is v1 and the base URL is https://neurooo.com/api/v1/.

Authentication

The Neurooo API offers three authentication methods: JSON parameter, URL query parameter, and HTTP headers.

If you use more than one authentication method for a request, the priority order is the following:

  • JSON parameter
  • URL query parameter
  • HTTP headers

JSON parameter

Add your API key as api_key parameter in the JSON body of your request.

cURL request
curl -X POST https://neurooo.com/api/v1/translate \
  -H 'Content-Type: application/json' \
  -d '{
        "api_key": "YOUR_API_KEY"
      }'

URL query parameter

Add your API key as api_key parameter in the request URL.

cURL request
curl -X POST https://neurooo.com/api/v1/translate?api_key=YOUR_API_KEY

HTTP headers

Add your API key as x-api-key in the request headers.

cURL request
curl -X POST https://neurooo.com/api/v1/translate \
  -H 'x-api-key: YOUR_API_KEY'

Errors

Neurooo uses conventional HTTP codes to indicate if a request is successful (2xx) or if it failed (4xx). Errors will be returned in JSON format, giving you a clear indication about any missing, unauthorized or erroneous parameters.

errors is always an array of strings. If your request triggers several errors, all the errors will be returned in the response.

Example

request (to the translate endpoint)
{
  "source": 42
}
response
{
  "errors": [
    "Missing parameter: target_language_code.",
    "The 'source' parameter must be a string."
  ]
}

API endpoints

The Neurooo API consists of three endpoints:

Translate

The /translate endpoint allows you to translate text from one language to another. It accepts a number of optional parameters.

POST https://neurooo.com/api/v1/translate(.json)

Parameters

Name Type Description
source string The source text to translate.
Maximum size: 12,500 characters.
Example: "Hello everyone!"
target_language_code string The code of the language into which the source text should be translated.
Accepted values: see in our list of supported languages.
Example: "fr"
source_language_code optional string The language code of the source text.
Note: if you omit this parameter, Neurooo will auto-detect the language.
Accepted values: see in our list of supported languages.
Example: "en-US"
engine optional string The AI engine/model to use for the translation.
Accepted values:
  • openai-4omini
  • openai-4omini-eu
  • openai-4omini-us (default)
Example: "openai-4omini-eu"
tone optional string The tone/formality that should be used in the translation.
Accepted values:
  • informal
  • auto (default)
  • formal
Example: "informal"
context optional string Additional context to influence how Neurooo must translate the source text.
Maximum size: 5,000 characters.
Example: "This is a text about architecture"
format optional string An indication of source format, to help Neurooo translate it more appropriately.
Accepted values:
  • auto (default - automatic format detection)
  • text
  • html
Example: "html"

Response

Name Type Description
target string The translation of the source text.
source_language_code string The language code of the source text.
Expected values: see list of supported languages.
Note: can be "" if language was not detected with certainty.

Examples

Translate text from English into Spanish.

In this example, we use only required parameters.

request
{
  "source": "Hello everyone, and welcome to our meeting!",
  "target_language_code": "es"
}
response
{
  "target": "¡Hola a todos y bienvenidos a nuestra reunión!",
  "source_language_code": "en"
}
Translate using a specific engine

In this example, we use the optional engine parameter, in addition to the required ones.

request
{
  "source": "We love trying different translation engines.",
  "target_language_code": "fr",
  "engine": "openai-4omini-eu"
}
response
{
  "target": "Nous aimons essayer différents moteurs de traduction.",
  "source_language_code": "en"
}
Translate with a formal tone

In this example, we use the optional tone parameter in addition to the required ones.

request
{
  "source": "I'm glad you could attend the meeting.",
  "target_language_code": "fr",
  "source_language_code": "en",
  "tone": "formal"
}
response
{
  "target": "Je suis ravi que vous ayez pu assister à la réunion.",
  "source_language_code": "en"
}
Translate the same text with different contexts

In these examples, we use the optional context and source_language_code parameters, in addition to the required ones.

request #1 — "washer" in English can have different meanings depending on the context.
{
  "source": "Could you send me a photo of the damaged washer?",
  "target_language_code": "fr",
  "source_language_code": "en",
  "context": "online shop selling mechanical pieces"
}
response #1
{
  "target": "Pourriez-vous m'envoyer une photo de la rondelle endommagée ?",
  "source_language_code": "en"
}
request #2 — we pass a different context, expecting a different translation.
{
  "source": "Could you send me a photo of the damaged washer?",
  "target_language_code": "fr",
  "source_language_code": "en",
  "context": "online shop selling house appliances"
}
response #2
{
  "target": "Pourriez-vous m'envoyer une photo du lave-linge endommagé ?",
  "source_language_code": "en"
}
Translate HTML content

In this example, we use the optional format parameter in addition to the required ones.

request
{
  "source": "<article class=\"blog-post\"><h2 class=\"post-title\">Embracing Innovation: Shaping the Future</h2><p class=\"post-meta\">Published on <time datetime=\"2024-12-27\">December 27, 2024</time></p><p class=\"post-excerpt\">Innovation drives progress, inspiring groundbreaking solutions and transforming industries. Explore the key trends shaping tomorrow...</p></article>",
  "target_language_code": "fr",
  "format": "html"
}
response
{
  "target": "<article class=\"blog-post\"><h2 class=\"post-title\">Adopter l'Innovation : Façonner l'Avenir</h2><p class=\"post-meta\">Publié le <time datetime=\"2024-12-27\">27 décembre 2024</time></p><p class=\"post-excerpt\">L'innovation propulse le progrès, inspirant des solutions révolutionnaires et transformant les industries. Explorez les tendances clés qui façonnent demain...</p></article>",
  "source_language_code": "en"
}

Detect language

The /detect_language endpoint allows to detect the language of a text.

POST https://neurooo.com/api/v1/detect_language(.json)

Parameters

Name Type Description
source string The source text for which you need to detect the language.
Maximum size: 12,500 characters.
Example: "I love solving jigsaw puzzles!"

Response

Name Type Description
code string The detected language code
Expected values: see list of supported languages.
Note: can be "" if language was not detected with certainty.
name string The detected language name
Expected values: see list of supported languages.
Note: can be "Uncertain" if language was not detected with certainty.

Examples

Detect the language of a text

In this example, we use only the required source parameter.

request
{
  "source": "Geweldig product! Hoge kwaliteit, betaalbare prijs en snelle levering."
}
response
{
  "code": "nl",
  "name": "Dutch"
}
Detect the language of a text, but detection is uncertain

In this example, we use only the required source parameter.

request
{
  "source": "Why esperar mañana quand on peut jetzt vivre la dolce vita?"
}
response
{
  "code": "",
  "name": "Uncertain"
}

Languages

The /languages endpoint returns the list of languages that you can use as source and target languages in your requests to our /translate endpoint.

GET https://neurooo.com/api/v1/languages(.json)

Parameters

Name Type Description
full optional boolean

To retrieve the full list of languages, including all regional variations.

Accepted values:
  • true
  • false (default - without regional variations)

Response

This endpoint responds with an array of languages based on this list.

Each language has the following structure:

Name Type Description
code string The language code
name string The language name

Examples

Retrieve the basic list
cURL request
curl -X GET https://neurooo.com/api/v1/languages
JSON response
[
  {
    "code": "af",
    "name": "Afrikaans"
  },
  {
    "code": "ak",
    "name": "Akan"
  },
  {
    "code": "am",
    "name": "Amharic"
  },
  {
    "code": "ar",
    "name": "Arabic‎"
  },
  {
    "code": "as",
    "name": "Assamese"
  },
  {
    "code": "az",
    "name": "Azeri"
  },
  ...
]
Retrieve the full list
cURL request
curl -X GET https://neurooo.com/api/v1/languages?full=true
JSON response
[
  {
    "code": "af",
    "name": "Afrikaans"
  },
  {
    "code": "ak",
    "name": "Akan"
  },
  {
    "code": "am",
    "name": "Amharic"
  },
  {
    "code": "ar",
    "name": "Arabic‎"
  },
  {
    "code": "ar-AE",
    "name": "Arabic (U.A.E.)‎"
  },
  {
    "code": "ar-BH",
    "name": "Arabic (Bahrain)‎"
  },
  {
    "code": "ar-DZ",
    "name": "Arabic (Algeria)‎"
  },
  ...
]

Need help or have a question?