Batch

Check progress, and get download links once the batch finishes.

get/batch/{batch_id}

Request

  • Base URL
    https://api.context.dev/v1
  • URL
    https://api.context.dev/v1/batch/{batch_id}
  • Auth
    HTTP bearer

Path parameters

batch_idstring required

ID of the batch to retrieve or cancel.

Example:batch_9f2c8a

Response

Current state of the batch, with download links once it has finished.

idstring required

Batch ID used to retrieve or cancel the job.

status'queued' | 'running' | 'cancelling' | 'completed' | 'cancelled' | 'failed' required

Current state. completed, cancelled, and failed are final.

mode'scrape' | 'crawl' required

How pages were selected. Matches input.mode on the submit request.

format'markdown' | 'html' required

What each page is returned as. Matches input.data.format on the submit request.

tagsstring[] required

Tags stored on the batch at submission.

Example response

{
  "id": "batch_9f2c8a",
  "tags": [
    "docs"
  ],
  "crawl": {
    "source": {
      "url": "https://example.com/docs"
    },
    "max_pages": 500,
    "url_pattern": "^https://example\\.com/docs/"
  },
  "input": {
    "reserved": 24817,
    "submitted": 25000,
    "duplicates": 183
  },
  "progress": {
    "succeeded": 18091,
    "failed": 311,
    "pending": 6415
  },
  "credits": {
    "reserved": 24817,
    "refunded": 6726,
    "ocr_charged": 42,
    "net": 18091
  },
  "page_errors": [
    {
      "code": "WEBSITE_ACCESS_ERROR",
      "count": 204
    }
  ],
  "failure": {
    "code": "stalled",
    "message": "Batch stopped reporting progress and was finalized automatically"
  },
  "invalid_urls": [
    {
      "reason": "Must be a public http:// or https:// URL"
    }
  ]
}

Changes

    • warning

      added the new WEBSITE_BLOCKED enum value to the response property for the response status

    • warning

      added the new WEBSITE_BLOCKED enum value to the response property for the response status

    • warning

      added the new COLD_DOMAIN_TIMEOUT_TOO_LOW enum value to the response property for the response status

    • warning

      added the new COLD_DOMAIN_TIMEOUT_TOO_LOW enum value to the response property for the response status

    • info

      added subschema #1: Start URL subschema #2: Sitemap to the //// response property anyOf list for the response status

    • info

      removed subschema #1 subschema #2 from the //// response property anyOf list for the response status

    • info

      added the required property // to the response with the status