Jobs
Submit async job
Submit a scrape job for background processing. Returns a job ID for polling. Credits are deducted at submit time and restored if all retries fail.
POST
/
scrapers
/
chatgpt
/
jobs
Submit an async ChatGPT scrape job
curl --request POST \
--url https://api.scrapellm.com/scrapers/chatgpt/jobs \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.scrapellm.com/scrapers/chatgpt/jobs"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.scrapellm.com/scrapers/chatgpt/jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrapellm.com/scrapers/chatgpt/jobs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.scrapellm.com/scrapers/chatgpt/jobs"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.scrapellm.com/scrapers/chatgpt/jobs")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrapellm.com/scrapers/chatgpt/jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"job_id": "3f7a2b1c-9e4d-4f8a-b2c1-7d6e5f4a3b2c",
"status": "pending"
}{
"detail": "Missing API key. Pass your key in the X-API-Key header or as ?api_key= in the URL."
}{
"detail": "Credit limit reached. Upgrade your plan or wait for your billing cycle to reset."
}Replace
chatgpt in the endpoint path with any scraper: perplexity, grok, copilot, gemini, google_ai_mode, or amazon_rufus. All accept the same parameters.Overview
Submit any scrape as a background job. Returns ajob_id immediately (HTTP 202) - no open connection required. Poll GET /jobs/{job_id} to retrieve the result when done.
See individual scraper pages for provider-specific parameters (e.g. mode for Grok and Copilot, web_search for Perplexity).
Example request
curl -X POST "https://api.scrapellm.com/scrapers/chatgpt/jobs" \
-H "X-API-Key: YOUR_API_KEY" \
-G \
--data-urlencode "prompt=What brands do marketers recommend for email automation?" \
--data-urlencode "country=US"
import requests
resp = requests.post(
"https://api.scrapellm.com/scrapers/chatgpt/jobs",
headers={"X-API-Key": "YOUR_API_KEY"},
params={
"prompt": "What brands do marketers recommend for email automation?",
"country": "US",
}
)
job_id = resp.json()["job_id"]
print(f"Job submitted: {job_id}") # HTTP 202
const params = new URLSearchParams({
prompt: "What brands do marketers recommend for email automation?",
country: "US",
});
const resp = await fetch(
`https://api.scrapellm.com/scrapers/chatgpt/jobs?${params}`,
{ method: "POST", headers: { "X-API-Key": "YOUR_API_KEY" } }
);
const { job_id } = await resp.json(); // HTTP 202
console.log("Job submitted:", job_id);
Response
HTTP 202 Accepted
{
"job_id": "3f7a2b1c-9e4d-4f8a-b2c1-7d6e5f4a3b2c",
"status": "pending"
}
Credit behaviour
- Credits are deducted at submit time
- If the scrape fails after all retry attempts, credits are automatically restored
- Failed jobs are retried up to 3 times before being marked
failed
Error codes
| Status | Meaning |
|---|---|
401 | Missing or invalid API key |
429 | Credit limit reached |
What’s next
After submitting a job, pollGET /jobs/{job_id} to check status and retrieve the result.
Get job status
Poll for job completion and retrieve the full scrape result
Authorizations
ApiKeyHeaderApiKeyQuery
Query Parameters
Response
Job accepted. Poll GET /jobs/{job_id} for status and result.
Submit an async ChatGPT scrape job
curl --request POST \
--url https://api.scrapellm.com/scrapers/chatgpt/jobs \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.scrapellm.com/scrapers/chatgpt/jobs"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.scrapellm.com/scrapers/chatgpt/jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrapellm.com/scrapers/chatgpt/jobs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.scrapellm.com/scrapers/chatgpt/jobs"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.scrapellm.com/scrapers/chatgpt/jobs")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrapellm.com/scrapers/chatgpt/jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"job_id": "3f7a2b1c-9e4d-4f8a-b2c1-7d6e5f4a3b2c",
"status": "pending"
}{
"detail": "Missing API key. Pass your key in the X-API-Key header or as ?api_key= in the URL."
}{
"detail": "Credit limit reached. Upgrade your plan or wait for your billing cycle to reset."
}