AI Optimization
ChatGPT Scraper
See what ChatGPT says about any topic — scrape AI responses with source references.
Pricing, live playground and use cases: ChatGPT LLM Scraper API on YepAPI
POST
$0.05/call/v1/seo/ai/chatgptUsage
const res = await fetch('https://api.yepapi.com/v1/seo/ai/chatgpt', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ keyword: 'best website hosting platforms', location: 'us' }),
});
const { data } = await res.json();
console.log(data.response);curl -X POST https://api.yepapi.com/v1/seo/ai/chatgpt \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"keyword": "best website hosting platforms", "location": "us"}'Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
keyword | string | Yes | The question or query to ask ChatGPT | — |
location | string | No | Two-letter country code, e.g. "us", "gb" (or "uk"), "de". An unknown code falls back to "us". | "us" |
language | string | No | Answer language, e.g. "de". Left at "en", the country's main language is used. | "en" |
fresh | boolean | No | Skip the cached answer and ask ChatGPT again (see Caching) | false |
Response
{
"ok": true,
"data": {
"keyword": "best website hosting platforms",
"model": "chatgpt",
"response": "Here are some of the most popular website hosting platforms, grouped by what they suit best:\n\n## Best for beginners\n\n- **Example Host** — ...",
"references": [
{
"title": "Best Web Hosting Services",
"url": "https://www.example.com/best-web-hosting",
"domain": "www.example.com",
"snippet": ""
}
]
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.keyword | string | The query that was sent to ChatGPT |
data.model | string | Always "chatgpt" |
data.response | string | ChatGPT's full answer, in Markdown (headings, lists, links and images) |
data.references | array | Pages the answer cites. Can be empty: ChatGPT does not always search the web. |
data.references[].title | string | Title of the cited page |
data.references[].url | string | URL of the cited page |
data.references[].domain | string | Domain of the cited page |
data.references[].snippet | string | Text quoted from the page; often empty |
Caching
Responses are cached for 1 hour per keyword, location and language: the same request within the hour returns the same answer, instantly. Send "fresh": true to ask again; the new answer replaces the cached one.
Errors
| Status | Code | When |
|---|---|---|
503 | UPSTREAM_ERROR | ChatGPT gave no answer or could not be reached. Retry. |
Failed calls are not charged.
Under the Hood
Scrapes ChatGPT for AI visibility monitoring.