"status": "open", POST /jobs/{id}/tasks, last_batch, POST /jobs/{id}/close)
Ask your AI agent
Paste this prompt into a coding agent such as Claude Code or Cursor, with the Zenrows docs connected. The agent looks up the details and writes the calls.Open a job and stream URLs into it
- Create the job with
"status": "open". Tasks are optional at this point. Thezenrows_paramsyou set here apply to every URL you add later. - Send each group of URLs to
POST /jobs/{job_id}/tasksas{"tasks": [...]}. Scraping starts with the first group. - Close the job when your producer is done: either send the last group with
"last_batch": true, or callPOST /jobs/{job_id}/close. The run then finishes the queued tasks and endscompleted.
Example output
The Python run:"last_batch": true:
Use the Python SDK
submit_open opens the job, add_tasks appends a group, and "last_batch": True on the final group closes it. job.close() does the same without adding tasks.
Python (SDK)
Output
Customize it
Troubleshooting
- Adding tasks returns
409withjob_not_open: the job is already closed bylast_batchor/close. Open a new job for the next set of URLs. - Adding tasks right after a large submission returns
409: the job is still ingesting the previous group. Wait a few seconds and send the group again. - The run stays
runningafter your producer finishes: the job is still open. CallPOST /jobs/{job_id}/closeso the run can complete. 429withtoo_many_crawls: other Crawl and Batch jobs on your account are still running. Wait the number of seconds in theRetry-Afterheader, then open the job.
Related recipes
Scrape a list of URLs
Send every URL up front as one job.
Start a Batch job from a CSV file
Upload a whole CSV of URLs at once.
Use different settings for each URL in one job
Give one task markdown, another JSON fields.
Get notified when a Batch job finishes
Receive a webhook instead of polling.