Skip to Content
BuddyGeoDocs

Languages

Ask for results in a language with the lang parameter, and read result.language to see which language you received.

Place names and address parts exist in more than one language for many features. The lang parameter chooses which one you get back.

Request a language

Add lang with a BCP 47 language tag to /v1/reverse or /v1/search. Without it, results are returned in English (en).

curl "https://api.buddygeo.com/v1/reverse?lat=35.6586&lon=139.7454&lang=ja" \
  -H "X-API-Key: YOUR_API_KEY"

For Tokyo Tower, lang=ja returns 〒105-0011 東京都港区芝公園四丁目2-8, with the parts of the address in Japanese as well. With lang=en, or no lang at all, the same feature is returned in English.

Address formatting follows the language too, not only the words: the French version of the CN Tower address reads 290, boulevard Bremner, Toronto (Ontario) M5V 3L9, Canada.

What you get when a language is missing

Not every feature is mapped in every language. BuddyGeo resolves lang in this order:

  1. Exact tag. lang=pt-BR is used if the feature has a pt-br version.
  2. Primary language. Otherwise the region is dropped: pt-BR falls back to pt, fr-CA to fr.
  3. The feature's default language. If neither exists, the feature is returned in its own default language, usually the local one. Tokyo Tower requested with lang=de comes back in Japanese.

The fallback is never silent. Two fields on every result tell you what happened:

FieldMeaning
result.languageThe language this result is actually written in
result.available_languagesThe languages this feature can be returned in
{
  "formatted": "〒105-0011 東京都港区芝公園四丁目2-8",
  "language": "ja",
  "available_languages": ["ja", "en"]
}

If your product must show one language only, compare result.language with what you asked for and request lang=en as a second choice when they differ. A fallback result is still a successful lookup and costs one credit, like any other.

Common languages

The playgrounds offer the following language presets (and the API accepts any standard BCP 47 language tag). Every feature returns its local name or an English version when available, and regional names where mapped (for example Japanese for Tokyo, Portuguese for São Paulo, and French for Toronto, Paris, and Brussels).

langLanguage
enEnglish
frFrench (Français)
deGerman (Deutsch)
esSpanish (Español)
ptPortuguese (Português)
nlDutch (Nederlands)
jaJapanese (日本語)
zhChinese (中文)
arArabic (العربية)
hiHindi (हिन्दी)
neNepali (नेपाली)
afAfrikaans

Searching in another script

Forward search matches names in their native script as well as in English. q=東京タワー finds Tokyo Tower without lang; add lang=ja to get the answer in Japanese too. Diacritics are ignored when matching, so Sao Paulo and São Paulo find the same places.

Nominatim-compatible endpoints

The compatibility aliases /reverse and /search read the language from accept-language, as Nominatim does. See Nominatim migration.

Open in the app

On this page