Easily collect responses from ChatGPT scraper by providing a prompt along with valid Web Scraper API credentials.
Easily collect responses from ChatGPT scraper by providing a prompt along with valid Web Scraper API credentials.
The ChatGPT Scraper by Oxylabs allows you to send prompts to ChatGPT and automatically collect both conversational responses and structured metadata. You can use the Web Scraper API with ChatGPT for SEO monitoring, AI response analysis, and brand presence tracking. It provides parsed, ready-to-use JSON output without the need to manage proxies and browsers, or avoid server-side defense systems.
You can gather ChatGPT scraper response results by simply providing a prompt and valid Web Scraper API credentials. Once authenticated, you can make a simple POST request to the API as shown below.
[!TIP] Get a free trial of Oxylabs Web Scraper API by registering on the Dashboard.
import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'chatgpt',
'prompt': 'best supplements for better sleep',
'parse': True,
'geo_location': "United States",
'callback_url': "https://your-server.com/oxylabs-callback"
}
# Get response.
response = requests.request(
'POST',
'https://data.oxylabs.io/v1/queries',
auth=('USERNAME', 'PASSWORD'),
json=payload,
)
# Print prettified response to stdout.
pprint(response.json())You can find code examples for other programming languages here.
| Parameter | Description | Default Value |
|---|---|---|
source (mandatory) |
Sets the scraper target. Use chatgpt. |
– |
prompt (mandatory) |
Promp to ChatGPT (max 4000 characters). | – |
search |
Set to true for web search. | false |
geo_location |
Specify a country to route the request from. | – |
parse |
Set to true for structured JSON results. |
false |
callback_url |
URL to your callback endpoint. | – |
browser_instructions |
Optional custom browser instructions when rendering JavaScript. More info. | – |
HTML example:
This is a structured JSON snippet of the response output:
…You can find the full output example file in this repository.
Alternatively, you can extract the data in the Markdown format for easier data integration workflows involving AI tools.
Note: The composition of elements may vary depending on whether the query was made from a desktop or mobile device.
All LLM targets return the same top-level job and results[] envelope. See the documentation for the full metadata reference.
The following table show ChatGPT-specific results[].content fields:
Note: The number of items and fields for a specific result type may vary depending on the submitted prompt.
| Key Name | Description | Type |
|---|---|---|
prompt |
Submitted prompt to generate result. | string |
llm_model |
Specific ChatGPT model used for the response (e.g., gpt-4o). |
string |
response_text |
Plain-text response from ChatGPT. | string |
markdown_text |
ChatGPT response as Markdown. | string |
markdown_json |
Structured JSON representation of the Markdown response. Each item contains type and children. |
array |
* citations |
List of response source citations. Objects contain title, url, text, description, and section. |
array |
* search_queries |
Search queries used by the model to gather information. | array of strings |
* links |
List of objects for inline source link details: url and text. |
array |
* shopping_products |
List of objects containing product details: price, title, rating, currency, price_str, and thumbnail. |
array |
* ads |
Ad details containing url, title, image_url, description, and an advertiser_info object. |
array |
* ads.advertiser_info |
Object with advertiser url, name, and image_url. |
object |
parse_status_code |
12000 – successful. Otherwise, parser failed to extract some or all structured fields. |
integer |
* — conditional, returned only when content is in the LLM's response.
This ChatGPT scraper API opens a wide range of opportunities for developers and data-focused teams.
The legality of using ChatGPT scrapers depends on the way it is done and the applicable jurisdiction. While Oxylabs provides the infrastructure to collect publicly available or user-submitted data from ChatGPT, it is the responsibility of the user to ensure compliance with OpenAI’s Terms of Service and local regulations.
The maximum prompt length supported by the ChatGPT Scraper is 4,000 symbols. If your use case requires handling longer inputs, consider splitting the text into smaller chunks and sending multiple sequential requests.
For a deeper dive into available parameters, advanced integrations, and additional examples, check out the ChatGPT Scraper documentation.
If you have questions or need support, reach out to us at [email protected], or through live chat, accessible via Oxylabs Dashboard, or join our Discord community. For enterprise-related inquiries, contact your dedicated account manager.
No open issues yet, or sync has not completed.