2

I'd like to clarify how to use the Google knowledge graph API to obtain more specific information about an entity, such as the height or birthday of a person.

For instance, the documentation provides the following search for Taylor Swift:

https://kgsearch.googleapis.com/v1/entities:search?query=taylor+swift&key=API_KEY&limit=1&indent=True

This request returns some basic information, such as description, name, type, and id. However, the documentation sadly does not explain how to query specific properties for that person (even though the Person schema certainly contains that information).

I've tried changing the "query" value to "taylor+swift+birthday" but that returns something completely unrelated. I've also tried searching by the returned "id" (/m/0dl567 for the above example) but that doesn't give any extra information.

Some guidance on how to use the API in this way would be much appreciated! If however it's not possible to do this, what would be the best alternative?

Thanks!

1 Answers1

1

According to the Knowledge Graph Search API reference, information such as height or DOB is not included in the response.

The most reliable source of such information currently is Wikidata. Using the Wikidata Query Service, you can query the data you need for the entity with the given Freebase ID or Google Knowledge Graph ID:

SELECT ?item ?itemLabel ?birthdate
WHERE 
{
  ?item wdt:P646 "/m/0dl567".
  ?item wdt:P569 ?birthdate .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
  • Wow. That _could_ be helpful, as I have a very similar situation...it looks a bit more complex to use rather than just a 'regular' API, but I'll check it out. – CodeFinity Nov 23 '18 at 18:12