YepAPI
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/v1/seo/ai/chatgpt
$0.05/call

Usage

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

ParameterTypeRequiredDescriptionDefault
keywordstringYesThe question or query to ask ChatGPT—
locationstringNoTwo-letter country code, e.g. "us", "gb" (or "uk"), "de". An unknown code falls back to "us"."us"
languagestringNoAnswer language, e.g. "de". Left at "en", the country's main language is used."en"
freshbooleanNoSkip 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

FieldTypeDescription
okbooleanWhether the request succeeded
data.keywordstringThe query that was sent to ChatGPT
data.modelstringAlways "chatgpt"
data.responsestringChatGPT's full answer, in Markdown (headings, lists, links and images)
data.referencesarrayPages the answer cites. Can be empty: ChatGPT does not always search the web.
data.references[].titlestringTitle of the cited page
data.references[].urlstringURL of the cited page
data.references[].domainstringDomain of the cited page
data.references[].snippetstringText 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

StatusCodeWhen
503UPSTREAM_ERRORChatGPT gave no answer or could not be reached. Retry.

Failed calls are not charged.

Under the Hood

Scrapes ChatGPT for AI visibility monitoring.

On this page