Page MenuHomePhabricator

Wikidata API call to get labels and descriptions from Wikidata IDs
Closed, DeclinedPublic

Description

This allows us to get labels in any language from a list of Wikidata IDs.

Parameters for call to https://wikidata.org/w/api.php :

actionwbgetentities
propslabels, descriptions
ids[List of Wikidata IDs]
languages[List of Language codes]
languagefallback

Use the | symbol to separate multiple values for all parameters

The languagefallback parameter with no value will use all available languages for a fallback. So you will always get a value for each language requested.


Example: get English and French labels for Q10884, Q527 and Q33767
https://www.wikidata.org/w/api.php?action=wbgetentities&props=labels|descriptions&ids=Q10884|Q527|Q33767&languages=en|fr&languagefallback=

Very simple results structure, with Wikidata ID as key to access label and description properties for each requested item

Event Timeline

NavinoEvans renamed this task from API call to get labels for Wikidata IDs used in depicts statements to Wikidata API call to get labels for Wikidata IDs used in depicts statements.May 3 2019, 11:18 PM
NavinoEvans renamed this task from Wikidata API call to get labels for Wikidata IDs used in depicts statements to Wikidata API call to get labels and descriptions from Wikidata IDs.May 4 2019, 12:42 PM
NavinoEvans updated the task description. (Show Details)