One POST request with a prompt returns the answer as text. Summarize, classify, translate or reshape the data you collect, with the same API key and credit balance you already scrape with.
curl -X POST https://scrapingbot.io/api/v1/chatgpt \ -H "x-api-key: YOUR_API_KEY" \ -H "content-type: application/json" \ -d '{"prompt": "Summarize this review in one sentence: The battery easily lasts two days and the screen is sharp, but the camera struggles in low light and there is no charger in the box."}'
{ "success": true, "response": "Great battery life and a sharp screen, but weak low-light photos and no charger included.", "duration": "1.23", "statusCode": 200 }
Send a prompt, read the answer. There is nothing else to configure, and errors come back as JSON too, with success: false and a message you can log.
Authenticate with the x-api-key header, a Bearer token or an api_key query parameter, exactly as with every other ScrapingBot API.
stringYour instructions plus any text the model should work on.
booleantrue when an answer came back.
stringThe answer, as plain text.
stringSeconds the request took, such as "1.23".
number200 on success.
{ "success": false, "error": "Missing required parameter: prompt" }
A missing prompt returns 400 and a low balance returns 402, both before anything is charged. If generation fails, the error comes back and the 10 credits are refunded automatically.
The same key and credit balance cover scraping and prompts, so a pipeline is two requests: collect the data, then ask about it.
There is no conversation memory. Put the instructions, the context and any earlier messages you need into the prompt.
Need JSON, a single label or a bullet list? Say so in the prompt and parse response in your code.
Add ai_query to a website scrape instead. It extracts the fields in the same request for 5 extra credits.
import requests BASE = "https://scrapingbot.io/api/v1" HEADERS = {"x-api-key": "YOUR_API_KEY"} # 1. Pull comments from a TikTok video (1 credit) video = "https://www.tiktok.com/@tiktok/video/7106594312292453675" res = requests.post(f"{BASE}/tiktok", headers=HEADERS, json={ "endpoint": "/comment/list", "params": {"url": video, "count": 50}, }) comments = [c["text"] for c in res.json()["data"]["comments"]] # 2. Ask for the main themes (10 credits) prompt = "List the three main themes in these comments:\n" prompt += "\n".join(comments) res = requests.post(f"{BASE}/chatgpt", headers=HEADERS, json={"prompt": prompt}) print(res.json()["response"])
Most prompts fall into one of these four jobs.
Condense reviews, comments, articles or support threads into a line or a paragraph.
Label sentiment, topic, language or intent so your data is easy to filter and count.
Ask for specific fields as JSON and parse the answer straight into your database.
Localize product copy, or rewrite text in a different tone, length or reading level.
A ChatGPT prompt costs 10 credits, and only when it succeeds. Short or long, every prompt costs the same.
Every successful ChatGPT prompt
10credits
Send a POST request to https://scrapingbot.io/api/v1/chatgpt with your API key in the x-api-key header and a JSON body like {"prompt": "…"}. The answer comes back as text in the response field.
No. Every request is independent. Include any instructions, context or earlier conversation you need in the prompt itself.
No. The endpoint takes a prompt and nothing else, so there is nothing to tune. Ask for the tone, length or format you want in the prompt.
Yes. Ask for it in the prompt, for example "Return only JSON with the keys name and price". The answer arrives as a string in response, so parse it in your code.
To pull fields out of a web page you are scraping, add ai_query or ai_schema to the scrape request: it extracts in the same call for 5 extra credits. Use this endpoint for everything else, such as text you already have, data from the TikTok, Instagram or Amazon APIs, or writing new copy.
10 credits per successful prompt, however long it is. Errors are refunded automatically, and a request without a prompt is rejected without charge. New accounts get 100 free credits, enough for 10 prompts.
Every account has a ChatGPT playground in the dashboard where you can test prompts and copy the request. The docs include examples for common tasks.
Create an account, copy your API key and send your first prompt in a few minutes. No credit card required.