Create the on-demand job
Replace
INPUT_DIR with the path to your local directory of files to process. The response includes the job ID.Each on-demand job is limited to 10 files, and each file is limited to 50 MB in size.If you need to launch a series of on-demand jobs in rapid succession, you must wait at least one second between launch
requests. Otherwise, you will receive a rate limit error.A maximum of 5 on-demand jobs can be running in your Unstructured account. If you launch a new on-demand job
but 5 existing on-demand jobs are still running, the new on-demand job will remain in a scheduled state until one of the 5
existing on-demand jobs is done running.
- curl
- Python
Poll for job status
Replace
JOB_ID with the job ID from the previous step. This script polls every 10 seconds and stops when the job completes.- curl
- Python
Complete end-to-end script
ReplaceINPUT_DIR and OUTPUT_DIR with your directory paths, then save and run this script.
- curl
- Python
This script requires jq to parse JSON responses.
What’s next?
- Create on-demand jobs that add enrichments, add embeddings, or perform structured data extractions.
- Learn about the Unstructured API’s other workflow operations.

