Skip to main content
POST
/
v1
/
jobs
Async jobs
curl --request POST \
  --url https://scrape.cleariflow.com/v1/jobs \
  --header 'Content-Type: application/json' \
  --data '
{
  "request": {},
  "priority": 123
}
'
{
  "job_id": "550e8400-e29b-41d4-a716-446655440000"
}

Getting started

Base URL

https://scrape.cleariflow.com/v1/jobs

Create a job

Enqueue an async scrape job with the same ScrapeRequest payload used by the synchronous endpoint.

Example request

curl -X POST 'https://scrape.cleariflow.com/v1/jobs' \
  -H 'Content-Type: application/json' \
  -d '{
    "request": {
      "api_key": "YOUR_UNIQUE_API_KEY",
      "url": "https://example.com"
    },
    "priority": 10
  }'
This successful request returns a job identifier:
{
  "job_id": "550e8400-e29b-41d4-a716-446655440000"
}

Create job parameters

request
Object
required
A ScrapeRequest object with the same fields as the synchronous scrape endpoint (url, render, actions, cookies, etc.).
priority
Integer
Job priority. Higher values are processed first. Defaults to 0.

Get job status

Poll a job by ID to check its status and retrieve results when complete.

Base URL

https://scrape.cleariflow.com/v1/jobs/{job_id}

Example request

curl 'https://scrape.cleariflow.com/v1/jobs/550e8400-e29b-41d4-a716-446655440000'
While the job is running:
{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "running"
}
When the job completes successfully:
{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "done",
  "result": {
    "ok": true,
    "html": "<!DOCTYPE html><html>...</html>",
    "meta": {
      "url": "https://example.com",
      "status_code": 200,
      "duration_ms": 8123
    }
  }
}

Job status values

StatusDescription
queuedJob is waiting in the queue.
runningBrowser session is active.
doneScrape completed; result contains the output.
failedScrape failed; error contains a description.

Response parameters

job_id
String
Unique identifier for the async job.
status
String
Current job status: queued, running, done, or failed.
result
Object
The scrape result object (same shape as the synchronous endpoint response). Present when status is done.
error
String
Error message. Present when status is failed.
meta
Object
Additional metadata about the job execution.