Languages normalize
Exactlanguages_normalizeDeterministic and authoritative — the canonical answer for this input.
Normalize a language reference to an ISO 639 record. Covers the 184 living languages that have a two-letter 639-1 code; each matches by any of its 639-1/2B/2T/3 code variants, full English name, locale tag like 'en-US' (primary subtag extracted), or a curated misspelling list (not fuzzy matching). A language with only a 639-3 code and no two-letter sibling ('cmn' Mandarin) is not in the dataset and returns no match. Returns the full record with all code variants. Processing multiple inputs? Use `languages_normalize_batch` to do up to 1000 in one call.
Parameters
valuestringrequiredLanguage code, ISO name, or locale tag.
Call it
curl -X POST https://api.snipget.ai/v1/languages/normalize \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"value":"pt-BR"}'The Batch tab sends up to 1000 inputs in one call via /v1/languages/normalize/batch.
Example response
{
"lang_id": "por",
"part1": "pt",
"part2b": "por",
"part2t": "por",
"ref_name": "Portuguese",
"type": "L",
"matched_by": "locale"
}FAQ
Why use this instead of writing my own list of language codes?
It draws on the maintained ISO 639 reference set, so you get every official code variant for a language back in one shot. You do not have to keep your own lookup table of 'es' vs 'spa' vs 'Spanish' up to date or guess which spelling a spreadsheet used.
What kinds of input does it accept?
Two-letter codes (en), three-letter codes (eng, spa, zho), full English names (Spanish, Chinese), locale tags where it strips the region (en-US becomes en, pt-BR becomes pt), and common misspellings like 'portugese' or 'farsi' from a curated list — it does not do fuzzy matching, so an unlisted typo like 'spansih' comes back unmatched. It returns the full record with all the code variants plus the canonical name.
Does it cover every ISO 639-3 language?
No. The dataset is the 184 living languages that have a two-letter ISO 639-1 code; those match by any of their two- or three-letter code variants. A language with only a three-letter 639-3 code and no two-letter sibling, like 'cmn' for Mandarin specifically, is not in the dataset and comes back unmatched — use 'zh' or 'Chinese' for the macrolanguage instead.
Is the answer reliable, or is it a guess?
It is exact and deterministic. A given input maps to one authoritative ISO 639 record, and the same input always returns the same result. The 'matched_by' field tells you how it matched (code, name, locale, or a corrected spelling) so you can see exactly what happened.
What does it not do?
It does not translate text or detect what language a sentence is written in. It normalizes a language name or code into its standard ISO 639 record, nothing more. It also will not invent a match for free-text it does not recognize.
What happens if I send something it does not recognize?
You do not get an error. The call succeeds with confidence 0, every field set to empty, and a short reason explaining there was no match. Check the confidence: 1 means a clean match, 0 means it did not recognize the input.