PPeople EngineOptimization

How to find your KGMID, your Google Knowledge Graph ID

. Compiled by the People Engine Optimization desk from the sources listed at the end of this page.

Search your name in Google's Knowledge Graph Search API with the type set to Person, then read the @id field of the matching result. It looks like kg:/m/ or kg:/g/ followed by letters and numbers. A KGMID shows Google holds a record for the name. It does not mean a knowledge panel will appear.

Six steps to find a Knowledge Graph ID

StepWhat to doWhat to expect
1Get a Google API key for the Knowledge Graph Search APIGoogle lists prerequisites on its guide page first
2Run a search with query set to your full name and types set to PersonEach result is one entity record, not a graph
3Find the result whose name, description and URL are about youThe API can return several people with the same name
4Read the @id field of that resultIt appears as kg:/m/ or kg:/g/ followed by a code
5Confirm it by searching again with the ids parameter set to that IDThe same record should come back
6Write down the ID, the description shown and the dateGoogle says the API is not for production-critical use, so treat it as a snapshot

Download this table (CSV). Free to quote with a link to this page.

What a KGMID is

KGMID stands for Knowledge Graph machine ID. It is the identifier Google gives an entity in its Knowledge Graph. In the API's own sample the @id is kg:/m/0dl567 for a singer, which shows the shape of it. Newer records carry an ID beginning /g/. Wikidata's property page for the Google Knowledge Graph ID says its IDs start with /g/, and points to a different property for IDs that start with /m/.

What the API returns

Google's guide says the API finds entities in the Knowledge Graph, uses schema.org types and returns JSON-LD. Each result has a name, a type list, a description, often an image and a URL, and a resultScore. The guide says it returns only individual entities, not graphs of interconnected ones. The difference between the graph and a panel is covered separately.

Google is moving this API to a new product

Google's guide carries a warning that it is migrating the Knowledge Graph Search API to Cloud Enterprise Knowledge Graph, which it says gives the same functionality, and tells anyone new to the API to use the new product. The older API is still documented, and the steps on this page use it. If the older endpoint changes or stops, the lookup moves to the Enterprise product and the idea stays the same: search by name and type, then read the entity ID.

Request settings that help with a common name

The reference page lists the options. The ids parameter looks up one or more known IDs. The languages parameter runs the query in the language codes you give. The prefix parameter matches the start of names and aliases, which finds a person listed under a longer or shorter form of the name. The limit parameter defaults to 20 results and tops out at 500, and Google notes that high limits are more likely to time out, so keep it small and narrow by type instead.

Choosing the right result

If your name is common, you will get several people. Match on description and URL, not on the name alone. If the result you expected is missing, that tells you little, because Google's page says the API is not suitable as a production-critical service. If someone else's record carries your name, see knowledge panel mistakes and the pages on who actually gets a knowledge panel.

If you have a Wikidata item

A Wikidata item for you may carry the Google Knowledge Graph ID in property P2671. If it does, compare it with the @id you found. A mismatch means one of the two sources points at a different record, which is worth correcting. Our page on Wikipedia, Wikidata and AI trust explains why that cross-check matters.

What a KGMID does not tell you

Having an ID shows Google holds a record for the name. Google's help page says panels are generated automatically for entities in the Knowledge Graph, and does not say every entity gets one. Do not treat the resultScore as a trust or authority score, because Google's page prints a sample value and does not define it.

Where a build fits

A $3,000 build over 60 to 90 days works on the references that feed a record: consistent facts, one page that states them and independent pages that agree. A panel tends to appear on the bare name 6 to 12 months after, and nobody can guarantee one.

A fact from this site's own records

Our home page reports seven real people, with three where the name already works. Finding an ID is the quickest way to see which of the two groups a name is in, before any work is done.

Questions people ask

What is a KGMID?

It is the identifier Google gives an entity in its Knowledge Graph. In the Search API it appears in the @id field, in the form kg:/m/ or kg:/g/ followed by a code.

How do I find my Google Knowledge Graph ID?

Search your name in Google's Knowledge Graph Search API with types set to Person and read the @id of the result that matches your description and URL. You need an API key first.

Does having a KGMID mean I get a knowledge panel?

No. It shows Google holds a record. Google's help page says panels are generated automatically and does not promise one for every entity.

What is the difference between /m/ and /g/ IDs?

Wikidata's property page says its Google Knowledge Graph ID covers IDs starting with /g/, and that IDs starting with /m/ are handled by its Freebase ID property.

Why does the API show no result for my name?

Google says the API is not suitable as a production-critical service, so a missing result says little on its own. Check again later and search with a more specific name.

Read next

Sources

  1. Google for Developers: Knowledge Graph Search API guide
  2. Google for Developers: entities.search method reference
  3. Google for Developers: Knowledge Graph Search API prerequisites
  4. Wikidata: Google Knowledge Graph ID (P2671)
  5. Google Search Help: About knowledge panels
  6. Google Cloud: Enterprise Knowledge Graph search API