ChatGPT Scraper API
The ChatGPT Scraper API lets you send any prompt to ChatGPT and receive structured JSON responses including the full conversation with user and assistant roles. No browser automation required — Scrapingdog handles all the complexity. Each successful request costs 30 API credits.
Endpoint:
https://api.scrapingdog.com/chatgptAPI Parameters
🔑
Scrapingdog Parameters
api_keyRequiredYour personal API key. Available on your dashboard.
Type: String
💬
Prompt
promptRequiredThe prompt to send to ChatGPT (e.g.,What is web scraping?). The API returns the full conversation with user and assistant roles in structured JSON.
Type: String
⚙
️ Advanced
htmlOptionalSet totrueto return the full HTML of the ChatGPT page instead of parsed JSON. Default:false.
Type: String
API Examples
Code to Integrate
curl "https://api.scrapingdog.com/chatgpt/?api_key=APIKEY&prompt=What+is+web+scraping%3F"
import requests params = { "api_key": "APIKEY", "prompt": "What is web scraping?" } response = requests.get("https://api.scrapingdog.com/chatgpt/", params=params) data = response.json() for message in data["conversation"]: print(message["role"], message["content"])
const params = new URLSearchParams({ api_key: "APIKEY", prompt: "What is web scraping?" }); const response = await fetch(`https://api.scrapingdog.com/chatgpt/?${params}`); const data = await response.json(); data.conversation.forEach(msg => console.log(msg.role, msg.content));
<?php $url = 'https://api.scrapingdog.com/chatgpt/?' . http_build_query([ 'api_key' => 'APIKEY', 'prompt' => 'What is web scraping?', ]); echo file_get_contents($url);
API Response
{
"conversation": [
{
"role": "user",
"content": "What is web scraping?"
},
{
"role": "assistant",
"content": [
{
"type": "paragraph",
"text": "Web scraping is the automated process of extracting data from websites. It involves sending HTTP requests to web pages and parsing the HTML content to collect structured information."
},
{
"type": "paragraph",
"text": "Web scraping is widely used for:"
},
{
"type": "numbered_list",
"items": [
"Price monitoring and comparison across e-commerce sites",
"Lead generation by collecting contact information",
"Market research and competitor analysis",
"Aggregating news and content from multiple sources",
"Training machine learning models with real-world data"
]
},
{
"type": "paragraph",
"text": "Tools like Python's BeautifulSoup and Scrapy, or services like Scrapingdog, simplify the process by handling proxy rotation, CAPTCHA solving, and JavaScript rendering automatically."
}
]
}
]
}