How APITube handles languages and translation
How each article's language is auto-detected, where it appears, and why content is served in its original language
Written by Tasha Tatum
July 2, 2026
Updated July 6, 2026
How APITube handles languages and translation
APITube automatically detects the language of every article during processing and returns it as a two-letter code in each article’s language field. You choose which languages you receive with the language.code filter, and every article is delivered in its original language — the News API does not translate article text on the fly.
That means “handling languages” in APITube is two things: detection (built in, and exposed on every article) and filtering (you pass the language codes you want). Translation, on the other hand, is not an operation the News API performs for you — this is the main way detection and translation differ.
How does APITube detect an article’s language?
Language detection runs while the article is being parsed, before it ever reaches the API. APITube reads the article’s title and description first — the cleanest text available — and only falls back to the full body when that text is too short. This order matters: a page body often contains navigation and footer text in English, which can make a compact detector mislabel a Chinese or Japanese article as English. Detecting from the clean title and description avoids that.
The detected value is stored as an ISO 639-1 two-letter code such as en, fr, de, ja or zh. If the language genuinely cannot be determined, the article falls back to the code un (undetermined).
Where do I see an article’s language in the response?
Every article object carries a language field with its detected ISO 639-1 code, so you can confirm exactly what you received:
{
"id": 123456789,
"title": "…",
"language": "fr"
}
The language field is part of the standard enrichment returned with every article, alongside entities, sentiment and categories. For the full set of fields, see What NLP enrichment is applied to each article?.
How do I get news in specific languages?
Add the language.code parameter with one or more ISO 639-1 codes. This returns English and Spanish articles in a single call, ordered newest first:
curl "https://api.apitube.io/v1/news/everything?language.code=en,es&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"
Key rules for language.code:
- Up to three codes, separated by commas. Articles in any of those languages match (OR logic).
- Each code must be one or two characters; the value is case-insensitive, so
ENandenbehave the same. - The alias
usis treated asen.
To keep everything except certain languages, use ignore.language.code with the same rules:
curl "https://api.apitube.io/v1/news/everything?ignore.language.code=fr&api_key=YOUR_API_KEY"
For a deeper walkthrough of single-language, multi-language and exclusion patterns, see How to filter news by language.
Does the News API translate articles?
No. The News API returns each article in the language it was originally published and detected in — the title, description and body fields contain the source text, and there is no parameter to translate article text on request. To work across languages you have two grounded options: narrow results to the languages you can read with language.code, or read the detected language code on each article and run translation in your own stack downstream. Filtering by language is the supported, first-class way to control the languages in your results.
Which languages does APITube support?
The canonical list of language codes accepted by language.code — and detected on incoming articles — lives in the documentation’s list of supported languages, which currently contains 60 codes. Any two-letter code from that table is valid; a code that is not on the list is rejected (see the error question below).
Common Questions
- What does the language field contain if detection fails?
- Can I request more than three languages at once?
- What error means a language code is invalid?
- Does language.code change the language of the returned text?
What does the language field contain if detection fails?
When APITube cannot determine an article’s language, the language field falls back to un (undetermined) rather than guessing. Well-covered languages are detected reliably; un is the exception, not the norm.
Can I request more than three languages at once?
No. Both language.code and ignore.language.code accept at most three codes. If you list more, only the first three are applied and the rest are silently dropped — so language.code=en,fr,de,es behaves as en,fr,de. Keep the list to three meaningful codes.
What error means a language code is invalid?
A code that is empty or longer than two characters returns HTTP 400 with error ER0061 (or ER0063 for the ignore.language.code variant). A well-formed two-letter code that is not in APITube’s language list returns HTTP 400 with ER0237 (ER0239 for the ignore variant) and a message like language with code 'xx' not found.
Does language.code change the language of the returned text?
No. language.code only filters which articles come back; it never translates them. Each matching article is still delivered in its original language, and its language field reflects that original, detected language.