For the complete documentation index, see llms.txt. This page is also available as Markdown.

ChatGPT

The ChatGPT Search API endpoint retrieves response data from the results page of a ChatGPT prompt. Results can be returned in raw HTML format or as a structured JSON format.

curl --request GET \
--url "https://api.scraperapi.com/structured/chatgpt/search/v1?api_key=API_KEY&\
query=QUERY&output_format=OUTPUT_FORMAT&sources=BOOLEAN"

Supported Parameters

Parameters
Details

API_KEY (required)

Your API Key.

QUERY (required)

The prompt to send to ChatGPT.

SOURCES

Determines whether sources are included in the response. Can be set to true or false (default). More details here.

OUTPUT_FORMAT

json returns parsed structured data (default). html returns raw HTML.

INCLUDE_HTML

Determines whether raw HTML is included in the response (this can increase the size of the response). Can be set to true or false (default).

JSON Response

{
  "query": "string",              // the submitted prompt, echoed back
  "url": "string|null",           // result/thread URL for the answer
  "model": "string|null",         // model that produced the answer (see notes)
  "answer": "string",             // the full answer, in Markdown
  "sources": [                    // citations / web results (may be empty)
    {
      "title": "string",
      "url": "string",
      "domain": "string",         // bare hostname, www. stripped
      "snippet": "string"         // may be empty when the engine gives none
    }
  ],
  "related_queries": ["string"]   // follow-up suggestions (may be empty)
}

Field Reference

Field
Type
Always present?
Notes

query

string

yes

Echoed prompt

url

string | null

yes

Result/thread URL

model

string | null

yes

Best-effort. null when not surfaced

answer

string (Markdown)

yes

The answer body

sources[]

array of object

yes (may be empty)

{ title, url, domain, snippet }

related_queries[]

array of string

yes (may be empty)

Follow-up suggestions

Specifics

sources

  • Empty when the answer was not web-grounded (common for plain ChatGPT if sources=true parameter is not used).

  • snippet is often empty for ChatGPT (its citation chips carry no excerpt).

  • domain is normalized to a bare hostname (www. stripped) across all engines.

Pricing

ChatGPT queries run on ScraperAPI's standard credit system.

Request Type

Credits Charged

sources=false or not included

25

sources=true

75

Last updated