Language detection · Multilingual interfaces
Language API
From a message
to a language code.
Identify the language of incoming text. Get language codes, native names and reading direction for multilingual forms, inboxes and apps.
Detect 32 languages. One request.
Detection · Language lookup
Language data.
Ready for your app.
Detect incoming text or look up a language code. Use the answer to route messages, localize labels and build language pickers.
Route a message by language.
Use the returned code to choose a translation or support queue.
Request
curl 'https://api.parseapi.com/language/detect?deep=true' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"text":"明日の午後に新しい請求書を事務所まで送ってください。"}'Example response
{
"language": "ja",
"name": "Japanese",
"name_local": "日本語",
"script": "Jpan",
"direction": "ltr",
"deep": {},
"iso_alpha3": "jpn",
"JP"
]
}Unknown result
For example, send {"text":"12345"}.
{
"language": null,
"name": null,
"name_local": null,
"script": null,
"direction": null,
"deep": {},
"iso_alpha3": null,
"countries": null
}Language pickers · Interface labels
Make choosing
a language easy.
Give people familiar labels in signup and settings. Show native names, or use translated names that fit the rest of your interface.
In a French interface, show japonais. The native Japanese name stays 日本語.
- English name
- Japanese
- French name
- japonais
- Native Japanese name
- 日本語
Reading direction
Arabic script · Right to left
Arab · rtl
العربية
Language codes · Country links
Keep language
settings consistent.
Accept codes from imports, forms and connected systems. Return one consistent language code, with country links available in Deep.
Explore language lookupsengen
Both resolve to English.
- Language
- ja
- Three-letter code
- jpn
- Country
- JP
GET /language/ja?deep=true
Language → Country → State
Keep the names in one language.
Use the selected language code for display names across your country and state pickers. The person’s country choice stays separate from their language preference.
Show the language’s own name
/language/ja
Fields from the response
{
"language": "ja",
"name_local": "日本語"
}Japanese returns language ja and name_local 日本語. Use the native name in your language picker.
Use
languageTranslate the country picker
/country?lang=ja
Pass the selected language code as lang. The country codes stay the same while available display names change.
Use
languageKeep the selected country’s states in step
/country/JP/states?lang=ja
If the person selects Japan, load JP’s subdivisions with the same lang value. Missing translations keep their existing label.
After the person independently selects a country
Use this in your app
// Run on your server with PARSEAPI_KEY in the environment.
const key = process.env.PARSEAPI_KEY;
if (!key) throw new Error('Set PARSEAPI_KEY on your server.');
const segment = value => encodeURIComponent(value);
const timezonePath = zone => zone.split('/').map(segment).join('/');
async function lookup(path, query = {}) {
const url = new URL(path, 'https://api.parseapi.com');
url.search = new URLSearchParams(query).toString();
const response = await fetch(url, {
headers: { 'X-API-Key': key, 'Parse-Version': '2.0.0' },
signal: AbortSignal.timeout(10000),
});
if (!response.ok) {
const error = await response.json().catch(() => null);
throw new Error(error?.message ?? 'ParseAPI returned HTTP ' + response.status);
}
return response.json();
}
const language = await lookup('/language/' + segment('ja'));
if (!language.language) throw new Error('Choose a supported display language.');
const countries = await lookup('/country', { lang: language.language });
// This country is selected independently; language does not determine location.
const selectedCountryCode = 'JP';
const selectedCountry = countries.countries?.find(row => row.country === selectedCountryCode);
const states = selectedCountry?.country
? await lookup('/country/' + segment(selectedCountry.country) + '/states', { lang: language.language })
: null;
console.log({ language, countries, states });Detect 32 languages.
- ar
العربية
Arabic
- ca
català
Catalan
- zh
中文
Chinese
- hr
hrvatski
Croatian
- cs
čeština
Czech
- da
dansk
Danish
- nl
Nederlands
Dutch
- en
English
- fi
suomi
Finnish
- fr
français
French
- de
Deutsch
German
- el
Ελληνικά
Greek
- he
עברית
Hebrew
- hi
हिन्दी
Hindi
- hu
magyar
Hungarian
- id
Indonesia
Indonesian
- it
italiano
Italian
- ja
日本語
Japanese
- ko
한국어
Korean
- ms
Melayu
Malay
- nb
norsk bokmål
Norwegian Bokmål
- pl
polski
Polish
- pt
português
Portuguese
- ro
română
Romanian
- ru
русский
Russian
- sk
slovenčina
Slovak
- es
español
Spanish
- sv
svenska
Swedish
- th
ไทย
Thai
- tr
Türkçe
Turkish
- uk
українська
Ukrainian
- vi
Tiếng Việt
Vietnamese
From the first request to your app
Build it into
your app.
Use one API key to detect text and look up language details. Connect the results to your support queues, translation tools and interface labels.
Start with HTTP
Copy the POST example for text detection. Existing SDK and MCP language lookups return names, scripts and direction from a code.
Before you build.
How do I detect the language of text?
POST a JSON object with a text string to /language/detect. The response includes its code, English and native names, script and text direction. Its ISO 639-3 code and country links are included on every plan. Text detection uses one request from your shared allowance.
Which languages can text detection return?
Detection supports the 32 languages listed above, including Indonesian, Malay, Danish and Norwegian Bokmål. Norwegian uses nb and Chinese uses zh. Language-code reference lookups have their own larger catalog.
What does an unknown detection return?
Unidentified, unsupported or ambiguous text can return HTTP 200 with all five language fields set to null. The ISO 639-3 code and country references also stay null. Send one language per request. Detection is an estimate; short text and related languages can be mistaken for a supported language.
Which language codes can I use?
Use a supported two-letter ISO 639-1 or three-letter ISO 639-3 code. Codes are case-insensitive. en and eng return the same language, with en as the canonical code. Languages without a two-letter code keep their three-letter code, such as gsw for Swiss German.
How do I show a native language name?
Use name_local ?? name. Japanese returns 日本語 and Arabic returns العربية. name_local is null when the native name is unavailable or identical to the original English name. A missing script also stays null.
Can I translate the language labels?
Add lang= with a supported display-language tag. For example, /language/ja?lang=fr returns japonais as name and keeps 日本語 as name_local. Missing translations retain the existing display name. The native name, codes, script and direction stay unchanged. This selects reference labels; it does not translate your application content.
How do I use script and direction?
script is an ISO 15924 code, such as Latn, Jpan or Arab. direction is ltr or rtl and can supply the HTML dir attribute for a language label or interface. These are language reference conventions, not detection of the script or direction of arbitrary text.
What do the country links mean?
Core includes iso_alpha3 and countries. The countries are ISO alpha-2 codes from country records that list this language. Look up each code with /country/{code} for its country details. These associations do not measure speaker counts or every place where a language is spoken.
Does this include every language and locale?
The reference covers the two-letter ISO 639 language set and additional codes used by the country catalog. It accepts language codes such as en, ja and gsw. Regional locale tags such as en-US are not lookup codes. An unsupported language code returns 404; malformed input returns 400.
What is included with a free API key?
Text detection, language names, native names, scripts, direction and translated display labels are available on every plan. The three-letter code and country references are included on every plan. Each detection or lookup uses your API request allowance, shared with the other ParseAPI products.
Language API pricing
Put language
to work.
Text detection and language lookups are included on every plan. Reference Deep is included on paid plans. Your API request allowance is shared across ParseAPI products.
Free
Start free
Try Language with a free API key.
Room to grow
See plans
Choose the volume your app needs.