Documentation

Overview

Use the service

Billing

Reference

Reference

GET /batches/{batchId}

A batch's progress counts and every item's state, with the item ids you need to fetch results.

Syntax

GET https://grid-lab.zyxio.xyz/batches/<batchId>
x-api-key: <key>

Request

NameWhereRequiredMeaning
x-api-keyheaderyes, or AuthorizationYour API key, or Authorization: Bearer <token> from Zyxio sign-in.
batchIdpathyesThe id from POST /batches.

Response

200 OK

FieldMeaning
batchIdThe batch's id.
countswaiting, active, completed and failed item counts.
totalThe number of items. The batch is done when completed + failed equals total.
jobsOne entry per item, sorted by jobId: jobId, url, state (waiting, active, completed or failed) and, for a failed item, failedReason, a short text saying why its last attempt failed.

This is the only call that lists a batch's item ids; keep the jobId to url mapping.

Errors

StatusBodyWhenWhat to do
401{"error": "unauthorized"}No credential, or a key that is revoked, expired, wrong, or of a suspended account.Send a valid key.
503{"error": "accounting_unavailable"}Your key or Zyxio sign-in could not be checked because the account database did not answer in time. Nothing was done.Retry shortly; the same request is safe to resend.
403{"error": "forbidden"}A valid Zyxio sign-in token whose identity has no account here, or whose account is suspended.Accept your invitation first, or use a key.
404{"error": "unknown batch"}No such batch, or it belongs to another identity.Check the id, and use the identity that created it.

Example

curl -s https://grid-lab.zyxio.xyz/batches/6f1d2c3e-8a4b-4e5f-9a0b-1c2d3e4f5a6b \
  -H "x-api-key: $BROWSERGRID_API_KEY"
{
  "batchId": "6f1d2c3e-8a4b-4e5f-9a0b-1c2d3e4f5a6b",
  "counts": {"waiting": 0, "active": 0, "completed": 1, "failed": 1},
  "total": 2,
  "jobs": [
    {"jobId": "0b6c8f8e-2f3a-4c1d-9e5f-7a8b9c0d1e2f", "url": "https://example.com/", "state": "completed"},
    {"jobId": "9d4e5f6a-7b8c-4d9e-8f0a-1b2c3d4e5f6a", "url": "https://example.com/about", "state": "failed", "failedReason": "<why the last attempt failed>"}
  ]
}

Billing

Free. Charges for the items themselves are made when each item settles; see POST /batches.

See also

Captures, GET /jobs/{jobId}, GET /artifacts/{jobId}/{kind}.