Skip to main content
Glama
localseodata

Local SEO Data

Official

ai_scraper

Read-only

Scrape ChatGPT or Gemini answers for a keyword to extract cited sources and the ranked local businesses each AI recommends. Use it to track where a business appears in AI search results.

Instructions

Use when scraping ChatGPT or Gemini search results for a keyword. Returns markdown response, local_businesses, sources, fan_out_queries, and brand_entities. Each entry in sources carries a position — the order it was cited, from 1, after duplicates collapse. Costs 4 credits.

TWO RANKINGS, DO NOT MERGE THEM: local_businesses is the platform's LISTING, in the order it emitted cards. recommended_businesses is the SHORTLIST read out of the answer's own prose, in the order the answer argued for it, with shortlist_rank, listed, mention, is_top_pick and the citation offered beside each entry. listed: true means the entry held a place in a list the answer presented and shortlist_rank is that place; listed: false means the answer named it in a sentence instead, so shortlist_rank is null rather than a position it never had. mention is the answer's own words about the business, plain text — the evidence behind the row. They disagree routinely — ChatGPT opens a local answer by dumping its whole result set and only then writes the list it recommends, so a business the prose puts third can sit tenth in the array. Quote shortlist_rank when a client asks where an AI RECOMMENDS them.

GEMINI HAS NO LISTING AT ALL: it sends no business block, so local_businesses is empty on every gemini local query and recommended_businesses is the only place a business appears. An empty array on gemini is not evidence that nobody was named.

LOCAL BUSINESSES: on a local question, chat_gpt lists businesses inside its answer and we return them as local_businesses — rank, name, category, rating, reviews_count, address, phone, website, domain. Field names it shares with /v1/serp/local-pack mean the same things, so code reading those works against both — but the sets differ: this adds category and domain, and has no cid or hours. gemini has no equivalent and returns an empty array — read recommended_businesses there.

FORCE A SEARCH ON CHAT_GPT: chat_gpt sometimes answers a local prompt with a clarifying question ("which Orange County do you mean?") instead of an answer, which reads as an empty result. force_web_search: true makes it answer, at the same 4 credits, and is what makes the local_businesses block appear reliably. gemini decides for itself and returns a 400 if you ask.

MATCHING CITATIONS ON GEMINI: local answers often cite Google Business Profiles, which arrive with domain "maps.google.com" and the business name in title, identified by the cid in the URL. Match on title or cid rather than domain for those.

search_results is a reserved field we have not observed populated on either platform — read sources. fan_out_queries and brand_entities depend on the query and platform and are often empty.

SLOW: we ask ChatGPT or Gemini the question live and wait for the full answer. May take 30-90 seconds. This is normal, not an error — do not retry a call still in flight, it starts a second billable job.

Input Schema

NameRequiredDescriptionDefault
freshNoBypass the hour of caching and run the query again. Use when sampling the same prompt repeatedly to measure how the answer varies — a cached hit would return the earlier run and hide the variance. Always billed at the normal price, since there is no cache hit to be free.
keywordYesKeyword to scrape results for (e.g. "best electrician")
languageNoLanguage to ask in, as ISO 639-1 code or name (e.g. "fr", "French"). Defaults to the language of the market you pass — a French location is asked in French. This tool queries the model live and covers 43 languages worldwide, so this is not limited the way the AI mention endpoints are.
locationNoLocation for results (e.g. "Boston, MA"). Gemini supports city-level; ChatGPT resolves to country. Default: US
platformYesWhich platform to scrape (chat_gpt or gemini)
force_web_searchNoRequire the platform to search the web before answering. chat_gpt only; gemini returns a 400. Does not change the price. Reach for it when a local prompt comes back as a clarifying question rather than an answer.

Output Schema

NameRequiredDescriptionDefault
modelYes
keywordYes
sourcesYes
markdownYes
platformYes
brand_entitiesYes
reader_versionNo
search_resultsYes
fan_out_queriesYes
local_businessesNo
recommended_businessesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv1.1.0
    • addedInput schema / properties / force_web_search
      Added value: +{
      +  "description": "Require the platform to search the web before answering. chat_gpt only; gemini returns a 400. Does not change the price. Reach for it when a local prompt comes back as a clarifying question rather than an answer.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / fresh
      Added value: +{
      +  "description": "Bypass the hour of caching and run the query again. Use when sampling the same prompt repeatedly to measure how the answer varies — a cached hit would return the earlier run and hide the variance. Always billed at the normal price, since there is no cache hit to be free.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / language
      Added value: +{
      +  "description": "Language to ask in, as ISO 639-1 code or name (e.g. \"fr\", \"French\"). Defaults to the language of the market you pass — a French location is asked in French. This tool queries the model live and covers 43 languages worldwide, so this is not limited the way the AI mention endpoints are.",
      +  "type": "string"
      +}
    • changedInput schema / properties / location / description
      Previous value: -"Location for results (e.g. \"Boston, MA\"). Default: US"New value: +"Location for results (e.g. \"Boston, MA\"). Gemini supports city-level; ChatGPT resolves to country. Default: US"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": true,
      +  "properties": {
      +    "brand_entities": {
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "category": {
      +            "type": "string"
      +          },
      +          "title": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "title",
      +          "category"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "fan_out_queries": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "keyword": {
      +      "type": "string"
      +    },
      +    "local_businesses": {
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "address": {
      +            "type": "string"
      +          },
      +          "category": {
      +            "type": "string"
      +          },
      +          "domain": {
      +            "type": "string"
      +          },
      +          "name": {
      +            "type": "string"
      +          },
      +          "phone": {
      +            "type": "string"
      +          },
      +          "rank": {
      +            "type": "number"
      +          },
      +          "rating": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "reviews_count": {
      +            "type": "number"
      +          },
      +          "website": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "rank",
      +          "name",
      +          "category",
      +          "rating",
      +          "reviews_count",
      +          "address",
      +          "phone",
      +          "website",
      +          "domain"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "markdown": {
      +      "type": "string"
      +    },
      +    "model": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "platform": {
      +      "type": "string"
      +    },
      +    "reader_version": {
      +      "type": "number"
      +    },
      +    "recommended_businesses": {
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "citation": {
      +            "additionalProperties": true,
      +            "properties": {
      +              "domain": {
      +                "type": "string"
      +              },
      +              "url": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "url",
      +              "domain"
      +            ],
      +            "type": "object"
      +          },
      +          "is_top_pick": {
      +            "type": "boolean"
      +          },
      +          "listed": {
      +            "type": "boolean"
      +          },
      +          "mention": {
      +            "type": "string"
      +          },
      +          "name": {
      +            "type": "string"
      +          },
      +          "shortlist_rank": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "shortlist_rank",
      +          "name",
      +          "is_top_pick",
      +          "citation"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "search_results": {
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "description": {
      +            "type": "string"
      +          },
      +          "domain": {
      +            "type": "string"
      +          },
      +          "title": {
      +            "type": "string"
      +          },
      +          "url": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "title",
      +          "url",
      +          "domain",
      +          "description"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "sources": {
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "domain": {
      +            "type": "string"
      +          },
      +          "position": {
      +            "type": "number"
      +          },
      +          "snippet": {
      +            "type": "string"
      +          },
      +          "title": {
      +            "type": "string"
      +          },
      +          "url": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "title",
      +          "url",
      +          "domain",
      +          "snippet"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "keyword",
      +    "platform",
      +    "model",
      +    "markdown",
      +    "search_results",
      +    "sources",
      +    "fan_out_queries",
      +    "brand_entities"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Adds substantial context the annotations cannot carry: 4-credit cost, 30-90 second live latency with an explicit 'do not retry' warning, hour-long caching, and Gemini's 400 on force_web_search. It also discloses that search_results is unpopulated and that fan_out_queries/brand_entities are often empty.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the trigger well, but the body sprawls across six all-caps sections and spends a lot of prose on return-value semantics that an output schema already covers. The two-rankings warning earns its place; the LOCAL BUSINESSES field-by-field recap is redundant padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite an output schema, the description supplies the interpretive knowledge an agent cannot derive structurally: local_businesses vs recommended_businesses ordering divergence, listed/shortlist_rank null semantics, and Gemini's empty-listing trap. Nothing needed to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so every parameter is already documented in the schema, and the description largely restates force_web_search behavior rather than extending it. No new syntax, format, or edge-case detail is added for keyword, location, language or fresh.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific trigger verb and resource: scrape ChatGPT or Gemini search results for a keyword. The distinction from siblings like ai_mode or ai_llm_response is only implicit (platform-level AI answers), never named, so it misses the top band.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear when-to-use context ('Use when scraping ChatGPT or Gemini search results for a keyword') plus situational guidance for force_web_search and for reading recommended_businesses on Gemini. It never names a sibling alternative or an explicit when-not, so it stops short of 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.