apyhub

Basic Language Detection API

What it does

Language Detection identifies the language of text you send in q and returns the detected language with a confidence score. It works with a single string or an array of strings, so you can classify one snippet or batch multiple texts in one request.

Use Language Detection when you need to route incoming support messages, auto-select translation targets, or sort multilingual content before downstream processing. The response stays compact: each result includes only the detected language label and its confidence value.

Send raw text in q and read back the language prediction for each item. If you pass an array, the response is shaped as an array of result arrays, matching the input batch structure.

This is a fit for apps that ingest user-generated content, analytics pipelines that need language grouping, and localization workflows that need a quick language check before translation or moderation.

▣ ENDPOINT 01 / 02
GET
List Supported Languages
http://localhost:8080/dosvak/basic-detect-language
QUICKSTARTGUIDE

Quickstart

Fetch the list of supported languages for a target by passing it as a query parameter.

curl -X GET "http://localhost:8080/dosvak/basic-detect-language?target=en" \
  -H "x-rapidapi-proxy-secret: $APY_TOKEN"

What you'll get back

Returns a JSON array of objects. Each object includes a code string and a name string, describing one supported language; additional properties may also be present.

[
  {
    "code": "en",
    "name": "English"
  }
]
TRY ITLIVE · 10 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.

About this endpoint

What it does

Returns a JSON array of supported language objects for the requested target. Each array item contains a code string and a name string.

Query Parameter(s)

AttributeTypeMandatoryDescription
targetStringNoTarget language or locale identifier to filter supported languages. String length must be between 2 and 20 characters.

Response

Returns a JSON array of objects. Each object has a code string field and a name string field.

AttributeTypeMandatoryDescription
codeStringNoLanguage code.
nameStringNoLanguage name.

Query parameters

Name
Type
Description
targetOPTIONAL
string
▣ ENDPOINT 02 / 02
POST
Detect language for text
http://localhost:8080/dosvak/basic-detect-language
QUICKSTARTGUIDE

Quickstart

Detect the language of a piece of text by sending it as q in the JSON body.

curl -X POST "http://localhost:8080/dosvak/basic-detect-language" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"q":"Hello, how are you today?"}'

What you'll get back

Returns a JSON array. Each item is an object with a language string and a confidence number. Some responses may be a nested array of those same objects, as allowed by the schema.

[
  {
    "language": "en",
    "confidence": 0.99
  }
]
TRY ITLIVE · 10 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*

About this endpoint

What it does

Detects the language for the submitted text in q and returns the detection result as a JSON array. The request body accepts either a single string or an array of strings.

Request Body

ParameterTypeMandatoryDescription
qString ArrayYesThe text to analyze for language detection. Accepts either a single string or an array of strings.

Response

Returns a JSON array. The output schema allows either:

  • an array of objects, where each object has language as a string and confidence as a number, or
  • an array of arrays of such objects.
ParameterTypeMandatoryDescription
languageStringNoDetected language code or name as a string.
confidenceNumberNoConfidence score as a number.

Headers

Name
Type
Description
x-rapidapi-proxy-secretOPTIONAL
string

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.