apyhub
ARTIFICIAL INTELLIGENCE

AI Text Language Detection API

Hosted on ApyHub

What it does

Language Detector identifies the language of a text string and returns the result through the selected provider: ApyHub, Azure, or Google. Send a piece of text in body.text, and choose requested_service to route the request to the language engine you want to use.

Use it when you need to classify user-generated content, route support tickets, segment multilingual documents, or decide which downstream translation or NLP pipeline to run. The request schema also supports optional azure and google credential objects when you want to use those providers directly.

The response wraps provider-specific output under data.azure, data.apyhub, or data.google, so you can read the detection result from the service you selected without guessing at extra fields. If you already have a text-processing workflow, this endpoint fits as a lightweight language identification step before indexing, moderation, translation, or analytics.

Because the input is just text plus an optional provider selection, it is easy to slot into forms, ingestion jobs, and batch processing flows where language needs to be detected before the next step runs.

Provider (requested_service)Atoms
Azure500
Google500
ApyHub2000
POST
Detect language of text
http://localhost:8080/apyhub/ai-detect-language
QUICKSTARTGUIDE

Quickstart

Send a text sample to detect its language.

curl -X POST "http://localhost:8080/apyhub/ai-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 can contain azure, apyhub, and google fields, each holding that provider’s language-detection response object.

{
  "data": {
    "apyhub": {},
    "azure": {},
    "google": {}
  }
}
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 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

ParameterTypeMandatoryDescription
textStringYesThe text to analyze.
azureObjectNoCustom credentials for Azure services. Includes optional fields such as key, region, endpoint, account_id, and access_token.
azure.keyStringYes (if azure is selected in requested_service)Azure subscription key.
azure.regionStringNoAzure service region.
azure.endpointStringYes (if azure is selected in requested_service)Azure endpoint URL.
azure.account_idStringNoAzure account ID.
azure.access_tokenStringNoOAuth access token for Azure service.
googleObjectYes (if google is selected in requested_service)Custom credentials for Google services. Includes optional google_language and google_credential_json.
google.google_languageStringNoTarget language locale.
google.google_credential_jsonObjectNoGoogle service account credential JSON. See schema for nested fields.
requested_serviceENUMNoWhich 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.

ParameterTypeMandatoryDescription
dataObjectNoWrapper object for provider-specific language detection results.
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.