Scrapers
ChatGPT
Monitor what ChatGPT says about any brand, product, or topic. Get cited sources, internal search queries, and clean structured JSON from the real ChatGPT web interface.
GET
/
scrapers
/
chatgpt
cURL
# Streaming can take up to 300s - --max-time matches the server timeout
curl --max-time 300 \
-G "https://api.scrapellm.com/scrapers/chatgpt" \
--data-urlencode "api_key=YOUR_API_KEY" \
--data-urlencode "prompt=What brands do marketers recommend for email automation?" \
--data-urlencode "country=US"import requests
response = requests.get(
"https://api.scrapellm.com/scrapers/chatgpt",
params={
"api_key": "YOUR_API_KEY",
"prompt": "What brands do marketers recommend for email automation?",
"country": "US",
}
)
print(response.json())
const params = new URLSearchParams({
api_key: "YOUR_API_KEY",
prompt: "What brands do marketers recommend for email automation?",
country: "US",
});
const response = await fetch(
`https://api.scrapellm.com/scrapers/chatgpt?${params}`
);
const data = await response.json();
console.log(data);
const params = new URLSearchParams({
api_key: "YOUR_API_KEY",
prompt: "What brands do marketers recommend for email automation?",
country: "US",
});
const response = await fetch(
`https://api.scrapellm.com/scrapers/chatgpt?${params}`
);
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrapellm.com/scrapers/chatgpt",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.scrapellm.com/scrapers/chatgpt"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.scrapellm.com/scrapers/chatgpt")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrapellm.com/scrapers/chatgpt")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"scraper": "chatgpt",
"status": "done",
"job_id": "job_abc123",
"prompt": "What brands do marketers recommend for email automation?",
"country": "US",
"result": "Marketers commonly recommend Mailchimp, HubSpot, and Klaviyo...",
"result_markdown": "Marketers commonly recommend **Mailchimp**, **HubSpot**, and **Klaviyo**...",
"links": [
{
"url": "https://mailchimp.com",
"text": "Mailchimp"
},
{
"url": "https://hubspot.com",
"text": "HubSpot"
}
],
"search_queries": [
"best email automation tools marketers",
"top email marketing platforms 2025"
],
"llm_model": "gpt-4o",
"credits_used": 3,
"elapsed_ms": 8243.5,
"cached": false,
"markdown_url": "https://scrapellm.com/md/job_abc123.md"
}{
"detail": "Missing API key. Pass your key in the X-API-Key header or as ?api_key= in the URL."
}{
"detail": "Invalid API key."
}{
"detail": "Credit limit reached. Upgrade your plan or wait for your billing cycle to reset."
}{
"detail": "Invalid API key."
}{
"detail": "Invalid API key."
}{
"detail": "Invalid API key."
}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. Thesearch_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
Example request
# Streaming can take up to 300s - --max-time matches the server timeout
curl --max-time 300 \
-G "https://api.scrapellm.com/scrapers/chatgpt" \
--data-urlencode "api_key=YOUR_API_KEY" \
--data-urlencode "prompt=What brands do marketers recommend for email automation?" \
--data-urlencode "country=US"
import requests
response = requests.get(
"https://api.scrapellm.com/scrapers/chatgpt",
headers={"X-API-Key": "YOUR_API_KEY"},
params={
"prompt": "What brands do marketers recommend for email automation?",
"country": "US",
}
)
print(response.json())
const params = new URLSearchParams({
prompt: "What brands do marketers recommend for email automation?",
country: "US",
});
const response = await fetch(
`https://api.scrapellm.com/scrapers/chatgpt?${params}`,
{ headers: { "X-API-Key": "YOUR_API_KEY" } }
);
const data = await response.json();
console.log(data);
const params = new URLSearchParams({
prompt: "What brands do marketers recommend for email automation?",
country: "US",
});
const response = await fetch(
`https://api.scrapellm.com/scrapers/chatgpt?${params}`,
{ headers: { "X-API-Key": "YOUR_API_KEY" } }
);
interface ChatGPTResponse {
scraper: string;
status: string;
job_id: string;
prompt: string;
country: string;
result: string;
result_markdown: string;
links: Array<{ url: string; text: string }>;
search_queries: string[];
llm_model: string;
credits_used: number;
elapsed_ms: number;
cached: boolean;
}
const data: ChatGPTResponse = await response.json();
console.log(data);
Example response
{
"scraper": "chatgpt",
"status": "done",
"job_id": "job_abc123",
"prompt": "What brands do marketers recommend for email automation?",
"country": "US",
"result": "Marketers commonly recommend Mailchimp, HubSpot, and Klaviyo for email automation. Mailchimp is praised for its ease of use and generous free tier, while HubSpot offers deep CRM integration. Klaviyo is a favourite among e-commerce teams for its behavioural segmentation.",
"result_markdown": "Marketers commonly recommend **Mailchimp**, **HubSpot**, and **Klaviyo** for email automation...",
"links": [
{
"url": "https://mailchimp.com/resources/email-marketing-benchmarks/",
"text": "Mailchimp"
},
{
"url": "https://blog.hubspot.com/marketing/email-marketing-tools",
"text": "HubSpot"
},
{
"url": "https://www.klaviyo.com/blog/email-automation",
"text": "Klaviyo"
}
],
"search_queries": [
"best email automation tools recommended by marketers 2026",
"top email marketing platforms for businesses",
"Mailchimp vs HubSpot vs Klaviyo comparison"
],
"llm_model": "gpt-4o",
"credits_used": 3,
"elapsed_ms": 8243.5,
"cached": false
}
Response schema
Includes common response fields plus:| Field | Type | Description |
|---|---|---|
result | string | Plain-text response from ChatGPT |
result_markdown | string | Markdown-formatted response |
links | array | Cited sources - each has url and text |
links[].url | string | Full URL of the cited source |
links[].text | string | Anchor text ChatGPT used for the citation |
search_queries | array | Internal fan-out queries ChatGPT used to build the answer |
llm_model | string | ChatGPT model used (e.g. gpt-4o) |
credits_used | integer | Credits consumed - always 3 for ChatGPT |
elapsed_ms | float | End-to-end request duration in milliseconds |
cached | boolean | true if served from cache |
Using search queries
Passsearch_queries results directly into your keyword research or content planning. Each string is a verbatim sub-question ChatGPT searched to build its answer.
# Streaming can take up to 300s - --max-time matches the server timeout
curl --max-time 300 \
-G "https://api.scrapellm.com/scrapers/chatgpt" \
--data-urlencode "api_key=YOUR_API_KEY" \
--data-urlencode "prompt=What are the best project management tools for remote teams?" \
--data-urlencode "country=US"
import requests
response = requests.get(
"https://api.scrapellm.com/scrapers/chatgpt",
headers={"X-API-Key": "YOUR_API_KEY"},
params={
"prompt": "What are the best project management tools for remote teams?",
"country": "US",
}
)
data = response.json()
# Print each fan-out query ChatGPT used internally
for query in data["search_queries"]:
print(query)
const params = new URLSearchParams({
prompt: "What are the best project management tools for remote teams?",
country: "US",
});
const response = await fetch(
`https://api.scrapellm.com/scrapers/chatgpt?${params}`,
{ headers: { "X-API-Key": "YOUR_API_KEY" } }
);
const data = await response.json();
// Log each fan-out query ChatGPT used internally
data.search_queries.forEach((query) => console.log(query));
const params = new URLSearchParams({
prompt: "What are the best project management tools for remote teams?",
country: "US",
});
const response = await fetch(
`https://api.scrapellm.com/scrapers/chatgpt?${params}`,
{ headers: { "X-API-Key": "YOUR_API_KEY" } }
);
const data = await response.json();
// Log each fan-out query ChatGPT used internally
(data.search_queries as string[]).forEach((query: string) =>
console.log(query)
);
search_queries array for this prompt might look like:
[
"best project management tools for remote teams 2026",
"Asana vs Monday.com vs Notion for distributed teams",
"project management software features remote work collaboration"
]
Common questions
Can I retrieve the search queries ChatGPT used?
Yes. Thesearch_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 inlinks or result. Divide the number of responses that mention your brand by the total runs to get a reliable AI visibility %.
Why does bypass_cache matter for brand monitoring?
Without bypass_cache: true, consecutive identical prompts may return a cached result. For accurate visibility tracking across multiple runs, set bypass_cache: true so each request fetches a fresh response from ChatGPT.Authorizations
ApiKeyHeaderApiKeyQuery
Query Parameters
Response
Scrape completed successfully.
cURL
# Streaming can take up to 300s - --max-time matches the server timeout
curl --max-time 300 \
-G "https://api.scrapellm.com/scrapers/chatgpt" \
--data-urlencode "api_key=YOUR_API_KEY" \
--data-urlencode "prompt=What brands do marketers recommend for email automation?" \
--data-urlencode "country=US"import requests
response = requests.get(
"https://api.scrapellm.com/scrapers/chatgpt",
params={
"api_key": "YOUR_API_KEY",
"prompt": "What brands do marketers recommend for email automation?",
"country": "US",
}
)
print(response.json())
const params = new URLSearchParams({
api_key: "YOUR_API_KEY",
prompt: "What brands do marketers recommend for email automation?",
country: "US",
});
const response = await fetch(
`https://api.scrapellm.com/scrapers/chatgpt?${params}`
);
const data = await response.json();
console.log(data);
const params = new URLSearchParams({
api_key: "YOUR_API_KEY",
prompt: "What brands do marketers recommend for email automation?",
country: "US",
});
const response = await fetch(
`https://api.scrapellm.com/scrapers/chatgpt?${params}`
);
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrapellm.com/scrapers/chatgpt",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.scrapellm.com/scrapers/chatgpt"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.scrapellm.com/scrapers/chatgpt")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrapellm.com/scrapers/chatgpt")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"scraper": "chatgpt",
"status": "done",
"job_id": "job_abc123",
"prompt": "What brands do marketers recommend for email automation?",
"country": "US",
"result": "Marketers commonly recommend Mailchimp, HubSpot, and Klaviyo...",
"result_markdown": "Marketers commonly recommend **Mailchimp**, **HubSpot**, and **Klaviyo**...",
"links": [
{
"url": "https://mailchimp.com",
"text": "Mailchimp"
},
{
"url": "https://hubspot.com",
"text": "HubSpot"
}
],
"search_queries": [
"best email automation tools marketers",
"top email marketing platforms 2025"
],
"llm_model": "gpt-4o",
"credits_used": 3,
"elapsed_ms": 8243.5,
"cached": false,
"markdown_url": "https://scrapellm.com/md/job_abc123.md"
}{
"detail": "Missing API key. Pass your key in the X-API-Key header or as ?api_key= in the URL."
}{
"detail": "Invalid API key."
}{
"detail": "Credit limit reached. Upgrade your plan or wait for your billing cycle to reset."
}{
"detail": "Invalid API key."
}{
"detail": "Invalid API key."
}{
"detail": "Invalid API key."
}