Create Task (upload-first)
Most workflows start by uploading a local file, then creating a task using the uploaded file URL.client.files.create()
: Uploads a local file and returns a URL.client.tasks.parse.create()
: Submits the uploaded file URL for processing.
Supported Input Sources
You can provide a file via a URL, a local file (upload-first), or a base64-encoded string.Configuration
Most users can start without any configuration. If needed, you can set optional parameters likeexpires_in
for data retention when creating a task. For advanced options, see API Reference.
Get Task
Retrieve information for any task using itstask_id
. There are several ways to get task results depending on your needs.
Get Completed Task
For tasks that have already completed processing, you can retrieve the results immediately:Robust Polling with Retry Logic
For tasks still processing, implement polling with retry logic using dedicated retry libraries for better error handling and exponential backoff. We recommend using tenacity for python and p-retry for typescript.Get Task with Base64-Encoded Assets
By default, Chunkr provides access to generated files (like images or PDF crops) via temporary pre-signed URLs that expire after 10 minutes. For long-term access, you can retrieve file assets as base64-encoded strings, which embeds the data directly in the task response. Setbase64_urls=True
when fetching a task to get base64-encoded strings:
Asynchronous Processing (Python)
For Python applications that require non-blocking operations, you can use theAsyncChunkr
client instead of Chunkr
.
The async client provides the exact same methods and parameters, but all operations are awaitable.
- Import
AsyncChunkr
instead ofChunkr
- Use
await
before all client method calls - All method names and parameters remain exactly the same
- Perfect for applications already using
asyncio
or handling multiple concurrent operations
await
to your calls.
Data Retention
While we store all outputs, original files, and image crops, you can use Chunkr solely as a processing engine. For security and privacy, use theexpires_in
parameter to automatically delete all task data from Chunkr’s servers after processing.
Here’s an example config that sets the data to expire in 24 hours for Zero Data Retention. You would then use the get methods described above to retrieve your results before the data expires:
Advanced Features
While creating and reading tasks are the most common operations, Chunkr also provides functionality for more advanced task management:- List Tasks: View all your tasks with pagination, filtering, and sorting options.
- Delete Tasks: Permanently remove completed or failed tasks to clean up your workspace
- Cancel Tasks: Stop a queued task before it begins processing if it’s no longer needed