Skip to main content
Complete the requirements before you begin. You can also learn about Unstructured’s partitioning and structured data extraction before you begin.
1

Create the job

Replace EXTRACTION_PROMPT with your extraction prompt, and INPUT_DIR with the path to your local directory of files to process. The response includes the job ID.
Each local-file processing job is limited to 10 files, and each file is limited to 50 MB in size.If you need to launch a series of local-file processing 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 five local-file processing jobs can be running in your Unstructured account. If you launch a new local-file processing job but 5 existing local-file processing jobs are still running, the new local-file processing job will remain in a scheduled state until one of the five existing local-file processing jobs is done running.
Save and run this script:
This script requires jq to parse the JSON response.
2

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.
Save and run this script:
This script requires jq to parse the JSON response.
3

Download the job output

Replace JOB_ID, OUTPUT_FILE_IDS, and OUTPUT_DIR with your values from the previous steps.
Save and run this script:

Complete end-to-end script

Replace EXTRACTION_PROMPT, INPUT_DIR, and OUTPUT_DIR with your values, then save and run this script.
This script requires jq to parse JSON responses.

What’s next?