How to find entities with the Natural Language API
Google Cloud’s Natural Language API extracts entities from text. Send a document to the analyzeEntities method and you get each entity’s name, type (PERSON, ORGANIZATION, LOCATION and others), mentions and, in the v1 API, a salience score from 0 to 1 showing how central it is, plus a Knowledge Graph MID and Wikipedia URL when one is known. It is a useful proxy, not Google Search’s own analysis.
What does analyzeEntities return?
Per Google Cloud’s documentation:[1][2][3] Officially documented
- name and type, such as PERSON, ORGANIZATION, LOCATION, EVENT, WORK_OF_ART, CONSUMER_GOOD, or OTHER.
- metadata, which can include
mid(a Knowledge Graph machine ID such as/m/012z8_) andwikipedia_url. - salience (v1): a score in the 0 to 1.0 range giving “the importance or centrality of that entity to the entire document text.”
- mentions: each place the entity appears, marked PROPER or COMMON.
The v2 reference describes a probability on mentions rather than salience, so use the v1 endpoint if you need salience.[3]
How do you run it?
- Enable the Cloud Natural Language API in a Google Cloud project and set up credentials.[1]
- Send the page’s main text (not the navigation) to the endpoint:
POST https://language.googleapis.com/v1/documents:analyzeEntities
{"document": {"type": "PLAIN_TEXT", "content": "Local Blitz is a marketing agency in San Diego..."},
"encodingType": "UTF8"}
- Sort entities by salience and note which have a
mid. - Repeat for the top-ranking pages on the same query and compare.
How do you read the results?
| Observation | Possible action |
|---|---|
| Your main entity is not the most salient | Name and define it earlier; make it the subject of sentences |
Entity has no mid | The API could not link it to a known entity; add context such as location or type |
| Competitors mention entities you do not | Check whether they belong in a complete answer (related entities) |
| Wrong entity linked (same name) | Add disambiguating attributes in the text |
These actions are practitioner interpretations. Practitioner practice Chasing a salience number is not a goal in itself; see entity salience.
What are the limits?
- It is a Google Cloud product; Google has not said Search uses the same model.
- Usage beyond the free allowance is billed; check current pricing.
- Results vary with the text you send, so strip boilerplate first.
Frequently asked questions
Does Google Search use the Natural Language API?
Google has not said so. Treat the API as an approximation of how a machine reads your text, not as Google Search's view.
What is a good salience score?
There is no target. Salience is relative within one document; what matters is that the main entity is clearly the subject.
Why is there no salience in my results?
The v2 API reference replaces salience with mention probability. Use the v1 endpoint if you need salience.
See also
References
Pages accessed September 29, 2026 unless a date is given. See all sources and our editorial policy.
- ^ "Natural Language API basics". Google Cloud.
- ^ "Analyzing entities". Google Cloud.
- ^ "Entity (REST reference, v1)". Google Cloud.