Batch Processing
Upload a CSV of requests and get every result at half price
Send up to 100,000 requests to one endpoint in a single CSV upload. Rows run in the background within 24 hours (up to 7 days for large files) and each successful row costs 50% of the normal price.
Overview
Batch processing is for work that does not need an answer straight away: refreshing a product catalogue, enriching a list of profiles or running a long list of searches. You upload one CSV file where each row is one request to the same endpoint. DataGuru runs the rows in the background using spare capacity and you download all the results when the batch has finished.
At a glance
| Batch | |
|---|---|
| Price | 50% of the endpoint price, per successful row |
| Failed rows | Free |
| Turnaround | 24 hours, plus 1 day per 10,000 rows, up to 7 days |
| File size | Up to 100,000 rows and 25 MB (UTF-8 CSV) |
| Billing mode | USD balance only |
| Balance needed | Enough for one row to start; funds are held 500 rows at a time |
| Results kept | 30 days after the batch deadline |
From the dashboard
You can also upload a file without writing code: open an endpoint in the Playground, choose "Upload file" and download the ready-made CSV template. Batches from the API and the Playground both appear on the Requests page.
1. Prepare the CSV file
The first row is the header and lists parameter names of the endpoint, exactly as they appear in its Request Parameters table. Every following row is one request. Columns for required parameters must be present; optional columns can be left out or left empty, in which case the parameter default is used. Array and object parameters can be written as JSON in the cell. Empty lines are ignored.
queries.csv for Target Product Search
query,limit airpods,3 lego star wars,2 stanley cup,
Every row is checked before anything is charged
If any row is invalid (a missing required value, a wrong type, an unknown column) the whole file is rejected with the line numbers of the problems, and nothing is reserved or charged. Fix the listed lines and upload the file again.
2. Submit the batch
POST the file as multipart form data in a field named "file" to the endpoint path with ?batch=true added. Uploads always use POST, even for endpoints that are called with GET. The response is 202 Accepted with a batch_id and the deadline by which every row will have run.
Submit a batch
curl -X POST "https://api.dataguru.cc/api/v1/target/products/search?batch=true" \ -H "Authorization: Api-Key YOUR_API_KEY" \ -F "[email protected]"
Or name the endpoint in a form field
curl -X POST "https://api.dataguru.cc/api/v1/batches/" \ -H "Authorization: Api-Key YOUR_API_KEY" \ -F "endpoint_path=target/products/search" \ -F "[email protected]"
202 Accepted
{ "success": true, "message": "Batch accepted: 3 rows will be processed by 2026-10-30 07:02 UTC.", "batch_id": "5f5acce0-371e-443e-aaf6-6785b2e3d82c", "status": "PROCESSING", "finished": false, "file_name": "queries.csv", "endpoint": { "id": 45, "name": "Target Product Search", "path": "target/products/search", "method": "POST" }, "columns": [ "query", "limit" ], "rows": { "total": 3, "pending": 3, "succeeded": 0, "failed": 0, "skipped": 0, "done": 0 }, "progress": 0.0, "billing": { "discount": 0.5, "row_price_usd": 0.01, "funded_rows": 3, "reserved_usd": 0.03, "charged_usd": 0.0, "unfunded_usd": 0.0 }, "created_at": "2026-10-29T07:02:13.237334+00:00", "deadline_at": "2026-10-30T07:02:13.162946+00:00", "paused_at": null, "completed_at": null, "status_url": "/api/v1/batches/5f5acce0-371e-443e-aaf6-6785b2e3d82c/", "results_url": "/api/v1/batches/5f5acce0-371e-443e-aaf6-6785b2e3d82c/results.json", "summary_url": "/api/v1/batches/5f5acce0-371e-443e-aaf6-6785b2e3d82c/results.csv" }
3. Track progress
Poll the batch every few minutes. "rows" shows how many rows are pending, succeeded, failed or skipped, and "finished" becomes true once no row is pending or running; the counts and charge are final from then on. You also get a dashboard notification when a batch finishes. GET /api/v1/batches/ lists all your batches, newest first, and GET /api/v1/batches/{batch_id}/rows/ lists individual rows (add ?status=failed, succeeded or pending to filter).
Check a batch
curl "https://api.dataguru.cc/api/v1/batches/5f5acce0-371e-443e-aaf6-6785b2e3d82c/" \ -H "Authorization: Api-Key YOUR_API_KEY"
Batch status
| status | Meaning |
|---|---|
| PROCESSING | Rows are being run. |
| WAITING_FOR_FUNDS | Your balance ran out. The batch continues automatically after you add funds; its deadline is paused meanwhile. |
| COMPLETED | Every row has run. Some rows may have failed; check "rows.failed". |
| CANCELLED | You stopped the batch. Rows that had not started were refunded. |
| EXPIRED | The deadline passed before every row could run. Rows that had not started were refunded. |
4. Download the results
Results are available in three formats, in the same row order as your file. You can download them while the batch is still running; rows that have not finished show status PENDING. results.json: a JSON array with one object per row, including the full response in "data". results.jsonl: the same objects, one per line (JSON Lines), easier to stream for very large batches. results.csv: your input columns plus status, error code, error message, cost and latency for each row.
Download all responses
curl -o results.json \ "https://api.dataguru.cc/api/v1/batches/5f5acce0-371e-443e-aaf6-6785b2e3d82c/results.json" \ -H "Authorization: Api-Key YOUR_API_KEY"
results.json
[ { "row": 1, "job_id": "f694ff44-ca67-4464-a3b7-cdb7ab6e3319", "status": "COMPLETED", "input": { "query": "airpods", "limit": 3 }, "latency_ms": 2595, "cost_usd": 0.01, "completed_at": "2026-10-29T07:02:18.512000+00:00", "data": { "...": "Same payload as a single request to the endpoint" } }, { "row": 2, "job_id": "7c0e4b9a-51d2-4f3e-9a86-2b5d0f1e8c34", "status": "FAILED", "input": { "query": "zzqx", "limit": 2 }, "latency_ms": 9120, "cost_usd": 0.0, "completed_at": "2026-10-29T07:02:27.004000+00:00", "error": { "code": "PROVIDER_ERROR", "message": "Failed to retrieve Target search results for 'zzqx' after 3 attempts." } } ]
Billing
Each row costs half the endpoint price. Funds are held from your USD balance 500 rows at a time, in file order, so you can upload a file larger than your balance: the upload only fails with 402 if your available balance does not cover a single row. Each row that succeeds is charged its half price; each row that fails is released back to your balance. If your balance runs out before every row is paid for, the batch status becomes WAITING_FOR_FUNDS and you get a notification. Rows already running finish, nothing more starts, and the deadline is paused. Add funds and the batch continues within a minute, with the paused time added to its deadline. A batch that waits for 7 days expires. "billing.funded_rows" and "billing.unfunded_usd" show how far the batch is paid for. Rows that never run, because you stopped the batch or it expired, are refunded. For endpoints priced per record, each row holds up to 100 records and you are charged for the records actually returned, at half price.
Stop a batch
# Rows that have not started are cancelled and refunded; rows already running finish normally curl -X POST "https://api.dataguru.cc/api/v1/batches/5f5acce0-371e-443e-aaf6-6785b2e3d82c/cancel/" \ -H "Authorization: Api-Key YOUR_API_KEY"
Errors
Upload errors return {"success": false, "error": "...", "code": "..."}. For ROWS_INVALID, "details.row_errors" lists up to 50 problem rows with their line numbers in the file (the header is line 1), and "details.invalid_rows" gives the total.
Batch error codes
| Status | Code | Description |
|---|---|---|
| 400 | FILE_REQUIRED | No file was sent in the "file" field. |
| 400 | FILE_NOT_CSV | The file is not UTF-8 encoded text. |
| 400 | FILE_EMPTY | The file has no header row or no data rows. |
| 400 | UNKNOWN_COLUMNS | A header column is not a parameter of this endpoint. "details" lists the allowed columns. |
| 400 | MISSING_COLUMNS | A required parameter has no column and no default. |
| 400 | DUPLICATE_COLUMNS | A column name appears more than once. |
| 400 | ROWS_INVALID | One or more rows failed validation. Nothing was submitted or charged. |
| 402 | BATCH_REQUIRES_USD_BILLING | Batches are only available for accounts billed in USD. |
| 402 | INSUFFICIENT_BALANCE | Your available balance does not cover even one row. |
| 404 | ENDPOINT_NOT_FOUND | The endpoint does not exist or is not active. |
| 405 | METHOD_NOT_ALLOWED | Batch uploads must use POST. |
| 409 | BATCH_NOT_ACTIVE | The batch you tried to stop has already finished or stopped. |
| 413 | FILE_TOO_LARGE | The file is larger than 25 MB. |
| 413 | TOO_MANY_ROWS | The file has more than 100,000 rows. Split it into several batches. |