apyhub
ARTIFICIAL INTELLIGENCE · STANDARD DATA

Language Detection

What it does

Language Detection identifies the language of a text string and returns a structured result from the selected provider. Send plain text in body.text, and choose requested_service to use apyhub, azure, or google.

Use it when you need to route user content, label documents, or apply the right downstream NLP pipeline. A chat app can detect the language of an incoming message before translation; a content system can classify uploaded text before indexing or moderation.

The request schema also supports provider-specific credentials through body.azure and body.google when you want to call those services directly. The response wraps provider output under data.azure, data.apyhub, or data.google, so you can consume the result from the service you selected without guessing the response shape.

This is a lightweight text-analysis endpoint: you provide the text, and Language Detection returns the detected-language response from the chosen backend.

POST
Detect language of text
https://api.eu.apyverse.com/apyhub/detect-language

QUICKSTART

GUIDE

Quickstart

Send the text you want to detect a language for.

curl -X POST "https://api.eu.apyverse.com/apyhub/detect-language" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text":"Bonjour tout le monde!","requested_service":"apyhub"}'

What you'll get back

Returns a JSON object with a data object. The data object may contain azure, apyhub, and/or google fields, each representing the response object from that provider.

{
  "data": {
    "apyhub": {}
  }
}
TRY ITLIVE · 500 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
azure
Custom credentials for Azure services.
Azure subscription key.
Azure service region.
Azure endpoint URL.
Azure account ID.
OAuth access token for Azure service.
google
Custom credentials for Google services.
Target language locale.
google_credential_json

About this endpoint

What it does

Detects the language of the provided text and returns a JSON object containing provider-specific result objects under data. You can request detection through azure, google, or apyhub using requested_service.

Request Body

ParameterTypeMandatoryDescription
textStringYesThe text to analyze for language detection.
azureObjectNoCustom credentials for Azure services.
azure.keyStringNoAzure subscription key.
azure.regionStringNoAzure service region.
azure.endpointStringNoAzure endpoint URL.
azure.account_idStringNoAzure account ID.
azure.access_tokenStringNoOAuth access token for Azure service.
googleObjectNoCustom credentials for Google services.
google.google_languageStringNoTarget language locale.
google.google_credential_jsonObjectNoGoogle service account credential JSON. See schema for nested fields.
requested_serviceENUMNoService to use for detection. Allowed values: azure, google, apyhub. Default: apyhub.

Response

Returns a JSON object with a data object field. Inside data, the schema declares three provider response objects: azure, apyhub, and google.

ParameterTypeMandatoryDescription
dataObjectNoWrapper object for provider-specific response payloads.
data.azureObjectNoResponse object from Microsoft Azure Cognitive Services.
data.apyhubObjectNoResponse object from ApyHub language tools.
data.googleObjectNoResponse object from Google Cloud NLP API.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.