Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.scrapellm.com/llms.txt

Use this file to discover all available pages before exploring further.

The ChatGPT endpoint sends any prompt to the ChatGPT web interface and returns the response as structured JSON. Unlike the direct OpenAI API, ScrapeLLM captures exactly what a real user sees — including all cited web sources and the internal search queries ChatGPT issued behind the scenes.
Web search always enabledEvery request runs in ChatGPT’s web search mode. All responses include live citations from the web.

Overview

Use this endpoint to monitor brand mentions, track AI-generated answers, and see which sources ChatGPT cites for any topic. The search_queries field reveals ChatGPT’s internal query fan-out — the sub-questions it searched to build its answer — making it a powerful tool for keyword research and AI SEO.

Unique features

  • Sources: Web citations with URL and link text for every source referenced in the response
  • Search queries: The internal fan-out queries ChatGPT used to gather information before answering
  • Markdown response: Full response formatted as markdown via result_markdown

Request parameters

prompt
string
required
The prompt to send to ChatGPT. Maximum 4,000 characters.
country
string
default:"US"
ISO 3166-1 alpha-2 country code for localised responses.
bypass_cache
boolean
default:"false"
Skip the response cache and always fetch a fresh result.
markdown_json
boolean
default:"false"
Include the full markdown token tree in the response.
timeout
float
default:"300"
Maximum seconds to wait for ChatGPT to respond (10–600).
3 credits per request

Example request

curl "https://api.scrapellm.com/scrapers/chatgpt" \
  -H "X-API-Key: YOUR_API_KEY" \
  -G \
  --data-urlencode "prompt=What brands do marketers recommend for email automation?" \
  --data-urlencode "country=US"

Response schema

Includes common response fields plus:
FieldTypeDescription
resultstringPlain-text response from ChatGPT
result_markdownstringMarkdown-formatted response
linksarrayCited sources — each has url and text
search_queriesarrayInternal fan-out queries ChatGPT used to build the answer
llm_modelstringChatGPT model used (e.g. gpt-4o)
credits_usedintegerCredits consumed — always 3 for ChatGPT
elapsed_msfloatEnd-to-end request duration in milliseconds
cachedbooleantrue if served from cache

Common questions

Can I retrieve the search queries ChatGPT used?

Yes. The search_queries field is included in every response and contains the internal fan-out queries ChatGPT issued to gather information before composing its answer.

Why do search queries look like long natural-language strings?

ChatGPT’s search model decides the shape of each query and often emits a single long natural-language string rather than comma-separated keywords. The length and structure vary between runs, even for the same prompt. ScrapeLLM returns them exactly as ChatGPT generates them.

Does this hit the ChatGPT API or the web interface?

The web interface. ScrapeLLM captures what a real user sees in the ChatGPT chat UI — not the direct OpenAI API response. This means you get live web search results, citations, and UI-specific features unavailable through the raw API.

How do I calculate AI visibility for my brand?

Run the same set of industry prompts repeatedly and check whether your brand appears in links. Divide the number of responses that mention your brand by the total runs to get a reliable AI visibility %.