Ahrefs APIahrefs.com ↗
Retrieve AI citation counts for any brand or domain across ChatGPT, Gemini, Perplexity, Copilot, Grok, and Google AI platforms via one endpoint.
What is the Ahrefs API?
The Ahrefs AI Visibility API exposes one endpoint — check_ai_visibility — that returns 7 response fields covering total AI citations, per-platform citation counts, monthly citation timelines, top cited pages, top cited domains, and top prompt topics for any brand name or website URL you supply. It covers ChatGPT, Gemini, Perplexity, Copilot, Grok, Google AI Overviews, and Google AI Mode in a single call.
curl -X GET 'https://api.parse.bot/scraper/e24e7b32-5a70-4f25-bc7a-ec43de9e817c/check_ai_visibility?brand=ahrefs.com' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace ahrefs-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Ahrefs AI Visibility Checker — check how a brand is cited across AI platforms."""
from parse_apis.ahrefs_com_api import Ahrefs, BrandFormatInvalid
client = Ahrefs()
# Look up AI visibility for a domain.
try:
vis = client.visibilities.get(brand="ahrefs.com")
except BrandFormatInvalid:
print("invalid brand input")
raise
print(f"{vis.brand}: {vis.total_ai_citations} total AI citations")
# Per-platform citation breakdown.
for cite in vis.citations_by_model:
print(f" {cite.model}: {cite.count} citations")
# Top domains cited alongside the brand.
for domain in vis.top_cited_domains:
print(f" {domain.domain}: {domain.mentions} mentions")
# Top pages cited.
for page in vis.top_cited_pages:
print(f" {page.url}: {page.mentions} mentions")
# Top prompt topics.
for topic in vis.top_topics:
print(f" {topic.topic}: {topic.ai_responses} AI responses")
# Monthly timeline per platform.
for mt in vis.monthly_citations_by_model:
latest = mt.timeline[0] if mt.timeline else None
if latest:
print(f" {mt.model} latest month {latest.date}: {latest.citations}")
print("exercised: visibilities.get")
Returns the AI visibility overview for one brand name or website URL: total AI citations, citation counts per AI platform, the top cited domains and pages that appear alongside the brand, the top topics (prompt themes) and a per-platform monthly citation timeline (roughly the last six months). One call performs one lookup; it takes several seconds because the site requires a human-verification step that is completed automatically. A brand the site has no data for returns a successful result with total_ai_citations 0 and empty arrays. The brand string is echoed back unchanged.
| Param | Type | Description |
|---|---|---|
| brandrequired | string | Brand name or website URL to look up, e.g. a domain like ahrefs.com or a full URL like https://www.nike.com/. Free text; passed to the site as typed. |
{
"type": "object",
"fields": {
"brand": "the brand/URL that was looked up, echoed as supplied",
"top_topics": "array of {topic, ai_responses}: prompt topics where the brand appears, with the number of AI responses (up to 5)",
"top_cited_pages": "array of {url, mentions}: pages most often cited (url is scheme-less), descending by mentions (up to 5)",
"top_cited_domains": "array of {domain, mentions}: domains most often cited in AI responses about this brand, descending by mentions (up to 5)",
"citations_by_model": "array of {model, count}: citation count per AI platform (model is the site's platform label, e.g. Chatgpt, Gemini, Copilot, GoogleAIOverviews)",
"total_ai_citations": "integer total number of AI citations found across all platforms",
"monthly_citations_by_model": "array of {model, timeline:[{date (YYYY-MM-DD, first of month), citations}]}: monthly citation counts per AI platform"
},
"sample": {
"data": {
"brand": "ahrefs.com",
"top_topics": [
{
"topic": "ahrefs",
"ai_responses": 32
},
{
"topic": "keyword research",
"ai_responses": 21
}
],
"top_cited_pages": [
{
"url": "ahrefs.com/blog/seo-pricing/",
"mentions": 100
},
{
"url": "ahrefs.com/writing-tools/ai-humanizer",
"mentions": 78
}
],
"top_cited_domains": [
{
"domain": "ahrefs.com",
"mentions": 1621
},
{
"domain": "www.semrush.com",
"mentions": 198
}
],
"citations_by_model": [
{
"count": 136,
"model": "Chatgpt"
},
{
"count": 117,
"model": "Gemini"
},
{
"count": 1397,
"model": "Copilot"
}
],
"total_ai_citations": 2766,
"monthly_citations_by_model": [
{
"model": "Chatgpt",
"timeline": [
{
"date": "2026-07-01",
"citations": 5
},
{
"date": "2026-08-01",
"citations": 42
}
]
}
]
},
"status": "success"
}
}About the Ahrefs API
What the endpoint returns
The check_ai_visibility endpoint accepts a single required parameter — brand — which can be a bare domain (e.g. ahrefs.com) or a full URL (e.g. https://www.nike.com/). The response includes total_ai_citations as an integer aggregate across all tracked platforms, and citations_by_model as an array of {model, count} objects that break that total down per platform (ChatGPT, Gemini, Copilot, Perplexity, Grok, Google AI Overviews, Google AI Mode).
Citation detail fields
top_cited_pages returns up to 5 scheme-less URLs ranked by mentions — these are the specific pages most frequently cited in AI responses about the queried brand. top_cited_domains returns up to 5 domains with mentions counts, showing which external sites appear alongside your brand in AI-generated answers. top_topics lists up to 5 prompt themes (with an ai_responses count per topic) where the brand surfaces in AI results.
Monthly trend data
monthly_citations_by_model provides a per-platform timeline array. Each entry contains a model label and a timeline array of {date, citations} objects where date is always the first of the month in YYYY-MM-DD format. This covers roughly the last 12 months of data, letting you observe citation trends across individual AI platforms over time.
The Ahrefs API is a managed, monitored endpoint for ahrefs.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when ahrefs.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official ahrefs.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Monitor how often a client's domain appears in AI-generated search results across 7 platforms using
total_ai_citations - Compare brand citation share across ChatGPT vs. Gemini vs. Perplexity using
citations_by_model - Identify which pages to optimize for AI citation by inspecting
top_cited_pagesand theirmentionscounts - Discover which competitor or partner domains appear alongside a brand in AI answers via
top_cited_domains - Track month-over-month AI visibility trends per platform using
monthly_citations_by_modeltimelines - Surface the prompt topics driving AI brand mentions by reviewing
top_topicsand theirai_responsescounts - Benchmark a domain's AI visibility before and after a content or PR campaign using
total_ai_citationssnapshots
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 200 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
| Team | $300/mo | 20,000 | 300 req/min |
| Company | $1,000/mo | 100,000 | 500 req/min |
Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Ahrefs offer an official developer API?+
What does `citations_by_model` actually distinguish, and are all 7 platforms always present?+
citations_by_model carries the platform's label (e.g. Chatgpt, Gemini, Copilot, Grok, Google AI Overviews, Google AI Mode) and an integer count. Platforms with zero citations for the queried brand may return a count of 0 rather than being omitted — but coverage depends on what Ahrefs has indexed for that brand at query time.How fresh is the data returned by `check_ai_visibility`?+
monthly_citations_by_model covers roughly the last 12 months at monthly granularity. There is no sub-monthly or real-time breakdown available through this endpoint. Data freshness depends on Ahrefs' indexing cadence for the AI Visibility Checker tool, which is not guaranteed to reflect citations from the current day or week.Can I retrieve AI visibility for a specific page path rather than an entire domain?+
brand parameter accepts a full URL (e.g. https://www.nike.com/running/), but the response aggregates citations at the brand or domain level — not filtered to that specific path. Granular page-level filtering is not currently exposed. The API does surface top_cited_pages to show which pages earn the most mentions, but you cannot query by a single page and get only that page's citation metrics. You can fork this API on Parse and revise it to add a page-filtered endpoint if your use case requires it.