About this endpoint
What it does
Detects the language of the provided text and returns a JSON object containing a data object with provider-specific result fields. The request body includes the input text and can optionally include credentials/configuration for Azure or Google, plus a requested_service selector.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| text | String | Yes | The text to analyze. |
| azure | Object | No | Custom credentials for Azure services. Includes optional fields such as key, region, endpoint, account_id, and access_token. |
| azure.key | String | Yes (if azure is selected in requested_service) | Azure subscription key. |
| azure.region | String | No | Azure service region. |
| azure.endpoint | String | Yes (if azure is selected in requested_service) | Azure endpoint URL. |
| azure.account_id | String | No | Azure account ID. |
| azure.access_token | String | No | OAuth access token for Azure service. |
| Object | Yes (if google is selected in requested_service) | Custom credentials for Google services. Includes optional google_language and google_credential_json. | |
| google.google_language | String | No | Target language locale. |
| google.google_credential_json | Object | No | Google service account credential JSON. See schema for nested fields. |
| requested_service | ENUM | No | Which service to use. Allowed values: azure, google, apyhub. Default: apyhub. |
Response
Returns a JSON object with a data object field. Inside data, the schema declares provider-specific objects for azure, apyhub, and google, each representing the response object from that service.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| data | Object | No | Wrapper object for provider-specific language detection results. |
| data.azure | Object | No | Response object from Microsoft Azure Cognitive Services. |
| data.apyhub | Object | No | Response object from ApyHub language tools. |
| data.google | Object | No | Response object from Google Cloud NLP API. |