AI Prompt Discovery API — ChatGPT Queries
Documentation menu
FetchLayer FetchLayer API

Find the prompts and searches that lead to a topic

Which prompts and searches lead to a topic or a brand inside ChatGPT — the input to the rest of the tracking: find the prompts worth watching, then watch them with ai-rank. From a seed it asks a few prompts and returns promptsAsked, then two lists that are different kinds of evidence and are labelled as such. observedSearchQueries (source "observed_search_query") are the web searches ChatGPT actually ran while answering, each with its text, how many answers produced it (occurrences) and the fromPrompts it came from — these are the queries your pages have to rank for to be readable by it, and these prompts are always asked with web search on. suggestedPrompts (source "generated_prompt") are prompts ChatGPT wrote when asked which questions people type about the seed: suggestions, not observations. Both lists hold objects whose text field is the wording. citedDomains is the sites that came back across those answers. The field names are exact: the seed is seed and the count is maxPrompts — brand, domain, topic or promptCount are a 400 naming the field. maxPrompts is 1–5. Timing: every answer is a real ChatGPT session, and a request’s answers are generated alongside each other rather than one after the other — asking for more answers costs credits, not proportionally more time. Measured against the live service, the largest request this route accepts finishes inside a minute. 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. Billing: 1 credit per prompt asked, plus 1 more while includeSuggestedPrompts is on.

POST /prompt-discovery Prompt research
https://api.fetchlayer.dev/chatgpt/prompt-discovery
OpenAPI JSON

Headers

Authorization string required

Bearer token — your FetchLayer API key.

Parameters

seed string required

A topic ("reddit api alternatives") or a brand ("FetchLayer"), 1–200 characters.

seedType string optional

Whether the seed is a topic or a brand. (default: topic)

prompts array optional

Your own prompts to ask instead of the ones built from the seed, 1–5.

maxPrompts number optional

How many prompts built from the seed to ask, 1–5. Each is billed. (default: 3)

includeSuggestedPrompts boolean optional

Also ask ChatGPT which prompts people use to research the seed. Costs one more answer. (default: true)

provider string optional

The assistant to ask. chatgpt is the only one available today; the field exists so the same request serves further assistants as they are added. (default: chatgpt)

country string optional

Two-letter country the answer should come from, such as US, GB or DE. Answers differ by country. When that country cannot be served, the answer comes from the default one and notes says so. (default: us)

language string optional

Language of ChatGPT’s own interface, such as en, de or pt-BR. The answer itself follows the language of your prompt. (default: en)

webSearch string optional

auto lets ChatGPT decide whether to search the web; on asks it to search before answering, and answer.usedWebSearch reports what it did. There is no "off": an anonymous visitor has no such setting. (default: auto)

format string optional

json or markdown. (default: json)

Response Fields

prompt-discovery

Find the prompts and searches that lead to a topic

resultType string

ask, mentions, ai-rank, prompt-discovery or visibility-report.

provider string

The assistant that was asked. Always "chatgpt" today.

requestedUrl string

The assistant page the answers correspond to.

transport string

The upstream source. Always "chatgpt".

notes string[]

Caveats you can act on — a country that could not be served, runs that could not be completed, details the answer did not show. Empty when there are none. Read it on every call.

answersGenerated number

Answers ChatGPT produced for this request.

pagesScraped number

Billable units, which is the same number: one credit per answer. An answer that could not be produced is never billed.

scrapedAt string

ISO 8601 timestamp of when the data was collected.

seed string

The seed that was given.

promptsAsked string[]

The prompts that were actually asked, as strings.

observedSearchQueries object[]

Searches ChatGPT ran while answering. When an answer does not show its searches, notes says the list may be incomplete.

observedSearchQueries[].text string

The search as ChatGPT ran it. This is the display field: the entries are objects, not strings.

observedSearchQueries[].source string

Always "observed_search_query" — it was observed, not suggested.

observedSearchQueries[].fromPrompts string[]

The prompts whose answers produced it.

observedSearchQueries[].occurrences number

How many answers produced it.

suggestedPrompts object[]

Prompts ChatGPT wrote when asked which questions people type about the seed.

suggestedPrompts[].text string

The suggested prompt. Again the display field.

suggestedPrompts[].source string

Always "generated_prompt" — a suggestion, not an observation.

suggestedPrompts[].occurrences number

0: nothing was observed for it.

citedDomains object[]

The domains cited across those answers, with how often each was cited.

Request

curl -X POST "https://api.fetchlayer.dev/chatgpt/prompt-discovery" \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"seed":"reddit api alternatives","maxPrompts":2}'

Response

{
  "resultType": "prompt-discovery",
  "provider": "chatgpt",
  "transport": "chatgpt",
  "notes": [],
  "answersGenerated": 3,
  "pagesScraped": 3,
  "scrapedAt": "2026-09-16T01:46:11.000Z",
  "seed": "reddit api alternatives",
  "promptsAsked": [
    "reddit api alternatives",
    "what are the best reddit api alternatives"
  ],
  "observedSearchQueries": [
    {
      "text": "Reddit API alternatives 2026 Reddit JSON API alternatives Arctic Shift PullPush Teddit Libreddit",
      "source": "observed_search_query",
      "fromPrompts": [
        "reddit api alternatives"
      ],
      "occurrences": 1
    }
  ],
  "suggestedPrompts": [
    {
      "text": "What are the best alternatives to the Reddit API?",
      "source": "generated_prompt",
      "fromPrompts": [],
      "occurrences": 0
    }
  ]
}