Wikidata entity value from name

Oroku picture Oroku · Dec 12, 2014 · Viewed 8.8k times · Source

Is there a way to get Wikidata page information based on the name of the entity for example if I wanted to get page data for Google. I think it has to be done using "entity" with the corresponding entity value however I am not sure of there is any easy way to determine the entity value.

Answer

svick picture svick · Dec 13, 2014

If you want to do this using the API, you would first use wbsearchentities to find out which entity do you want. For example:

https://www.wikidata.org/w/api.php?action=wbsearchentities&search=Google&language=en

The problem with this is that there are multiple entities called "Google": the company (Google Inc.), the search engine (Google Web Search), the verb (to google) and even a Wikipedia disambiguation page.

After you somehow decide which entity to access, use wbgetentities to actually get the information you want:

https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q95&languages=en

Or, if you can't decide which entity to use, you could get information for all of them at the same time:

https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q95|Q9366|Q961680|Q1156923&languages=en