Detect language
Detect the language of a given text.
For example, sending the following data {"text": "Hello from LanguageWire!"}
will request a language detection of the text "Hello from LanguageWire!".
This request would return a response similar to {"code": "en-GB"}.
The endpoint will return a language code in the BCP 47 format by using the most likely variant.
For example, if English is detected, en-GB will be returned.
For German it would be de-DE.
If the selected variant does not fit your data (for example, you want to
use en-US instead), you will have to convert the code before using it for translation.
If the code field is null, it means no supported language was detected.
In some cases, the detected language may be unsupported for translations.
You should always validate the detected language code against the list of supported languages for your use case.
The following list shows the default variants for languages with multiple options:
- Arabic (ar): ar-EG
- German (de): de-DE
- Greek (el): el
- English (en): en-GB
- Spanish (es): es-ES
- French (fr): fr-FR
- Italian (it): it-IT
- Japanese (ja): ja
- Dutch (nl): nl-NL
- Portuguese (pt): pt-PT
- Swedish (sv): sv-SE
- Chinese Simplified (zh-Hans): zh-Hans-CN
- Chinese Traditional (zh-Hant): zh-Hant-TW
| Request Body — REQUIRED |
|---|
text Text — REQUIREDPossible values: 1 ≤ length ≤ 10000 The text to detect the language of. |
| Responses | |||||
|---|---|---|---|---|---|
200Successful response
| |||||
401The access token provided is missing, expired, revoked, malformed, or invalid for other reasons. The client MAY request a new access token and retry the protected resource request.
| |||||
403The request requires higher privileges than provided by the access token. The request should not be retried.
| |||||
422Validation Error
| |||||
429Too many requests in the time interval
| |||||
500Internal server error
|