Documentation has been updated: see help center and changelog in one place.

ChatGPT

Learn how you can start scraping ChatGPT.

The chatgpt source is designed to submit prompts and retrieve ChatGPT conversational responses. It returns both the complete ChatGPT response text along with its structured metadata.

Request samples

The following code examples demonstrate how to submit a prompt and retrieve a ChatGPT response with parsed results.

curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
        "source": "chatgpt",
        "prompt": "best supplements for better sleep",
        "parse": true,
        "search": true,
        "geo_location": "United States"
    }'

Our examples use synchronous Realtime integration method. If you would like to use Proxy Endpoint or asynchronous Push-Pull integration, refer to the integration methods section.

Request parameter values

Basic setup and customization options for retrieving ChatGPT.

Parameter
Description
Default Value

source

Sets the scraper.

chatgpt

prompt

The prompt or question to submit to ChatGPT. Must be less than 4000 symbols.

-

search

Triggers ChatGPT to perform a Web Search for the prompt by clicking the associated interface button.

true

render

JavaScript rendering is enforced by default for chatgpt. More info.

-

parse

Returns parsed data when set to true.

false

geo_location

Specify a country to send the prompt from. More info.

-

callback_url

URL to your callback endpoint. More info.

-

- mandatory parameter

Structured data

Web Scraper API is capable of extracting either an HTML or JSON object that contains ChatGPT output, offering structured data on various elements of the results page.

chatgpt structured output

Output data dictionary

HTML example

JSON structure

The structured chatgpt output includes fields like URL, page, results, and more. The table below presents a detailed list of each ChatGPT element we parse, including descriptions, data types, and relevant metadata.

The number of items and fields for a specific result type may vary depending on the submitted prompt.

Key Name
Description
Type

url

The URL of ChatGPT conversation.

string

page

Page number.

integer

content

An object containing the parsed ChatGPT response data.

object

content.prompt

Original prompt submitted to ChatGPT.

string

content.llm_model

ChatGPT model used (e.g., "gpt-4-o", "gpt-3.5-turbo", etc.).

string

content.markdown_json

Complete response Markdown as JSON from ChatGPT.

array

content.markdown_text

Complete response Markdown from ChatGPT.

string

content.response_text

Complete response text from ChatGPT.

string

content.citations

List of citation links with URL and text.

array

content.links

List of external links referenced in the response.

array

content.parse_status_code

Status code of the parsing operation.

integer

created_at

Timestamp when the scraping job was created.

timestamp

updated_at

Timestamp when the scraping job was finished.

timestamp

job_id

ID of the job associated with the scraping job.

string

geo_location

Proxy location from which the prompt was submitted.

string

status_code

Status code of the scraping job. You can see the scraper status codes described here.

integer

parser_type

Type of the parser used for breaking down the HTML content.

string

Last updated

Was this helpful?