List Batches
List all batch jobs using GET /v1/batch.
List Batches
Retrieve a paginated list of your batch jobs.
GET
/v1/batchList batch jobs with pagination and optional status filtering.
Query Parameters
Parameters
| Parameter | Type | Description |
|---|
Example Request
Response
Success Response (200)
{
"data": [
{
"id": "batch_abc123def456",
"name": "Daily fact check",
"status": "completed",
"totalItems": 50,
"processedItems": 50,
"successCount": 48,
"failureCount": 2,
"totalCostCents": 250,
"createdAt": "2024-01-15T10:00:00Z",
"startedAt": "2024-01-15T10:00:01Z",
"completedAt": "2024-01-15T10:02:30Z"
},
{
"id": "batch_xyz789",
"name": "Article verification",
"status": "processing",
"totalItems": 100,
"processedItems": 45,
"successCount": 44,
"failureCount": 1,
"totalCostCents": 112,
"createdAt": "2024-01-15T11:00:00Z",
"startedAt": "2024-01-15T11:00:01Z",
"completedAt": null
}
],
"pagination": {
"total": 156,
"limit": 10,
"offset": 0,
"hasMore": true
}
}Response Fields
| Parameter | Type | Description |
|---|
Pagination Example
// Fetch all batches with pagination
async function fetchAllBatches(client) {
const batches = [];
let offset = 0;
const limit = 100;
while (true) {
const { data, pagination } = await client.listBatches({ limit, offset });
batches.push(...data);
if (!pagination.hasMore) break;
offset += limit;
}
return batches;
}