Figure 1: Using Google's Natural Language API to extract local SEO entities and analyze competitor content
Stop guessing what Google thinks your page is about. The Google Cloud Natural Language API reveals exactly which entities—people, places, brands, concepts—Google's AI detects in your content, and how important they are.
In this step-by-step tutorial, you'll learn how to:
Whether you're a local business owner, an SEO agency, or a freelancer, this guide will give you a practical, repeatable workflow to build semantic authority in 2026.
The Google Cloud Natural Language API is a machine learning tool that reveals the structure and meaning of text. It extracts entities (proper nouns like people, places, organizations, and concepts) from any text you feed it, along with their salience (importance) scores.
Think of it as putting on Google's glasses. When you run your content—or your competitor's content—through this API, you see exactly what Google "sees" when it reads your page. You stop guessing and start knowing.
In traditional SEO, the fundamental unit was a keyword. In AI search (Google Gemini, ChatGPT, Perplexity), the fundamental unit is an entity—a unique, identifiable thing: a brand, a person, a concept, a place.
Key shift: LLMs don't count keyword frequency—they build knowledge graphs about your brand, asking: what is this thing? What category does it belong to? What relationships connect it to other entities?
For local SEO, this means:
Before you can use the API, you need a Google Cloud Platform (GCP) account.
The simplest way to test the API is with a cURL command. Open your terminal and run:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
--data '{
"encodingType": "UTF8",
"document": {
"type": "PLAIN_TEXT",
"content": "ABC Plumbing provides emergency boiler repair and 24/7 pipe installation services across Manchester, Salford, and Trafford. We are Gas Safe registered and available 365 days a year."
}
}' \
"https://language.googleapis.com/v2/documents:analyzeEntities"
If you plan to analyze multiple pages regularly, Python is more efficient:
# Import the Google Cloud client library
from google.cloud import language_v1
# Initialize the client
client = language_v1.LanguageServiceClient()
# Your text content (copy a competitor's page content here)
text = """ABC Plumbing provides emergency boiler repair and 24/7 pipe
installation services across Manchester, Salford, and Trafford.
We are Gas Safe registered and available 365 days a year."""
# Create a document object
document = language_v1.Document(
content=text,
type_=language_v1.Document.Type.PLAIN_TEXT
)
# Call the API to analyze entities
response = client.analyze_entities(document=document)
# Print results
for entity in response.entities:
print(f"Entity: {entity.name}")
print(f"Type: {entity.type_.name}")
print(f"Salience: {entity.salience:.4f}")
print(f"Mentions: {len(entity.mentions)}")
print("-" * 40)
# Filter for high-salience entities only (above 0.15 threshold)
high_salience = [e for e in response.entities if e.salience > 0.15]
print(f"\nHigh-salience entities found: {len(high_salience)}")
The API returns a JSON response with the following key fields:
| Field | What It Means | Why It Matters for Local SEO |
|---|---|---|
name |
The entity text (e.g., "Manchester") | This is what Google recognizes as a distinct entity |
type |
Entity category: PERSON, LOCATION, ORGANIZATION, etc. |
Tells you if Google sees your location, brand, or service as distinct entities |
salience |
Importance score from 0.0 to 1.0 | Higher salience = Google thinks this entity is central to your content |
mentions |
How many times the entity appears | Confirms entity frequency and context |
Example Response for the plumbing text above:
{
"entities": [
{
"name": "ABC Plumbing",
"type": "ORGANIZATION",
"salience": 0.4231,
"mentions": [{"text": {"content": "ABC Plumbing"}}]
},
{
"name": "Manchester",
"type": "LOCATION",
"salience": 0.3124,
"mentions": [{"text": {"content": "Manchester"}}]
},
{
"name": "Salford",
"type": "LOCATION",
"salience": 0.1876,
"mentions": [{"text": {"content": "Salford"}}]
},
{
"name": "Trafford",
"type": "LOCATION",
"salience": 0.1542,
"mentions": [{"text": {"content": "Trafford"}}]
}
]
}
This is where the real power of the NLP API reveals itself.
| Entity | Your Content (Salience) | Competitor A (Salience) | Competitor B (Salience) |
|---|---|---|---|
| Manchester | 0.31 | 0.52 | 0.48 |
| Salford | 0.19 | 0.08 | 0.35 |
| Trafford | 0.15 | 0.42 | 0.12 |
| Gas Safe | 0.09 | 0.28 | 0.31 |
| Emergency | 0.22 | 0.41 | 0.38 |
| 24/7 | 0.18 | 0.33 | 0.29 |
| Boiler Repair | 0.27 | 0.19 | 0.44 |
5. Spot the gaps: Where are your competitors scoring higher salience on critical entities?
Based on the comparison above, you can identify three types of gaps:
Problem: Your core entity (e.g., "Emergency Plumbing") has low salience compared to competitors.
Fix: Rewrite your introduction to establish dominance. Move your primary entity closer to the beginning of your content.
Example: Instead of starting with "We are a plumbing company," start with "Emergency plumbing services in Manchester—available 24/7, 365 days a year."
Problem: Competitors mention entities like "Trafford Centre" or "MediaCityUK" that you've completely ignored.
Fix: Organically add these missing entities to your content. Create dedicated paragraphs or service pages for these micro-locations.
Example: Add a section: "We serve businesses around the Trafford Centre and MediaCityUK with rapid response plumbing services."
Problem: You mention entities, but the API doesn't connect them strongly.
Fix: Use semantic triplets (Subject → Predicate → Object) to strengthen relationships.
Example: Instead of "We serve Manchester," write "[ABC Plumbing] → [provides] → [emergency services] to [Manchester] and [Salford] residents."
Based on your entity gap analysis, rewrite your:
Ensure your JSON-LD schema includes all the entities the API detects:
{
"@context": "https://schema.org",
"@type": "LocalBusiness",
"name": "ABC Plumbing",
"address": {
"@type": "PostalAddress",
"addressLocality": "Manchester",
"addressRegion": "Greater Manchester"
},
"areaServed": ["Manchester", "Salford", "Trafford"],
"openingHours": "Mo-Su 00:00-23:59",
"memberOf": {
"@type": "Organization",
"name": "Gas Safe Register"
}
}
If you discovered missing location entities, create:
"We are a plumbing company based in the Greater Manchester area. We offer boiler repair, pipe installation, and emergency callouts. Our team is experienced and reliable."
NLP API Results:
plumbing (salience: 0.08)Greater Manchester (salience: 0.06)"ABC Plumbing provides emergency boiler repair and 24/7 pipe installation services across Manchester city centre, Salford Quays, and the Trafford Park area. We are Gas Safe registered and have served over 500 local businesses since 2015. Available 365 days a year—including weekends and bank holidays."
NLP API Results:
ABC Plumbing (salience: 0.45) — Organization entityManchester city centre (salience: 0.32) — Location entitySalford Quays (salience: 0.21) — Location entityTrafford Park (salience: 0.18) — Location entityGas Safe registered (salience: 0.15) — Organization entityemergency boiler repair (salience: 0.28) — Concept entity24/7 pipe installation (salience: 0.24) — Concept entityResult: Google's AI now clearly understands:
LOCATION entity (Manchester) is different from an ORGANIZATION entity (Gas Safe). Make sure you're covering all relevant entity types.areaServed in JSON-LD.The Google Cloud Natural Language API is a machine learning tool that extracts entities (people, places, organizations, concepts) from text, along with their importance scores (salience). It reveals how Google's AI "reads" your content.
New Google Cloud customers receive $300 in free credits. Additionally, the Natural Language API offers 5,000 free units per month—enough to analyze 10-20 competitor pages for free.
Salience is a score from 0.0 to 1.0 that indicates how important an entity is to the overall text. Higher salience = Google's AI thinks this entity is central to understanding your content.
Copy the text from their homepage, service pages, and About Us page. Paste it into the Python script or cURL command. Run the analysis and compare the entities and salience scores against your own content.
The API detects multiple entity types including: PERSON, LOCATION, ORGANIZATION, DATE, NUMBER, ADDRESS, EVENT, WORK_OF_ART, CONSUMER_GOOD, and more.
Run a full entity audit quarterly, or whenever you: create new service pages, enter a new geographic market, notice a competitor overtaking you in the Local Pack, or update your website content significantly.
Yes! Voice searches are more conversational and entity-focused (e.g., "Where is the closest open vet?"). Use the API to identify the entities in your voice search target queries and optimize your content accordingly.
Run your GBP description through the API. If key location entities (your city, neighborhoods, landmarks) have low salience, rewrite your description to strengthen those entities. Also ensure your GBP categories align with your highest-salience service entities.
At Ranking Matters, we use advanced entity analysis, NLP API auditing, and AI-powered content strategies to help local businesses dominate their market.
Let us build a custom entity map that drives real calls and foot traffic.