Python AI Visibility API
Query the raw answers ChatGPT, Perplexity, Google AI Overviews, Google AI Mode, Copilot and Gemini actually give - from Python, in one API call. Send a query to https://api.agentgeo.org/v1/fetches with your ag_live_ key and get back the answer text, its citations and its sources as clean JSON. No headless browser, no Selenium, no parsing Perplexity's HTML. AgentGEO is the answer-access layer for AI visibility. Your own code (or your users' AI agent over MCP) runs the GEO/AEO analysis - the API just hands you the raw data, structured and identical across all six engines.
Read this page with an AI
Query the raw answers ChatGPT, Perplexity, Google AI Overviews, Google AI Mode, Copilot and Gemini actually return - from Python, with a single API call. No headless browser, no Selenium, no parsing Perplexity's HTML. Just clean JSON with the answer text, citations and sources your code can act on.
Get a free AI-visibility audit → · Read the quickstart → - No card, no account.
Get my free auditCall the AI Visibility API from Python
POST to https://api.agentgeo.org/v1/fetches with your ag_live_ key as a bearer token, name the engines you want in the surfaces array, and you get back the exact answer each AI engine gave for the query - plus every source it cited, as clean JSON.
import requests
resp = requests.post(
"https://api.agentgeo.org/v1/fetches",
json={
"query": "best running shoes for flat feet",
"surfaces": ["chatgpt"], # chatgpt | perplexity | gemini | google_ai_overview | copilot
},
headers={"Authorization": "Bearer ag_live_your_key_here"},
timeout=200, # the API waits up to 180s on slow surfaces - stay above it
)
resp.raise_for_status()
run = resp.json()
for answer in run["answers"]:
print(answer["surfaceKey"], "→", answer["answerText"])
for src in answer["sources"]: # cited sources, in order
print(" ", src["position"], src["title"], src["url"])The response is a plain JSON object - no scraping artifacts, no HTML to clean up:
{
"id": "run_84c1f2ab91d3",
"query": "best running shoes",
"surfaces": ["chatgpt"],
"status": "completed",
"recordsDelivered": 1,
"creditsCharged": 1,
"answers": [
{
"surfaceKey": "chatgpt",
"answerText": "For most runners, top picks include ...",
"sources": [
{ "title": "Best Running Shoes", "url": "https://example.com/guide", "position": 1 }
]
}
]
}Because the shape is stable across all six engines, you can loop the same query over chatgpt, perplexity, google_ai_overview, google_ai_mode, copilot and gemini and diff the citation sets - that diff is the core of any GEO/AEO analysis you want to build.
What the Python API gives you
AgentGEO is a thin answer-access layer, not a closed dashboard. The API hands you the raw material; your Python code (or your users' AI agent) does the analysis.
- Six engines, one contract - ChatGPT, Perplexity, Google AI Overviews, Google AI Mode, Copilot and Gemini behind an identical request/response shape, so adding an engine is a one-word change.
- Citations and sources, structured - every inline citation with its position, plus a deduplicated source list, ready to store, rank or diff. No regexing links out of prose.
- Managed-scraper engine, maintained for you - answers come through supported access paths, so you never manage a headless browser, rotate proxies, or get IP-banned mid-run.
- Provider metadata -
surfaceKeyandproviderFieldson every response, so your data stays auditable as underlying models change. - MCP connection, too - the same data is exposed over MCP, so Claude Code, Cursor, Codex or any MCP client can pull answers and run the GEO analysis itself, no glue code required.
- Usage-based billing - pay for what you call, with run allowances by tier. No per-seat pricing.
Common problems with DIY answer-scraping in Python
The obvious first instinct is to script it yourself - spin up Playwright or Selenium, drive ChatGPT or Perplexity in a headless browser, and scrape the DOM. It demos in an afternoon and then quietly becomes a maintenance sink.
- Anti-bot walls. Headless Chrome gets fingerprinted and challenged. You end up buying residential proxies and solving CAPTCHAs to keep a scraper alive - work that has nothing to do with your product.
- Brittle HTML parsing. Perplexity and AI Overviews render answers and citations through client-side JS with class names that change without notice. Your BeautifulSoup selectors break on a silent frontend deploy, usually in production.
- No stable citation model. Extracting which sources an answer cited - in order, deduplicated - from rendered HTML is fiddly and engine-specific. You reinvent it per engine.
- Concurrency and rate pain. Running six engines across many queries means orchestrating browser pools, retries and backoff yourself.
- Legal and reliability gray area. Browser-scraping consumer UIs is fragile and easy to get blocked from. A managed collection layer someone else keeps healthy is steadier ground to build a product on.
| DIY scraping in Python | AgentGEO API | |
|---|---|---|
| Setup | Playwright/Selenium, proxies, CAPTCHA solving | pip install requests + a key |
| Parsing | Per-engine HTML selectors that break | Stable JSON, identical across engines |
| Citations | Hand-rolled extraction per engine | Structured answers[].sources[] |
| Bans | IP rotation, fingerprint games | Managed-scraper engine, maintained for you |
| Adding an engine | A new scraper from scratch | Add a key to the surfaces array |
AgentGEO is the answer-access layer; the dashboards are what you build on it. You own the raw data and embed it in your own product, instead of logging into someone else's.
Who builds on this
Primarily developers embedding AI-visibility tracking as a feature inside their own SaaS - a rank-tracker for the AI-answer era - and agencies white-labeling GEO/AEO reporting for clients. If you compared closed platforms like Profound, Peec AI or Otterly and wanted the raw data instead of a locked dashboard, this is the layer underneath them.
Ready to see the answers on your own brand? Get a free audit → · Read the 5-minute quickstart →
Get my free audit