Home/Getting started/Quickstart ENУКРРУС API Reference (ReDoc) ↗

Quickstart

One call, no setup — and the three things worth knowing about the answer.

There is nothing to set up. The API is public, unauthenticated and read-only.

Resolve one language

curl "https://languages.service.custom.mt/v1/resolve?provider=deepl_api&language=pt_BR"
{
  "query": "pt_BR",
  "provider": "deepl_api",
  "language": "pt-BR",
  "code": "PT-BR",
  "supported": true,
  "match": "exact",
  "matched_alias": null,
  "via_language": null
}

code is the answer — the string to put in the provider request. Everything else explains it.

Three things about that response

code comes back even when it equals your input. Do not special-case the pass-through; always send what code says. That is the whole point: your caller stops needing to know which providers are fussy.

language is the canonical code. Store this, not the spelling you received. pt_BR, PT-BR and por-br all canonicalise to pt-BR, so storing the canonical form is what makes two records comparable later.

match tells you how sure we are. exact means someone configured this pair deliberately. Anything else means the answer was derived — correct and safe to use, but not curated. See Resolution Ladder for the full ladder.

Resolve a whole job in one round trip

A translation job needs a source and a target; a project fans one source across many targets. Ask for all of them at once:

curl -X POST https://languages.service.custom.mt/v1/resolve/batch \
  -H 'Content-Type: application/json' \
  -d '{"pairs":[
        {"provider":"deepl_api","language":"en-GB"},
        {"provider":"deepl_api","language":"pt_BR"}
      ]}'

The response preserves order, and each item carries either result or error — one unknown language never costs you the rest of the batch.

Naming a provider

Three forms all work:

Form Example
Catalog code deepl_api
Short name deepl
Legacy console service_name OpenAiGPT4o_2024_11_20_Provider

The catalog codes are the same ones provider_credentials uses, so one identifier carries across both services. The legacy names exist so callers migrating off the console do not have to change anything on day one — see Migrating from the Console.

Naming a language

Any registered spelling, matched case- and separator-insensitively. zh_hans, ZH-HANS and zh-Hans are the same key. See Aliases and Normalisation.

When something is not found

{ "error": { "code": "language_not_found",
             "message": "Unknown language code: 'xx-YY'",
             "details": { "language": "xx-YY" } } }

Branch on error.code, never on the message. Full list: Error Codes.

If you are cleaning up a list of codes and would rather classify than catch exceptions, use /v1/normalize — it answers 200 with known: false instead of 404. See Normalise incoming codes.

Next