ChatGPT AI Visibility API — FetchLayer Docs
Documentation menu
FetchLayer FetchLayer API

ChatGPT AI Visibility API v1

Ask ChatGPT a prompt and find out what it answered, which brands it recommended and which pages it cited, from https://api.fetchlayer.dev/chatgpt. Everything returned is what ChatGPT shows a visitor with no account — no OpenAI API key, just your FetchLayer key. FetchLayer is not affiliated with, endorsed by, or sponsored by OpenAI.

OpenAPI JSON

Available endpoints

Mentioned and cited are two different things

This is the distinction the whole API is built around, and most AI brand monitoring collapses it. A ChatGPT answer can name your brand in its prose while none of your pages are among the sources it links, and it can cite one of your pages without recommending you at all. They are separate outcomes with separate fixes: being named is a reputation and consensus problem, being cited is a retrievability problem.

So every route reports both. /mentions returns mentioned beside citedAsSource with the exact source positions, and /ai-rank keeps two rankings apart: rank among the options the answer recommends, and citationRank among the pages it cites. There is a third state worth watching too — retrieved, meaning ChatGPT read one of your pages while searching and then cited someone else.

Answers vary, so tracking uses several of them

The same prompt gives a different answer minutes apart. That is a property of the thing being measured, not a fault in the measurement, and it is why /ai-rank takes a runs count and reports an aggregate: mentionRate, averageRank, bestRank, worstRank, citationRate and averageCitationRank. Read the aggregate, not any single run, and keep the prompt, country and webSearch mode fixed when comparing over time.

A single answer is still useful for reading why a number moved — /ask returns the answer with its sources, its inline citations, the searches it ran and every page it read but did not cite.

One credit per answer generated

Billing follows answers, not routes. /ask and /mentions cost 1 credit each; /ai-rank costs its runs; /prompt-discovery costs one per prompt asked plus one more while it also asks for suggested prompts; /visibility-report costs prompts × runs. Matching, ranking and aggregation cost nothing extra, and an answer that could not be produced is never billed. Every response states it as pagesScraped, beside answersGenerated, which is the same number.

Comparing more brands is free: /mentions and /visibility-report read every target out of the same answers, so widening the brand list costs nothing while lengthening the prompt list does.

Sizing a request

A request's answers are generated alongside each other rather than one after the other, so asking for more answers costs credits but little extra time — measured against the live service, a five-run rank check and a full ten-answer visibility report both finish in well under a minute. The caps are the ones the service enforces: up to 5 runs on a rank check, up to 5 discovery prompts, and a report bounded by answers — prompts × runs must be at most 10, so 10 prompts at 1 run each is fine while 4 prompts at 3 runs each is a 400.

For tracking wider than one request allows, run several smaller requests on a schedule and store the results, rather than trying to fit everything into one call.

Every response carries a notes array. It is where a country that could not be served, runs that could not be completed, or details the answer did not show announce themselves.

What this API does not return

  • A way to turn web search off. A visitor without an account has no such setting, so webSearch is auto or on. Read usedWebSearch for what it actually did.
  • A model, temperature or system prompt to pick. These are answers as a visitor gets them, not API completions. model reports what the answer stated, and is null when it stated nothing — it is never guessed.
  • The searches behind every answer. Most answers list them; some do not, and then searchQueries and retrievedPages are null rather than empty, and notes says so.
  • Reproducibility. The same prompt gives different answers minutes apart. Use runs and the aggregate figures instead.
  • Traffic, spend or click data. Nothing here measures how many people saw an answer; it measures what ChatGPT answers.

Alongside the search engines

Where you rank in AI answers is a different question from where you rank in search results, and the two move independently. For the classic side, the SERP API covers Google, Bing and DuckDuckGo with rank checks at one credit a check.