Google APIs & Python: Using the Knowledge Graph Search API

Karla Hernández
Random Noise
Published in
5 min readMay 24, 2023

--

How to use Google’s Enterprise Knowledge Graph API to look up entities. Think of this article as a “quickstart” for people who have never used Google Cloud APIs with Python.

While the documentation on getting started with the API is clear, there is still a need to “piece things together”. For people new to Google APIs, the quickstart docs might prove to be… not so quick. The purpose of this article is to put all pieces in one place and round off the edges.

What is Google’s Knowledge Graph?

From Wikipedia:

The Google Knowledge Graph is a knowledge base from which Google serves relevant information in an infobox beside its search results. According to Google, its information is retrieved from many sources, including the CIA World Factbook and Wikipedia. It is used to answer direct spoken questions in Google Assistant and Google Home voice queries.

From Google:

The Knowledge Graph allows us to answer factual questions such as “How tall is the Eiffel Tower?” or “Where were the 2016 Summer Olympics held.” Our goal with the Knowledge Graph is for our systems to discover and surface publicly known, factual information when it’s determined to be useful.

What are Knowledge Graph Entities?

From Google:

The Knowledge Graph has millions of entries that describe real-world…

--

--