API Reference v0.1

Build with ScrapeLLM

One API to scrape ChatGPT, Perplexity, Gemini, and more. Get structured JSON with citations, sources, and markdown — at any scale.

GET /scrapers/chatgpt
1 Quickstart

Get your first response in under 2 minutes.

1
Get an API key Sign up and copy your key from the dashboard.
2
Send a GET request All endpoints are GET https://api.scrapellm.com/scrapers/{scraper}. Pass your key as ?api_key= or the X-API-Key header.
3
Parse the response Every response includes result (plain text) and result_markdown. Source-citing scrapers also return sources or citations.
# Responses can take up to 300 s — set --max-time accordingly
curl --max-time 300 \
  "https://api.scrapellm.com/scrapers/chatgpt?api_key=YOUR_KEY&prompt=Best+coffee+in+Tokyo%3F&country=JP"
2 Authentication

Every request must include your API key via the api_key query parameter or the X-API-Key request header.

🔑
Two accepted methods — pick one Query param ?api_key=your_key is simplest for testing. Use the X-API-Key header in production to keep credentials out of server logs. Requests without a valid key return 401 Unauthorized.
# Option A — query parameter
GET /scrapers/chatgpt?api_key=your_api_key&prompt=…

# Option B — request header (preferred in production)
GET /scrapers/chatgpt?prompt=…
X-API-Key: your_api_key
3 ChatGPT

Scrape ChatGPT's real user interface and receive the full reply with inline links and optional markdown token tree.

GET https://api.scrapellm.com/scrapers/chatgpt 3 credits
ChatGPT streams token-by-token — requests typically take 5–60 s, up to 300 s. Set your HTTP client timeout to at least 300 s.
import requests

r = requests.get(
  "https://api.scrapellm.com/scrapers/chatgpt",
  params={"api_key": "your_key", "prompt": "Best coffee in Tokyo?", "country": "JP"},
  timeout=300,
)
print(r.json()["result"])
const p = new URLSearchParams({api_key:"your_key", prompt:"Best coffee in Tokyo?", country:"JP"});
const r = await fetch(`https://api.scrapellm.com/scrapers/chatgpt?${p}`, {signal:AbortSignal.timeout(300_000)});
const data = await r.json();
console.log(data.result);
curl --max-time 300 \
  "https://api.scrapellm.com/scrapers/chatgpt?api_key=your_key&prompt=Best+coffee+in+Tokyo%3F&country=JP"
Example Response
{
  "scraper":         "chatgpt",
  "status":          "done",
  "job_id":          "job_abc123",
  "result":          "Tokyo's best coffee…",
  "result_markdown": "**Tokyo's** best coffee…",
  "links": [{"text":"Fuglen Tokyo","url":"https://fuglen.no/…"}],
  "llm_model":       "gpt-4o",
  "credits_used":    3,
  "elapsed_ms":      8421.5,
  "cached":          false
}

ChatGPT-specific parameters

ParameterTypeRequiredDescription
markdown_json boolean Optional
When true, includes result_markdown_json in the response — the full markdown-it token tree of ChatGPT's reply.
Default: false
{ // … common fields (see below) … "links"array// [{text, url}] hyperlinks extracted from the reply "url"string | null// https://chatgpt.com/c/… conversation URL "llm_model"string | null// e.g. "gpt-4o" "result_markdown_json"array | null// markdown-it token tree (only if markdown_json=true) }
4 Perplexity

Scrape Perplexity AI and receive the answer with numbered web citations and suggested follow-up questions.

GET https://api.scrapellm.com/scrapers/perplexity 3 credits
import requests

r = requests.get(
  "https://api.scrapellm.com/scrapers/perplexity",
  params={
    "api_key":    "your_key",
    "prompt":     "Best treatments for insomnia?",
    "country":    "US",
    "web_search": True,
  },
  timeout=300,
)
print(r.json()["sources"])
Example Response
{
  "scraper":  "perplexity",
  "result":   "CBT-I is considered the gold standard…",
  "sources": [{
    "title":   "Insomnia - Mayo Clinic",
    "url":     "https://mayoclinic.org/…",
    "snippet": "CBT-I involves…"
  }],
  "related_questions": ["What causes insomnia?"],
  "credits_used": 3
}

Perplexity-specific parameters

ParameterTypeRequiredDescription
web_search boolean Optional
Enable live web search before answering. Disable for faster responses that rely on trained knowledge only.
Default: true
{ // … common fields … "sources"array// [{title, snippet, url}] — index 0 = citation [1] "related_questions"string[]// follow-up questions suggested by Perplexity "url"string | null// https://www.perplexity.ai }
5 Grok

Scrape Grok (xAI) and receive the answer alongside web sources and X (Twitter) posts — Grok's unique dual-source response format.

GET https://api.scrapellm.com/scrapers/grok 3 credits

⚠ Country codes JP and TW are not supported.

import requests

r = requests.get(
  "https://api.scrapellm.com/scrapers/grok",
  params={
    "api_key": "your_key",
    "prompt":  "Latest news on AI?",
    "country": "US",
    "mode":    "MODEL_MODE_AUTO",
  },
  timeout=300,
)
data = r.json()
print(data["web_sources"], data["x_results"])
Example Response
{
  "scraper":     "grok",
  "mode":        "MODEL_MODE_AUTO",
  "result":      "OpenAI announced…",
  "web_sources": [{"title":"OpenAI Blog","url":"…"}],
  "x_results": [{
    "user_name": "sama",
    "text":      "Excited about GPT-5…",
    "view_count": 1200000
  }],
  "llm_model": "grok-3",
  "credits_used": 3
}

Grok-specific parameters

ParameterTypeRequiredDescription
mode string Optional
Grok reasoning mode. MODEL_MODE_FAST — quick (Grok mini). MODEL_MODE_EXPERT — deep reasoning (full Grok). MODEL_MODE_AUTO — Grok chooses.
Default: "MODEL_MODE_AUTO"
{ // … common fields … "mode"string// Grok mode used "web_sources"array// [{title, preview, url}] "x_results"array// [{post_id, user_name, name, text, view_count, create_time}] "related_questions"string[] "conversation"object | null// {conversation_id, title, temporary} "llm_model"string | null// e.g. "grok-3" }
6 Gemini

Scrape Google Gemini and receive the full markdown answer with rich citation metadata including snippets, highlights, and favicons.

GET https://api.scrapellm.com/scrapers/gemini 3 credits

⚠ Country codes JP and TW are not supported.

import requests

r = requests.get(
  "https://api.scrapellm.com/scrapers/gemini",
  params={
    "api_key": "your_key",
    "prompt":  "Explain quantum entanglement.",
    "country": "US",
  },
  timeout=300,
)
print(r.json()["citations"])
Example Response
{
  "scraper":    "gemini",
  "result":     "Quantum entanglement…",
  "citations": [{
    "title":        "Quantum Entanglement - Wikipedia",
    "url":          "https://en.wikipedia.org/…",
    "snippet":      "When particles become entangled…",
    "website_name": "Wikipedia",
    "highlights":   ["non-locality"]
  }],
  "llm_model":   "gemini-2.0-flash",
  "credits_used": 3
}

No Gemini-specific parameters beyond the common set.

{ // … common fields … "citations"array// [{title, url, snippet, highlights[], website_name, favicon}] "llm_model"string | null// e.g. "gemini-2.0-flash" }
7 Copilot

Scrape Microsoft Copilot in one of five modes — from quick chat to deep study guides — and receive citations and all outbound links.

GET https://api.scrapellm.com/scrapers/copilot 3 credits

⚠ Country codes JP and TW are not supported.

import requests

r = requests.get(
  "https://api.scrapellm.com/scrapers/copilot",
  params={
    "api_key": "your_key",
    "prompt":  "Best coffee shops in London?",
    "country": "GB",
    "mode":    "search",
  },
  timeout=300,
)
print(r.json()["citations"])
Example Response
{
  "scraper":    "copilot",
  "mode":       "search",
  "result":     "London's best coffee…",
  "citations": [{
    "title": "Time Out London",
    "url":   "https://timeout.com/…"
  }],
  "links":       ["https://timeout.com/…"],
  "credits_used": 3
}

Copilot-specific parameters

ParameterTypeRequiredDescription
mode string Optional
Copilot response mode. search — web-grounded. smart — balanced. chat — quick reply. reasoning — deeper (slower). study — structured guide.
Default: "search"
{ // … common fields … "mode"string// mode used: search | smart | chat | reasoning | study "citations"array// [{title, url}] "links"string[]// all outbound URLs returned by Copilot }
8 Google AI Mode

Scrape Google AI Mode and receive the AI answer alongside rich citations and the supporting web search results panel.

GET https://api.scrapellm.com/scrapers/google_ai_mode 3 credits

⚠ Country codes JP and TW are not supported.

import requests

r = requests.get(
  "https://api.scrapellm.com/scrapers/google_ai_mode",
  params={
    "api_key": "your_key",
    "prompt":  "Best running shoes 2026",
    "country": "US",
  },
  timeout=300,
)
data = r.json()
print(data["citations"], data["search_results"])
Example Response
{
  "scraper": "google_ai_mode",
  "result":  "The best running shoes of 2026…",
  "citations": [{
    "title":        "Runner's World",
    "url":          "https://runnersworld.com/…",
    "website_name": "Runner's World"
  }],
  "search_results": [{
    "title": "Best Shoes 2026",
    "url":   "https://…"
  }],
  "credits_used": 3
}

No Google AI Mode-specific parameters beyond the common set.

{ // … common fields … "citations"array// [{title, url, snippet, website_name, thumbnail, favicon}] "search_results"array// [{title, url, snippet, website_name, thumbnail}] "raw_url"string | null// original Google search URL that was scraped }
9 Common parameters

These query parameters are accepted by every scraper endpoint.

ParameterTypeRequiredDescription
api_key string Required*
Your ScrapeLLM API key. Alternatively supply via the X-API-Key request header.
prompt string Required
The prompt to submit. 1–4,000 characters, must be non-blank.
country string Optional
ISO 3166-1 alpha-2 country code. Routes the request through infrastructure in that region. JP and TW are not supported on Grok, Gemini, Copilot, or Google AI Mode.
Default: "US"
bypass_cache boolean Optional
Set to true to skip the response cache and always fetch a fresh result. Credits are still charged.
Default: false
timeout number Optional
Maximum seconds to wait for the scraper to respond. Set your HTTP client timeout to match or exceed this value.
Default: 300 — Range: 10–600
10 Common response fields

Every 200 response includes these fields regardless of which scraper was used.

{ "scraper"string// e.g. "chatgpt" | "perplexity" | "grok" | "gemini" | "copilot" | "google_ai_mode" "status"string// always "done" on HTTP 200 "job_id"string// opaque job identifier assigned by the gateway "prompt"string// echo of the submitted prompt "country"string// ISO alpha-2 code that was targeted "result"string | null// plain-text reply, markdown symbols stripped "result_markdown"string | null// full reply as a Markdown string "url"string | null// URL of the page that was scraped "created_at"string | null// ISO 8601 UTC timestamp "credits_used"integer// credits charged for this request "elapsed_ms"number | null// wall-clock ms from request to response "cached"boolean// true if served from cache "cached_at"string | null// ISO 8601 UTC — only present when cached=true }
11 Error codes

All errors return a JSON body with a detail field describing the problem.

200
OK Scrape completed successfully. The full response object is returned.
401
Unauthorized Missing or invalid API key. Pass via ?api_key= or the X-API-Key header.
408
Request Timeout The AI model did not respond within the timeout you specified. Retry with a higher timeout, or use a shorter prompt.
422
Unprocessable Entity Request validation failed. Check the detail field for which parameter is invalid.
429
Too Many Requests Credit limit reached or rate limit hit. Upgrade your plan or wait for your billing cycle to reset.
500
Internal Server Error The scraper returned an empty result or an unexpected error occurred. Retry after a short delay.
502
Bad Gateway The upstream scraper machine returned a non-2xx response. Retry after a short delay.
503
Service Unavailable Scraper pool is warming up. Retry in a few seconds.
504
Gateway Timeout The scraper machine did not respond in time. Retry or increase your timeout parameter.
12 Query builder

Use the interactive builder to configure parameters, generate code in Python, JavaScript, or cURL, and test live requests against the API.

Open Query Builder →
Build requests, generate code, and test live — all in one screen.
Python JavaScript cURL Live requests