API Reference

You can use Lingvanex API in your products like mobile apps, websites etc

Nowadays Lingvanex is working via HTTPS requests. The URL of all requests starts with https://backenster.com/v2/api/v3/ In case of a protocol selection error and using HTTP, the request will be redirected to the address with the HTTPS protocol (status code 302).

Authentication of requests is done by adding the “Authorization” header with the following data format: Bearer The key can be created on the user control panel page https://lingvanex.com/account

Getting the list of languages

Description of obtaining the list of languages by means of an HTTP request:
  • Relative address /getLanguages
  • Method GET
  • The maximum time is 30 seconds.
  • Response type “application/json

Parameters of request:

  • platform – the name of the platform for which the translation is performed (do you want it?).
  • code – the language code in the format “language code_code of the country”, which is used to display the names of the languages. The language code is represented only in lowercase letters, the country code only in uppercase letters (example en_GBes_ESru_RU etc). If this option is not present, then English is used by default.

Parameter of the body of the response to the query:

  • err – the text of the error. It is null if the response status is 200. Otherwise, it contains a string.
  • result – an array of objects, each of which is a description of the language.

Description of the language object:

  • full_code – the language code in the format “language code_code of the country”.
  • code_alpha_1 – the language code in the “language code” format.
  • englishName – English name of the language.
  • codeName – the language name translated using the language specified by the query parameter “code”.
  • flagPath – the relative address of which is the image of the country flag. Example static/flags/afrikaansThe full address for downloading the flag will be https://backenster.com/v2/static/flags/afrikaans.pngIn order to download flags in increased resolutions, you should add to this parameter: @2x or @3x (example https://backenster.com/v2/static/flags/afrikaans@2x.png or  https://backenster.com/v2/static/flags/afrikaans@3x.png).
  • testWordForSyntezis – a word for testing a speech synthesizer.
  • modes – an array of objects, each of which is a description of the function that is supported in the given language.

Description of the function object:

  • name – name of the function. Currently, only 4 functions are widely supported: Speech synthesis“, “Image recognition“, “Translation“, “Speech recognition“.
  • value – logical value true or falsewhich shows the status of the function: on or off.
  • genders – logical value true or falsewhich shows the ability to synthesize speech for both sexes. Displayed only for function “Speech synthesis“.

Text Translation

Description of text translation via HTTP request:
  • Relative address /translate
  • Method POST
  • Maximum lifetime 30 seconds.
  • Content type is support in both values: “application/x-www-form-urlencoded” and “application/json

Request parameters:

  • from – the language code in the format “language code_code of the country” from which the text is translated. The language code is represented only in lowercase letters, the country code only in uppercase letters (example en_GBes_ESru_RU и т.п.). If this parameter is not present, the auto-detect language mode is enabled.
  • to – language code in the format “language code_code of the country” to which the text is translated (required).
  • data – data for translation (required). Two types of data are supported: a string and an array of strings.
  • platform – the name of the platform for which the translation is made (is it necessary?)

Response parameters:

  • err – the text of the error. It is null if the response status is 200. Otherwise, it contains a string.
  • result – result of translation. In the event that a line was sent to the translation, the result is also a string; if an array of strings, then we also get an array of strings.
  • translator – The name of the translator that was used for the translation (whether it is required?).
  • translatorLink – string with an address for the attributes of the translator that was used for translation (whether it is required?).
  • cacheUse – the number of letters translated using the Lingvanex service cache (whether it is required?).
  • source – source data for translation (whether it is required?).
  • from – code of the source language in the format “language code”. In the case of sending a translation of an array of strings with different language content, only the language of the first element of the array is returned.
  • sourceTransliteration – transliteration of source data. In the event that a line was sent to the translation, the result is also a string; if an array of strings, then we also get an array of strings.
  • targetTransliteration – transliteration results. In the event that a line was sent to the translation, the result is also a string; if an array of strings, then we also get an array of strings.

Text to Speech

Description of speech synthesis through HTTP request:
  • Relative address /textToSpeech
  • Method GET
  • The maximum lifetime is 60 seconds.
  • The content type is supported in two versions: “application/x-www-form-urlencoded” и “application/json

Address parameters (query) request:

  • lang – language code in the format of the “language_code code of the country” which is used to synthesize speech. Language code is presented only in the form of lowercase letters, country code only in the form of capital letters(example en_GBes_ESru_RU etc).
  • text– Text to synthesize speech. Only string data type is supported .
  • platform – The name of the platform for which speech synthesis is performed.
  • linkFlag – If this flag is added to the request, the response (content type “application / json”) returns a link to the synthesized file; if this flag is absent, the response (content type ‘audio / wav’) contains a binary audio file.

Parameter body response to the request:

  • err – Error text. Equals null if the status of the response is 200. In other cases, contains a string.
  • result – The object that contains the link to the file: {fileLink: }

Speech to text

Description of speech recognition via HTTP request:
  • Relative address /speechToText
  • Method POST
  • The maximum lifetime is 60 seconds.
  • The content type is supported in two versions: “multipart/form-data

Parameters of the body (body) of the request:

  • lang – Language code in the format “language_codes of the country” in which speech recognition is performed. Language code is presented only in the form of lowercase letters, country code only in the form of capital letters(example en_GBes_ESru_RU etc).
  • file– Audio file Supported formats: mp3, wav.
  • platform – The name of the platform for which speech recognition is performed.

Parameter body response to the request:

  • err – Error text. Equals null if the status of the response is 200. In other cases, contains a string.
  • result – Recognized text.