Entities & Knowledge Graphs

Knowledge Graph ID (KGMID)

In shortThe unique machine ID Google assigns to an entity in its Knowledge Graph, such as /m/0dl567 or /g/11…, used to identify it unambiguously.

Updated 24 Oct 2026· 2 min read

A Knowledge Graph ID, often called a KGMID or machine ID (MID), is the unique identifier Google uses for an entity in its Knowledge Graph. It looks like /m/0dl567 or /g/11b.... Having one is a strong sign that Google recognises your brand, person or product as a distinct thing, separate from any keyword string.

How it works

Older IDs starting with /m/ come from Freebase, the open database Google acquired and later shut down; newer ones start with /g/. The same ID appears in several Google tools:

  • The Knowledge Graph Search API returns it as "@id": "kg:/m/0dl567", alongside the entity name, types, description and a resultScore.
  • The Google Cloud Natural Language API returns a mid in an entity’s metadata when the entity is linked to the Knowledge Graph, often with a Wikipedia URL.
  • Google Trends uses the same IDs for topics, so you can query a topic instead of a search term.
  • Wikidata records them under property P2671, Google Knowledge Graph ID.

You can also view an entity directly by adding kgmid=/m/... as a parameter to a Google search URL.

How it’s used in SEO and marketing

  • Checking in an entity audit whether your brand and key people have a KGMID at all.
  • Confirming that the entity an NLP API detects on your page is the right one, not a namesake (see entity disambiguation).
  • Tracking topics in Google Trends without the noise of ambiguous strings.
  • Referencing your entity consistently across schema, Wikidata and other profiles.

Example

In MLforSEO’s PyTrends guide, a 2021 lookup returned the entity /m/0hmyfsv as “Facebook, Social networking service company”. Run the same code today and the same ID comes back as Meta, technology company. Entities survive rebrands; keyword strings don’t.

Limitations and things to watch

  • No KGMID does not mean no visibility, and having one does not guarantee a knowledge panel.
  • The resultScore reflects how well an entity matched your query. Use it to compare candidates for the same query rather than as an absolute authority rating.
  • Google says the Knowledge Graph Search API is not suitable as a production-critical service, and it is being transitioned to Cloud Enterprise Knowledge Graph.
  • IDs can be merged or change their description over time. Re-check periodically.

Learn it on MLforSEO

Where Knowledge Graph ID (KGMID) shows up on MLforSEO

Sources and further reading

Other terms from Entities & Knowledge Graphs

See all 22 Entities & Knowledge Graphs terms →