Language and the species API

language parameter is defined as

Language for vernacular names

Does that mean the language parameter only applies to the /species/{int}/vernacularNames route? If so, why do other routes list the language parameter, and why doesn’t the /species/{int}/vernacularNames route route list language as an accepted parameter? Or maybe the definition for language parameter above is wrong?

Even if you use language param on vernacularNames route, it doesn’t appear to have any effect, e.,g

https://api.gbif.org/v1/species/5231190/vernacularNames?language=fr

Whether I use language=fr, language=fre, language=FRENCH, language=french, none seem to change the outcome in the vernacularNames route.

I found the language enum https://gbif.github.io/gbif-api/apidocs/org/gbif/api/vocabulary/Language.html - Does this suggest the API expects complete language name? Upper case or title case?

Any help appreciated.

Hi Scott,

…/vernacularName retrieves all vernacular names.

The language parameter only applies to the /species, /species/{int}, /species/{int}/parents, /species/{int}/children, /species/{int}/related, /species/{int}/synonyms routes.

If it’s specified, the species returned will have an additional vernacularName parameter added, if a vernacular name is present.

For example, https://api.gbif.org/v1/species/5231190?language=de and https://api.gbif.org/v1/species/5231190/parents?language=de

It’s also possible to use the HTTP Accept-Language header instead of the language parameter, but I don’t recommend that for general API use. The language parameter takes priority. (We also seem not to be taking Accept-Language into account when caching API responses.)

Thanks @MattBlissett !

Ahhh, I see, the enum has

Enumeration for all ISO 639-1 language codes using 2 lower case letters. The enumeration maps to 3 letter codes and Locales.

I don’t think that is documented in the public API docs page at gbif.org. And maybe the language enum could be linked to as you link to the other enums?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.