@hunt-labs/bytekit-mcp 0.3.16 → 0.3.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,28 @@ today, see [README.md](./README.md), which remains the authoritative usage guide
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.3.17] - 2026-10-02
14
+
15
+ ### Changed
16
+
17
+ - The bundled documentation snapshot's `sdk/python/client` page now opens with a runnable install,
18
+ client, `create_scrape.sync` and read-the-markdown example before the generated class
19
+ reference (#5068). The `get_doc` and `search_docs` tools serve the new text; no tool, schema or
20
+ transport change.
21
+ - The bundled documentation snapshot's API reference pages now list the keys of nested object
22
+ fields as dotted paths under their parent, for example `metadata.title` and `metadata.ogSiteName`
23
+ on the scrape response, instead of naming only the top-level fields (#5069). The `get_doc` and
24
+ `search_docs` tools serve the new text; no tool, schema or transport change.
25
+ - The bundled documentation snapshot's `introduction` page now carries a Python SDK example
26
+ (`AuthenticatedClient`, `create_scrape.sync`, `ScrapeRequest`) after the TypeScript one in its
27
+ "Integrate in 60 seconds" block (#5070). The `get_doc` and `search_docs` tools serve the new
28
+ text; no tool, schema or transport change.
29
+ - The bundled documentation snapshot's `introduction` page now requests the markdown format in its
30
+ TypeScript and Python examples and reads the result from the success envelope
31
+ (`result.metadata.title`, `result.formats.markdown`), so a copied snippet shows the response
32
+ shape (#5072). The `get_doc` and `search_docs` tools serve the new text; no tool, schema or
33
+ transport change.
34
+
13
35
  ## [0.3.16] - 2026-10-01
14
36
 
15
37
  ### Changed
@@ -21,6 +43,10 @@ today, see [README.md](./README.md), which remains the authoritative usage guide
21
43
  (#5034), which changes the text served for `billing/bandwidth`, `guides/errors`,
22
44
  `guides/monitors`, `guides/rate-limits`, `guides/scraping`, `guides/webhooks` and `mcp`.
23
45
  No tool, schema or transport change.
46
+ - Refreshed the bundled documentation snapshot after the `billing/balance` page's one-time
47
+ starter grant for new pay-as-you-go accounts rose from 50 MB to 100 MB of bandwidth, with the
48
+ 100-credit grant unchanged (#4959). No behavior change in the package: bundled content only,
49
+ no tool, schema or transport change.
24
50
 
25
51
  ## [0.3.15] - 2026-09-30
26
52
 
@@ -12,7 +12,7 @@
12
12
  "api/account/getaccount": {
13
13
  "title": "Get account details",
14
14
  "section": "API Reference",
15
- "body": "# Get account details\n\nReturns account, plan, and current API key details, including the\n`api_key` and `subscription` fields.\n\n**GET** `/v1/account`\n\n## Responses\n\n### 200 — Account, plan, and current API key details.\n- `id`\n- `email`\n- `name`\n- `plan`\n- `api_key`\n- `subscription`\n- `auto_topup`\n- `cancelled_at`\n- `grace_period_expires_at`\n- `created_at`\n- `owner_user_id`\n- `notifications`\n- `terms_version`\n- `has_activity`\n- `onboarding_completed`\n- `has_subscription`\n\n### 429 — Rate limit exceeded (`rate_limited`). Only reachable when authenticated via Clerk session (the 60-request/60-second per-user window) — the bearer and in-process auth branches are not rate-limited at this endpoint. Carries a `Retry-After` header derived from the same clock as the window reset.\n- `status`\n- `error`"
15
+ "body": "# Get account details\n\nReturns account, plan, and current API key details, including the\n`api_key` and `subscription` fields.\n\n**GET** `/v1/account`\n\n## Responses\n\n### 200 — Account, plan, and current API key details.\n- `id`\n- `email`\n- `name`\n- `plan`\n- `plan.id`\n- `plan.slug`\n- `plan.name`\n- `plan.included_screenshots`\n- `plan.has_overage`\n- `plan.overage_price_cents`\n- `plan.max_concurrency`\n- `plan.rate_limit_per_sec`\n- `plan.max_bulk_size`\n- `plan.max_monitors`\n- `plan.retention_days`\n- `api_key`\n- `api_key.id`\n- `api_key.prefix`\n- `api_key.label`\n- `api_key.environment`\n- `api_key.last_used_at`\n- `api_key.created_at`\n- `subscription`\n- `subscription.status`\n- `subscription.plan`\n- `subscription.plan.slug`\n- `subscription.plan.name`\n- `subscription.plan.included_bytes`\n- `subscription.plan.included_credits`\n- `subscription.plan.topup_price_per_mb_cents`\n- `subscription.plan.credit_topup_price_per_k_cents`\n- `auto_topup`\n- `auto_topup.enabled`\n- `auto_topup.threshold_cents`\n- `auto_topup.amount_cents`\n- `auto_topup.monthly_cap_cents`\n- `cancelled_at`\n- `grace_period_expires_at`\n- `created_at`\n- `owner_user_id`\n- `notifications`\n- `notifications.bandwidth_80_enabled`\n- `notifications.bandwidth_100_enabled`\n- `terms_version`\n- `has_activity`\n- `onboarding_completed`\n- `has_subscription`\n\n### 429 — Rate limit exceeded (`rate_limited`). Only reachable when authenticated via Clerk session (the 60-request/60-second per-user window) — the bearer and in-process auth branches are not rate-limited at this endpoint. Carries a `Retry-After` header derived from the same clock as the window reset.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
16
16
  },
17
17
  "api/bulk": {
18
18
  "title": "Bulk",
@@ -22,27 +22,27 @@
22
22
  "api/bulk/createbulk": {
23
23
  "title": "Create mixed bulk job",
24
24
  "section": "API Reference",
25
- "body": "# Create mixed bulk job\n\nEnqueues screenshots or scrapes in a single batch.\nProvide `urls` (simple list) or `items` (per-item config), not both.\nWebhook deliveries include `X-ByteKit-Event: bulk.completed` so\nreceivers can dispatch on the header without parsing the body shape.\nThe body follows `BulkCompletedWebhook`: at most 500 complete items and\n1 MiB, followed by cursor recovery through the existing mixed-item route\nwhenever `recovery_required` is true.\n\n**Limits:** request bodies are guarded in a two-tier shape. A streamed body\nwith no `Content-Length` header is capped at 4 MB before your API key\nis checked; a body that declares `Content-Length` is instead bounded\nthere by a 32 MB fail-safe (not the real limit — see below), since\nthat branch reads nothing until your key is verified. Once your key\nis verified, a second check re-gates the body against your account's\nown `max_bulk_size` (at this endpoint's richer per-item override\nbudget), which reaches 28.7 MB for the largest documented account. A\nstandard-plan account's effective ceiling is 4 MB; either tier's\noverrun returns a `400` with error code `request_too_large`.\n\n**POST** `/v1/bulk`\n\n## Request Body\n\n- `urls`\n- `items`\n- `defaults`\n- `webhook_url` (required)\n- `webhook_secret`\n- `metadata`\n\n## Responses\n\n### 202 — Bulk job accepted.\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n\n### 400 — Bad request. When a `url` (or item URL) fails strict validation the\nerror code is `invalid_url` and the `details` object contains:\n- `field` — the request field that failed (e.g. `\"url\"`)\n- `url` — the rejected value\n- `reason` — one of: `scheme_missing`, `scheme_unsupported`,\n `scheme_separator_typo`, `host_empty`, `host_invalid`,\n `host_blocked_private`, `host_blocked_loopback`, `host_too_long`,\n `host_unicode_not_punycode`, `userinfo_present`, `url_too_long`,\n `control_chars`, `not_a_url`\n- `status`\n- `error`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n\n### 422 — Validation error. `bulk_too_large` is returned when the item count\nexceeds the account plan's `max_bulk_size` cap (also surfaced as\n`max_bulk_size` on `GET /v1/account`). `validation_error` is\nreturned when the request body contains an unrecognized key\nanywhere in the top-level object, an `items[]` entry, or\n`defaults` — all three reject unknown keys with a 422\n`validation_error` whose `details` message names the offending\nkey, instead of silently discarding it. The two nested objects\ndo not accept the same field set: `device_scale_factor` is\n`defaults`-only (rejected per item), and `duration`/`scenario`\nare `items[]`-only (rejected under `defaults`). `metadata` is\nvalid both at the top level of the body and per item, but is\nrejected with this same 422 if placed under `defaults`.\n- `status`\n- `error`"
25
+ "body": "# Create mixed bulk job\n\nEnqueues screenshots or scrapes in a single batch.\nProvide `urls` (simple list) or `items` (per-item config), not both.\nWebhook deliveries include `X-ByteKit-Event: bulk.completed` so\nreceivers can dispatch on the header without parsing the body shape.\nThe body follows `BulkCompletedWebhook`: at most 500 complete items and\n1 MiB, followed by cursor recovery through the existing mixed-item route\nwhenever `recovery_required` is true.\n\n**Limits:** request bodies are guarded in a two-tier shape. A streamed body\nwith no `Content-Length` header is capped at 4 MB before your API key\nis checked; a body that declares `Content-Length` is instead bounded\nthere by a 32 MB fail-safe (not the real limit — see below), since\nthat branch reads nothing until your key is verified. Once your key\nis verified, a second check re-gates the body against your account's\nown `max_bulk_size` (at this endpoint's richer per-item override\nbudget), which reaches 28.7 MB for the largest documented account. A\nstandard-plan account's effective ceiling is 4 MB; either tier's\noverrun returns a `400` with error code `request_too_large`.\n\n**POST** `/v1/bulk`\n\n## Request Body\n\n- `urls`\n- `items`\n- `items.url`\n- `items.type`\n- `items.device`\n- `items.format`\n- `items.quality`\n- `items.full_page`\n- `items.block_ads`\n- `items.block_cookie_banners`\n- `items.scroll`\n- `items.include_html`\n- `items.country`\n- `items.language`\n- `items.dark_mode`\n- `items.formats`\n- `items.wait_until`\n- `items.wait_for_selector`\n- `items.delay_ms`\n- `items.viewport`\n- `items.viewport.width`\n- `items.viewport.height`\n- `items.duration`\n- `items.scenario`\n- `items.metadata`\n- `defaults`\n- `defaults.type`\n- `defaults.device`\n- `defaults.format`\n- `defaults.quality`\n- `defaults.full_page`\n- `defaults.block_ads`\n- `defaults.block_cookie_banners`\n- `defaults.scroll`\n- `defaults.include_html`\n- `defaults.country`\n- `defaults.language`\n- `defaults.dark_mode`\n- `defaults.formats`\n- `defaults.wait_until`\n- `defaults.wait_for_selector`\n- `defaults.delay_ms`\n- `defaults.viewport`\n- `defaults.viewport.width`\n- `defaults.viewport.height`\n- `defaults.device_scale_factor`\n- `webhook_url` (required)\n- `webhook_secret`\n- `metadata`\n\n## Responses\n\n### 202 — Bulk job accepted.\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n\n### 400 — Bad request. When a `url` (or item URL) fails strict validation the\nerror code is `invalid_url` and the `details` object contains:\n- `field` — the request field that failed (e.g. `\"url\"`)\n- `url` — the rejected value\n- `reason` — one of: `scheme_missing`, `scheme_unsupported`,\n `scheme_separator_typo`, `host_empty`, `host_invalid`,\n `host_blocked_private`, `host_blocked_loopback`, `host_too_long`,\n `host_unicode_not_punycode`, `userinfo_present`, `url_too_long`,\n `control_chars`, `not_a_url`\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 422 — Validation error. `bulk_too_large` is returned when the item count\nexceeds the account plan's `max_bulk_size` cap (also surfaced as\n`max_bulk_size` on `GET /v1/account`). `validation_error` is\nreturned when the request body contains an unrecognized key\nanywhere in the top-level object, an `items[]` entry, or\n`defaults` — all three reject unknown keys with a 422\n`validation_error` whose `details` message names the offending\nkey, instead of silently discarding it. The two nested objects\ndo not accept the same field set: `device_scale_factor` is\n`defaults`-only (rejected per item), and `duration`/`scenario`\nare `items[]`-only (rejected under `defaults`). `metadata` is\nvalid both at the top level of the body and per item, but is\nrejected with this same 422 if placed under `defaults`.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
26
26
  },
27
27
  "api/bulk/deletebulk": {
28
28
  "title": "Cancel a bulk job",
29
29
  "section": "API Reference",
30
- "body": "# Cancel a bulk job\n\nCancels an in-flight bulk job: drains its still-queued (pending) child jobs and refunds the quota held for exactly those drained children. Children already completed, failed, or in progress are untouched and keep their charge. Idempotent — cancelling an already-terminal job (completed, failed, or cancelled) is a no-op that returns 200 with the job's real, unchanged status and refunds nothing.\n\n**DELETE** `/v1/bulk/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Responses\n\n### 200 — Bulk job after the cancel attempt. `status` is `cancelled` when the job was in flight, or its real terminal status when it had already finished.\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n\n### 404 — Resource not found.\n- `status`\n- `error`"
30
+ "body": "# Cancel a bulk job\n\nCancels an in-flight bulk job: drains its still-queued (pending) child jobs and refunds the quota held for exactly those drained children. Children already completed, failed, or in progress are untouched and keep their charge. Idempotent — cancelling an already-terminal job (completed, failed, or cancelled) is a no-op that returns 200 with the job's real, unchanged status and refunds nothing.\n\n**DELETE** `/v1/bulk/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Responses\n\n### 200 — Bulk job after the cancel attempt. `status` is `cancelled` when the job was in flight, or its real terminal status when it had already finished.\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n\n### 404 — Resource not found.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
31
31
  },
32
32
  "api/bulk/getbulk": {
33
33
  "title": "Get bulk job status",
34
34
  "section": "API Reference",
35
- "body": "# Get bulk job status\n\n**GET** `/v1/bulk/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Responses\n\n### 200 — Successful response.\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n\n### 202 — Bulk job still processing. `routes/bulk.ts` ends the poll handler with\n`status: isTerminal ? 200 : 202` over an identical body, so this is the\nSAME envelope the 200 documents — only the status code and the reachable\n`status` values differ. Keep polling until you get a 200 (issue #3533).\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n\n### 404 — Resource not found.\n- `status`\n- `error`"
35
+ "body": "# Get bulk job status\n\n**GET** `/v1/bulk/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Responses\n\n### 200 — Successful response.\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n\n### 202 — Bulk job still processing. `routes/bulk.ts` ends the poll handler with\n`status: isTerminal ? 200 : 202` over an identical body, so this is the\nSAME envelope the 200 documents — only the status code and the reachable\n`status` values differ. Keep polling until you get a 200 (issue #3533).\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n\n### 404 — Resource not found.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
36
36
  },
37
37
  "api/bulk/listbulk": {
38
38
  "title": "List bulk jobs",
39
39
  "section": "API Reference",
40
- "body": "# List bulk jobs\n\nReturns the caller's bulk jobs, most recent first, one cursor-paginated\npage at a time. Optionally filter to a single status; when omitted, jobs\nof every status are returned. `status` narrows the set and the cursor\naddresses a position inside that already-ordered, already-filtered set,\nso the two can be combined in one request. Follow `next_cursor` while\n`has_more` is true.\n\n**GET** `/v1/bulk`\n\n## Parameters\n\n- `limit` (query, integer)\n- `cursor` (query, string) — Pagination cursor from a previous response.\n- `status` (query, string)\n\n## Responses\n\n### 200 — Successful response.\n- `next_cursor`\n- `has_more`\n- `data`\n\n### 422 — Validation error. Returned when `status` is not one of the documented values, or when `cursor` is not a cursor this endpoint issued.\n- `status`\n- `error`"
40
+ "body": "# List bulk jobs\n\nReturns the caller's bulk jobs, most recent first, one cursor-paginated\npage at a time. Optionally filter to a single status; when omitted, jobs\nof every status are returned. `status` narrows the set and the cursor\naddresses a position inside that already-ordered, already-filtered set,\nso the two can be combined in one request. Follow `next_cursor` while\n`has_more` is true.\n\n**GET** `/v1/bulk`\n\n## Parameters\n\n- `limit` (query, integer)\n- `cursor` (query, string) — Pagination cursor from a previous response.\n- `status` (query, string)\n\n## Responses\n\n### 200 — Successful response.\n- `next_cursor`\n- `has_more`\n- `data`\n- `data.id`\n- `data.status`\n- `data.total`\n- `data.completed`\n- `data.failed`\n- `data.created_at`\n- `data.completed_at`\n- `data.total_credits_charged`\n- `data.total_billed_bytes`\n- `data.estimated_credits`\n- `data.webhook_url`\n\n### 422 — Validation error. Returned when `status` is not one of the documented values, or when `cursor` is not a cursor this endpoint issued.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
41
41
  },
42
42
  "api/bulk/listbulkscreenshots": {
43
43
  "title": "List bulk job items",
44
44
  "section": "API Reference",
45
- "body": "# List bulk job items\n\nReturns the bulk job's items, discriminated by `type`.\n\n**Downloading item artifacts.** For a `completed` item with a storage key,\n`image_url` (`type: screenshot`) and both `content_url` and `markdown_url`\n(`type: scrape`) are **pre-signed** URLs, minted fresh on every read of\nthis endpoint and valid for **600 seconds (10 minutes)** —\nthe same signing lifetime as `content_url` on `GET /v1/fetch/bulk/{id}`.\nDownload inside that window, or re-poll this endpoint for a fresh\nsignature.\n\n**When no signature is minted.** Three cases mint none: an item that is not\n`completed`, a `completed` item with no storage key, and a `completed` item\nwhose object could not be signed — during an object-storage outage, for\ninstance. In all three the item's stored value is returned unchanged: `null`\nwhile nothing has been stored, and otherwise a **private, unsigned**\nobject-storage URL that answers `401`. These fields are neither nulled nor\nflagged in that case, so treat an artifact URL as usable only once you have\ndownloaded it, and re-poll for a fresh signature otherwise.\n`artifact_warnings` and its `artifact_unavailable` code describe the sibling\n`artifacts` object on `type: scrape` items only — they say nothing about\n`image_url`, `content_url`, or `markdown_url`.\n\n**GET** `/v1/bulk/{id}/screenshots`\n\n## Parameters\n\n- `id` (path, string, required)\n- `cursor` (query, string) — Opaque per-type seek cursor returned by the preceding page. It is bound to this bulk id, this mixed recovery route, and the exact status filter; cross-scope cursors return 422.\n- `limit` (query, integer) — Maximum rows selected per requested item type; the 16-MiB response bound may stop sooner.\n- `status` (query, string) — Optional item-status filter. A cursor may be reused only with the same filter.\n\n## Responses\n\n### 200 — Successful response.\n- `bulk_id`\n- `total`\n- `next_cursor`\n- `has_more`\n- `job_counters`\n- `items`"
45
+ "body": "# List bulk job items\n\nReturns the bulk job's items, discriminated by `type`.\n\n**Downloading item artifacts.** For a `completed` item with a storage key,\n`image_url` (`type: screenshot`) and both `content_url` and `markdown_url`\n(`type: scrape`) are **pre-signed** URLs, minted fresh on every read of\nthis endpoint and valid for **600 seconds (10 minutes)** —\nthe same signing lifetime as `content_url` on `GET /v1/fetch/bulk/{id}`.\nDownload inside that window, or re-poll this endpoint for a fresh\nsignature.\n\n**When no signature is minted.** Three cases mint none: an item that is not\n`completed`, a `completed` item with no storage key, and a `completed` item\nwhose object could not be signed — during an object-storage outage, for\ninstance. In all three the item's stored value is returned unchanged: `null`\nwhile nothing has been stored, and otherwise a **private, unsigned**\nobject-storage URL that answers `401`. These fields are neither nulled nor\nflagged in that case, so treat an artifact URL as usable only once you have\ndownloaded it, and re-poll for a fresh signature otherwise.\n`artifact_warnings` and its `artifact_unavailable` code describe the sibling\n`artifacts` object on `type: scrape` items only — they say nothing about\n`image_url`, `content_url`, or `markdown_url`.\n\n**GET** `/v1/bulk/{id}/screenshots`\n\n## Parameters\n\n- `id` (path, string, required)\n- `cursor` (query, string) — Opaque per-type seek cursor returned by the preceding page. It is bound to this bulk id, this mixed recovery route, and the exact status filter; cross-scope cursors return 422.\n- `limit` (query, integer) — Maximum rows selected per requested item type; the 16-MiB response bound may stop sooner.\n- `status` (query, string) — Optional item-status filter. A cursor may be reused only with the same filter.\n\n## Responses\n\n### 200 — Successful response.\n- `bulk_id`\n- `total`\n- `next_cursor`\n- `has_more`\n- `job_counters`\n- `job_counters.total`\n- `job_counters.completed`\n- `job_counters.failed`\n- `items`\n- `items.type`\n- `items.id`\n- `items.status`\n- `items.url`\n- `items.credits_charged`\n- `items.billing`\n- `items.billing.raw_bytes`\n- `items.billing.factors`\n- `items.billing.factors.name`\n- `items.billing.factors.value`\n- `items.billing.factors.reason`\n- `items.billing.multiplier`\n- `items.billing.billed_bytes`\n- `items.error_code`\n- `items.error_message`\n- `items.created_at`\n- `items.completed_at`\n- `items.image_url`\n- `items.page_title`\n- `items.format`\n- `items.video_url`\n- `items.content_url`\n- `items.content_type`\n- `items.content_length`\n- `items.markdown`\n- `items.markdown_url`\n- `items.artifacts`\n- `items.artifacts.raw`\n- `items.artifacts.markdown`\n- `items.artifacts.links`\n- `items.artifacts.links.url`\n- `items.artifacts.links.text`\n- `items.artifacts.links.isInternal`\n- `items.artifacts.links.rel`\n- `items.artifacts.images`\n- `items.artifacts.images.url`\n- `items.artifacts.images.alt`\n- `items.artifacts.images.width`\n- `items.artifacts.images.height`\n- `items.artifacts.images.format`\n- `items.artifacts.images.score`\n- `items.artifact_warnings`\n- `items.artifact_warnings.code`\n- `items.artifact_warnings.message`\n- `items.artifact_warnings.element`\n- `items.terminal_outcome`"
46
46
  },
47
47
  "api/fetch": {
48
48
  "title": "Fetch",
@@ -57,22 +57,22 @@
57
57
  "api/fetch-bulk/createfetchbulk": {
58
58
  "title": "Bulk fetch URLs",
59
59
  "section": "API Reference",
60
- "body": "# Bulk fetch URLs\n\nEnqueues multiple URLs for HTTP fetching. Results delivered via webhook.\nDoes not support options that require page rendering (wait_for_selector, etc.).\nCompletion deliveries use `X-ByteKit-Event: bulk.completed` and the\n`BulkCompletedWebhook` contract: at most 500 complete items and 1 MiB,\nfollowed by cursor recovery through `GET /v1/fetch/bulk/{id}` whenever\n`recovery_required` is true.\n\n**Limits:** request bodies are guarded in a two-tier shape. A streamed body\nwith no `Content-Length` header is capped at 2 MB before your API key\nis checked; a body that declares `Content-Length` is instead bounded\nthere by a 20 MB fail-safe (not the real limit — see below), since\nthat branch reads nothing until your key is verified. Once your key\nis verified, a second check re-gates the body against your account's\nown `max_bulk_size` (at this endpoint's per-item override budget),\nwhich reaches 16.8 MB for the largest documented account. A\nstandard-plan account's effective ceiling is 2 MB; either tier's\noverrun returns a `400` with error code `request_too_large`.\n\n**POST** `/v1/fetch/bulk`\n\n## Request Body\n\n- `urls` (required)\n- `defaults`\n- `webhook_url` (required)\n- `webhook_secret`\n- `metadata`\n\n## Responses\n\n### 202 — Fetch bulk job accepted.\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n\n### 400 — Bad request. When a `url` (or item URL) fails strict validation the\nerror code is `invalid_url` and the `details` object contains:\n- `field` — the request field that failed (e.g. `\"url\"`)\n- `url` — the rejected value\n- `reason` — one of: `scheme_missing`, `scheme_unsupported`,\n `scheme_separator_typo`, `host_empty`, `host_invalid`,\n `host_blocked_private`, `host_blocked_loopback`, `host_too_long`,\n `host_unicode_not_punycode`, `userinfo_present`, `url_too_long`,\n `control_chars`, `not_a_url`\n- `status`\n- `error`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n\n### 422 — Validation error. `bulk_too_large` is returned when the item count\nexceeds the account plan's `max_bulk_size` cap (also surfaced as\n`max_bulk_size` on `GET /v1/account`).\n- `status`\n- `error`"
60
+ "body": "# Bulk fetch URLs\n\nEnqueues multiple URLs for HTTP fetching. Results delivered via webhook.\nDoes not support options that require page rendering (wait_for_selector, etc.).\nCompletion deliveries use `X-ByteKit-Event: bulk.completed` and the\n`BulkCompletedWebhook` contract: at most 500 complete items and 1 MiB,\nfollowed by cursor recovery through `GET /v1/fetch/bulk/{id}` whenever\n`recovery_required` is true.\n\n**Limits:** request bodies are guarded in a two-tier shape. A streamed body\nwith no `Content-Length` header is capped at 2 MB before your API key\nis checked; a body that declares `Content-Length` is instead bounded\nthere by a 20 MB fail-safe (not the real limit — see below), since\nthat branch reads nothing until your key is verified. Once your key\nis verified, a second check re-gates the body against your account's\nown `max_bulk_size` (at this endpoint's per-item override budget),\nwhich reaches 16.8 MB for the largest documented account. A\nstandard-plan account's effective ceiling is 2 MB; either tier's\noverrun returns a `400` with error code `request_too_large`.\n\n**POST** `/v1/fetch/bulk`\n\n## Request Body\n\n- `urls` (required)\n- `urls.url`\n- `urls.country`\n- `urls.cache_ttl`\n- `defaults`\n- `defaults.country`\n- `defaults.cache_ttl`\n- `webhook_url` (required)\n- `webhook_secret`\n- `metadata`\n\n## Responses\n\n### 202 — Fetch bulk job accepted.\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n\n### 400 — Bad request. When a `url` (or item URL) fails strict validation the\nerror code is `invalid_url` and the `details` object contains:\n- `field` — the request field that failed (e.g. `\"url\"`)\n- `url` — the rejected value\n- `reason` — one of: `scheme_missing`, `scheme_unsupported`,\n `scheme_separator_typo`, `host_empty`, `host_invalid`,\n `host_blocked_private`, `host_blocked_loopback`, `host_too_long`,\n `host_unicode_not_punycode`, `userinfo_present`, `url_too_long`,\n `control_chars`, `not_a_url`\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 422 — Validation error. `bulk_too_large` is returned when the item count\nexceeds the account plan's `max_bulk_size` cap (also surfaced as\n`max_bulk_size` on `GET /v1/account`).\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
61
61
  },
62
62
  "api/fetch-bulk/getfetchbulk": {
63
63
  "title": "Get fetch bulk job status",
64
64
  "section": "API Reference",
65
- "body": "# Get fetch bulk job status\n\nReturns the job envelope plus its per-URL items.\n\n**Downloading item content.** Each completed item's `content_url` is a\n**pre-signed** URL, minted fresh on every read of this endpoint and valid\nfor **600 seconds (10 minutes)** — the same signing lifetime as the\n`image_url` returned by `GET /v1/bulk/{id}/screenshots`. The underlying\nobjects are private, so an unsigned URL returns `401`: download the\ncontent inside that window, or re-poll this endpoint for a fresh\nsignature. Items that are not `completed`, and completed items with no\nstored object, or completed items whose object cannot be signed, carry\n`null`; the latter report `artifact_unavailable`. The private unsigned\nstorage URL is never returned.\n\n**GET** `/v1/fetch/bulk/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n- `cursor` (query, string) — Opaque cursor returned by the preceding page. It is bound to this bulk id, this recovery route, and the exact status filter; cross-scope cursors return 422.\n- `limit` (query, integer) — Maximum result rows considered for this page; the 16-MiB response bound may stop sooner.\n- `status` (query, string) — Optional item-status filter. A cursor may be reused only with the same filter.\n\n## Responses\n\n### 200 — Successful response.\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n- `next_cursor`\n- `has_more`\n- `items`\n\n### 202 — Bulk job still processing. The poll answers 200 for a job in\n`BULK_TERMINAL_STATUSES` (`completed`, `failed`, `cancelled`) and 202\notherwise, over an identical body, so this is the SAME envelope the 200\ndocuments — only the status code and the reachable `status` values\ndiffer. Keep polling until you get a 200; a **cancelled** job is served\n200, not 202 (issues #3533, #4754).\n\nItem `content_url` values are pre-signed exactly as on the 200 — a fresh\n600-second signature on every poll.\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n- `next_cursor`\n- `has_more`\n- `items`\n\n### 404 — Resource not found.\n- `status`\n- `error`"
65
+ "body": "# Get fetch bulk job status\n\nReturns the job envelope plus its per-URL items.\n\n**Downloading item content.** Each completed item's `content_url` is a\n**pre-signed** URL, minted fresh on every read of this endpoint and valid\nfor **600 seconds (10 minutes)** — the same signing lifetime as the\n`image_url` returned by `GET /v1/bulk/{id}/screenshots`. The underlying\nobjects are private, so an unsigned URL returns `401`: download the\ncontent inside that window, or re-poll this endpoint for a fresh\nsignature. Items that are not `completed`, and completed items with no\nstored object, or completed items whose object cannot be signed, carry\n`null`; the latter report `artifact_unavailable`. The private unsigned\nstorage URL is never returned.\n\n**GET** `/v1/fetch/bulk/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n- `cursor` (query, string) — Opaque cursor returned by the preceding page. It is bound to this bulk id, this recovery route, and the exact status filter; cross-scope cursors return 422.\n- `limit` (query, integer) — Maximum result rows considered for this page; the 16-MiB response bound may stop sooner.\n- `status` (query, string) — Optional item-status filter. A cursor may be reused only with the same filter.\n\n## Responses\n\n### 200 — Successful response.\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n- `next_cursor`\n- `has_more`\n- `items`\n- `items.id`\n- `items.url`\n- `items.status`\n- `items.content_type`\n- `items.content_length`\n- `items.content_url`\n- `items.waf_vendor`\n- `items.cache_hit`\n- `items.billing`\n- `items.billing.raw_bytes`\n- `items.billing.factors`\n- `items.billing.factors.name`\n- `items.billing.factors.value`\n- `items.billing.factors.reason`\n- `items.billing.multiplier`\n- `items.billing.billed_bytes`\n- `items.error_code`\n- `items.error_message`\n- `items.created_at`\n- `items.completed_at`\n- `items.type`\n- `items.terminal_outcome`\n\n### 202 — Bulk job still processing. The poll answers 200 for a job in\n`BULK_TERMINAL_STATUSES` (`completed`, `failed`, `cancelled`) and 202\notherwise, over an identical body, so this is the SAME envelope the 200\ndocuments — only the status code and the reachable `status` values\ndiffer. Keep polling until you get a 200; a **cancelled** job is served\n200, not 202 (issues #3533, #4754).\n\nItem `content_url` values are pre-signed exactly as on the 200 — a fresh\n600-second signature on every poll.\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n- `next_cursor`\n- `has_more`\n- `items`\n- `items.id`\n- `items.url`\n- `items.status`\n- `items.content_type`\n- `items.content_length`\n- `items.content_url`\n- `items.waf_vendor`\n- `items.cache_hit`\n- `items.billing`\n- `items.billing.raw_bytes`\n- `items.billing.factors`\n- `items.billing.factors.name`\n- `items.billing.factors.value`\n- `items.billing.factors.reason`\n- `items.billing.multiplier`\n- `items.billing.billed_bytes`\n- `items.error_code`\n- `items.error_message`\n- `items.created_at`\n- `items.completed_at`\n- `items.type`\n- `items.terminal_outcome`\n\n### 404 — Resource not found.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
66
66
  },
67
67
  "api/fetch/getfetch": {
68
68
  "title": "Fetch a URL (GET)",
69
69
  "section": "API Reference",
70
- "body": "# Fetch a URL (GET)\n\nDirect HTTP fetch. Successful responses return the upstream response bytes verbatim;\nmetadata is returned in X-Fetch-* headers. Non-2xx upstream responses use the\n`upstream_error` JSON envelope with the upstream HTTP status.\n\n**GET** `/v1/fetch`\n\n## Parameters\n\n- `url` (query, string, required)\n- `country` (query, string)\n- `timeout_ms` (query, integer)\n- `cache_ttl` (query) — How long a freshly fetched URL may be served from cache. `0` skips the cache read; cache-eligible fresh results are still written with the default 7-day TTL so later non-zero-TTL callers can HIT. Safety-classified WAF husks remain live-only and are not written. Accepts `Nh` (hours, up to 168h), `Nd` (days, up to 7d), or the integer `0`. Examples: `0`, `48h`, `2d`. Invalid values receive a 422 validation_error with an actionable message.\n\n## Responses\n\n### 200 — Content from upstream.\n\n### 400 — Invalid URL (`invalid_url`) or oversized request.\n- `status`\n- `error`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n\n### 422 — Validation error (e.g. slow-path-only field), or a fetch that failed for a\ntarget-side reason.\n\nTwo distinct conditions answer `422`. Read `error.code` to tell them apart.\n\n- **`validation_error`** — the request itself was rejected.\n- **`blocked`** or **`upstream_error`** — the fetch ran and the target could not\n be read. `blocked` means the target's bot protection refused every attempt;\n `upstream_error` (message `Failed to fetch URL.`) is any other exhausted-retries\n failure, such as a host that does not resolve. This is a result about the URL,\n not an outage of this API, so it is a `4xx` rather than `502` or `503`. No\n upstream HTTP status was received, so `error.http_status` reports `422`,\n mirroring what was served — unlike the relayed `upstream_error` under `502`\n below, whose status is the target's own. The request transfers no billable\n bytes and is charged nothing (#4669).\n- `status`\n- `error`\n\n### 429 — Rate limit (`rate_limited`) or concurrency limit (`concurrency_limit`) exceeded. Carries a `Retry-After` header — seconds derived from the same clock as `X-RateLimit-Reset` for the rate-limit variant, a fixed small back-off for the concurrency variant.\n- `status`\n- `error`\n\n### 503 — Two distinct conditions answer `503`, and they disagree about what the body's\n`error.http_status` reports. Read `error.code` to tell them apart.\n\n- **`upstream_error`** — the target returned HTTP `502` or `504`, relayed here as\n `503`. Cloudflare fronts this API and replaces a clean origin 502 or 504 with its\n own generic `text/plain` error page, discarding the envelope before it reaches\n you, while a 503 is passed through unchanged. The body's `error.http_status`\n still reports the **true upstream status**, `502` or `504` — not `503` — and is\n the only surviving record of what the target answered, so the body rather than\n the HTTP status is authoritative here (#3355, #4891). Every other non-2xx\n upstream response is relayed at its own HTTP status with the same\n `upstream_error` envelope, so any other 4xx/5xx the target returns surfaces as an\n Error envelope rather than a raw body (#1462).\n- **`internal_error`** (message `Fetch service unavailable.`) — no fetch service\n endpoint could be resolved on this deployment, a fault of this API and not of the\n target. There is no upstream status to preserve: the `503` is this API's own\n choice of wire status, so the body's `error.http_status` reports `503`, mirroring\n what was served (#3373). A fetch that ran and failed for a target-side reason\n answers `422` instead (#4669).\n- `status`\n- `error`"
70
+ "body": "# Fetch a URL (GET)\n\nDirect HTTP fetch. Successful responses return the upstream response bytes verbatim;\nmetadata is returned in X-Fetch-* headers. Non-2xx upstream responses use the\n`upstream_error` JSON envelope with the upstream HTTP status.\n\n**GET** `/v1/fetch`\n\n## Parameters\n\n- `url` (query, string, required)\n- `country` (query, string)\n- `timeout_ms` (query, integer)\n- `cache_ttl` (query) — How long a freshly fetched URL may be served from cache. `0` skips the cache read; cache-eligible fresh results are still written with the default 7-day TTL so later non-zero-TTL callers can HIT. Safety-classified WAF husks remain live-only and are not written. Accepts `Nh` (hours, up to 168h), `Nd` (days, up to 7d), or the integer `0`. Examples: `0`, `48h`, `2d`. Invalid values receive a 422 validation_error with an actionable message.\n\n## Responses\n\n### 200 — Content from upstream.\n\n### 400 — Invalid URL (`invalid_url`) or oversized request.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 422 — Validation error (e.g. slow-path-only field), or a fetch that failed for a\ntarget-side reason.\n\nTwo distinct conditions answer `422`. Read `error.code` to tell them apart.\n\n- **`validation_error`** — the request itself was rejected.\n- **`blocked`** or **`upstream_error`** — the fetch ran and the target could not\n be read. `blocked` means the target's bot protection refused every attempt;\n `upstream_error` (message `Failed to fetch URL.`) is any other exhausted-retries\n failure, such as a host that does not resolve. This is a result about the URL,\n not an outage of this API, so it is a `4xx` rather than `502` or `503`. No\n upstream HTTP status was received, so `error.http_status` reports `422`,\n mirroring what was served — unlike the relayed `upstream_error` under `502`\n below, whose status is the target's own. The request transfers no billable\n bytes and is charged nothing (#4669).\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 429 — Rate limit (`rate_limited`) or concurrency limit (`concurrency_limit`) exceeded. Carries a `Retry-After` header — seconds derived from the same clock as `X-RateLimit-Reset` for the rate-limit variant, a fixed small back-off for the concurrency variant.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 503 — Two distinct conditions answer `503`, and they disagree about what the body's\n`error.http_status` reports. Read `error.code` to tell them apart.\n\n- **`upstream_error`** — the target returned HTTP `502` or `504`, relayed here as\n `503`. Cloudflare fronts this API and replaces a clean origin 502 or 504 with its\n own generic `text/plain` error page, discarding the envelope before it reaches\n you, while a 503 is passed through unchanged. The body's `error.http_status`\n still reports the **true upstream status**, `502` or `504` — not `503` — and is\n the only surviving record of what the target answered, so the body rather than\n the HTTP status is authoritative here (#3355, #4891). Every other non-2xx\n upstream response is relayed at its own HTTP status with the same\n `upstream_error` envelope, so any other 4xx/5xx the target returns surfaces as an\n Error envelope rather than a raw body (#1462).\n- **`internal_error`** (message `Fetch service unavailable.`) — no fetch service\n endpoint could be resolved on this deployment, a fault of this API and not of the\n target. There is no upstream status to preserve: the `503` is this API's own\n choice of wire status, so the body's `error.http_status` reports `503`, mirroring\n what was served (#3373). A fetch that ran and failed for a target-side reason\n answers `422` instead (#4669).\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
71
71
  },
72
72
  "api/fetch/postfetch": {
73
73
  "title": "Fetch a URL (POST)",
74
74
  "section": "API Reference",
75
- "body": "# Fetch a URL (POST)\n\nSame as GET /v1/fetch but with a JSON request body.\n\n**Limits:** request bodies are capped at 512 KB. An oversized body\nreturns a `400` with error code `request_too_large`.\n\n**POST** `/v1/fetch`\n\n## Request Body\n\n- `url` (required)\n- `country`\n- `timeout_ms`\n- `cache_ttl`\n- `custom`\n\n## Responses\n\n### 200 — Content from upstream.\n\n### 400 — Invalid URL (`invalid_url`) or oversized request body.\n- `status`\n- `error`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n\n### 422 — Validation error (e.g. malformed JSON, unsupported fetch format, or slow-path-only\nfield), or a fetch that failed for a target-side reason.\n\nTwo distinct conditions answer `422`. Read `error.code` to tell them apart.\n\n- **`validation_error`** — the request itself was rejected.\n- **`blocked`** or **`upstream_error`** — the fetch ran and the target could not\n be read. `blocked` means the target's bot protection refused every attempt;\n `upstream_error` (message `Failed to fetch URL.`) is any other exhausted-retries\n failure, such as a host that does not resolve. This is a result about the URL,\n not an outage of this API, so it is a `4xx` rather than `502` or `503`. No\n upstream HTTP status was received, so `error.http_status` reports `422`,\n mirroring what was served — unlike the relayed `upstream_error` under `502`\n below, whose status is the target's own. The request transfers no billable\n bytes and is charged nothing (#4669).\n- `status`\n- `error`\n\n### 429 — Rate limit (`rate_limited`) or concurrency limit (`concurrency_limit`) exceeded. Carries a `Retry-After` header — seconds derived from the same clock as `X-RateLimit-Reset` for the rate-limit variant, a fixed small back-off for the concurrency variant.\n- `status`\n- `error`\n\n### 503 — Two distinct conditions answer `503`, and they disagree about what the body's\n`error.http_status` reports. Read `error.code` to tell them apart.\n\n- **`upstream_error`** — the target returned HTTP `502` or `504`, relayed here as\n `503`. Cloudflare fronts this API and replaces a clean origin 502 or 504 with its\n own generic `text/plain` error page, discarding the envelope before it reaches\n you, while a 503 is passed through unchanged. The body's `error.http_status`\n still reports the **true upstream status**, `502` or `504` — not `503` — and is\n the only surviving record of what the target answered, so the body rather than\n the HTTP status is authoritative here (#3355, #4891). Every other non-2xx\n upstream response is relayed at its own HTTP status with the same\n `upstream_error` envelope, so any other 4xx/5xx the target returns surfaces as an\n Error envelope rather than a raw body (#1462).\n- **`internal_error`** (message `Fetch service unavailable.`) — no fetch service\n endpoint could be resolved on this deployment, a fault of this API and not of the\n target. There is no upstream status to preserve: the `503` is this API's own\n choice of wire status, so the body's `error.http_status` reports `503`, mirroring\n what was served (#3373). A fetch that ran and failed for a target-side reason\n answers `422` instead (#4669).\n- `status`\n- `error`"
75
+ "body": "# Fetch a URL (POST)\n\nSame as GET /v1/fetch but with a JSON request body.\n\n**Limits:** request bodies are capped at 512 KB. An oversized body\nreturns a `400` with error code `request_too_large`.\n\n**POST** `/v1/fetch`\n\n## Request Body\n\n- `url` (required)\n- `country`\n- `timeout_ms`\n- `cache_ttl`\n- `custom`\n\n## Responses\n\n### 200 — Content from upstream.\n\n### 400 — Invalid URL (`invalid_url`) or oversized request body.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 422 — Validation error (e.g. malformed JSON, unsupported fetch format, or slow-path-only\nfield), or a fetch that failed for a target-side reason.\n\nTwo distinct conditions answer `422`. Read `error.code` to tell them apart.\n\n- **`validation_error`** — the request itself was rejected.\n- **`blocked`** or **`upstream_error`** — the fetch ran and the target could not\n be read. `blocked` means the target's bot protection refused every attempt;\n `upstream_error` (message `Failed to fetch URL.`) is any other exhausted-retries\n failure, such as a host that does not resolve. This is a result about the URL,\n not an outage of this API, so it is a `4xx` rather than `502` or `503`. No\n upstream HTTP status was received, so `error.http_status` reports `422`,\n mirroring what was served — unlike the relayed `upstream_error` under `502`\n below, whose status is the target's own. The request transfers no billable\n bytes and is charged nothing (#4669).\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 429 — Rate limit (`rate_limited`) or concurrency limit (`concurrency_limit`) exceeded. Carries a `Retry-After` header — seconds derived from the same clock as `X-RateLimit-Reset` for the rate-limit variant, a fixed small back-off for the concurrency variant.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 503 — Two distinct conditions answer `503`, and they disagree about what the body's\n`error.http_status` reports. Read `error.code` to tell them apart.\n\n- **`upstream_error`** — the target returned HTTP `502` or `504`, relayed here as\n `503`. Cloudflare fronts this API and replaces a clean origin 502 or 504 with its\n own generic `text/plain` error page, discarding the envelope before it reaches\n you, while a 503 is passed through unchanged. The body's `error.http_status`\n still reports the **true upstream status**, `502` or `504` — not `503` — and is\n the only surviving record of what the target answered, so the body rather than\n the HTTP status is authoritative here (#3355, #4891). Every other non-2xx\n upstream response is relayed at its own HTTP status with the same\n `upstream_error` envelope, so any other 4xx/5xx the target returns surfaces as an\n Error envelope rather than a raw body (#1462).\n- **`internal_error`** (message `Fetch service unavailable.`) — no fetch service\n endpoint could be resolved on this deployment, a fault of this API and not of the\n target. There is no upstream status to preserve: the `503` is this API's own\n choice of wire status, so the body's `error.http_status` reports `503`, mirroring\n what was served (#3373). A fetch that ran and failed for a target-side reason\n answers `422` instead (#4669).\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
76
76
  },
77
77
  "api/health": {
78
78
  "title": "Health",
@@ -92,32 +92,32 @@
92
92
  "api/monitors/createmonitor": {
93
93
  "title": "Create a change-detection monitor",
94
94
  "section": "API Reference",
95
- "body": "# Create a change-detection monitor\n\nCreates a recurring change-detection monitor for a URL, delivering results via webhook.\n\n**Limits:** request bodies are capped at 512 KB. An oversized body\nreturns a `400` with error code `request_too_large`.\n\n**POST** `/v1/monitors`\n\n## Request Body\n\n- `url` (required)\n- `type`\n- `interval_type` (required)\n- `cron_expression`\n- `change_threshold`\n- `notify_on`\n- `webhook_url` (required)\n- `webhook_secret`\n- `webhook_headers`\n- `options`\n- `scrape_options`\n- `metadata`\n\n## Responses\n\n### 201 — Monitor created.\n- `id`\n- `type`\n- `url`\n- `status`\n- `interval_type`\n- `cron_expression`\n- `next_capture_at`\n- `notify_on`\n- `webhook_url`\n- `webhook_headers`\n- `change_threshold`\n- `scrape_options`\n- `last_content_hash`\n- `captures_count`\n- `changes_count`\n- `skipped_captures`\n- `last_captured_at`\n- `last_changed_at`\n- `consecutive_failures`\n- `last_error_code`\n- `suspension_reason`\n- `metadata`\n- `created_at`\n- `updated_at`\n- `cancelled_at`\n- `webhook_secret`\n\n### 400 — Bad request. When the `url` (or `webhook_url`) field fails strict\nvalidation the error code is `invalid_url` and the `details` object\ncontains:\n- `field` — the request field that failed (e.g. `\"url\"`)\n- `url` — the rejected value\n- `reason` — one of: `scheme_missing`, `scheme_unsupported`,\n `scheme_separator_typo`, `host_empty`, `host_invalid`,\n `host_blocked_private`, `host_blocked_loopback`, `host_too_long`,\n `host_unicode_not_punycode`, `userinfo_present`, `url_too_long`,\n `control_chars`, `not_a_url`\n- `status`\n- `error`\n\n### 409 — Duplicate monitor for this URL.\n- `status`\n- `error`\n\n### 422 — Validation error.\n- `status`\n- `error`"
95
+ "body": "# Create a change-detection monitor\n\nCreates a recurring change-detection monitor for a URL, delivering results via webhook.\n\n**Limits:** request bodies are capped at 512 KB. An oversized body\nreturns a `400` with error code `request_too_large`.\n\n**POST** `/v1/monitors`\n\n## Request Body\n\n- `url` (required)\n- `type`\n- `interval_type` (required)\n- `cron_expression`\n- `change_threshold`\n- `notify_on`\n- `webhook_url` (required)\n- `webhook_secret`\n- `webhook_headers`\n- `options`\n- `scrape_options`\n- `metadata`\n\n## Responses\n\n### 201 — Monitor created.\n- `id`\n- `type`\n- `url`\n- `status`\n- `interval_type`\n- `cron_expression`\n- `next_capture_at`\n- `notify_on`\n- `webhook_url`\n- `webhook_headers`\n- `change_threshold`\n- `scrape_options`\n- `last_content_hash`\n- `captures_count`\n- `changes_count`\n- `skipped_captures`\n- `last_captured_at`\n- `last_changed_at`\n- `consecutive_failures`\n- `last_error_code`\n- `suspension_reason`\n- `metadata`\n- `created_at`\n- `updated_at`\n- `cancelled_at`\n- `webhook_secret`\n\n### 400 — Bad request. When the `url` (or `webhook_url`) field fails strict\nvalidation the error code is `invalid_url` and the `details` object\ncontains:\n- `field` — the request field that failed (e.g. `\"url\"`)\n- `url` — the rejected value\n- `reason` — one of: `scheme_missing`, `scheme_unsupported`,\n `scheme_separator_typo`, `host_empty`, `host_invalid`,\n `host_blocked_private`, `host_blocked_loopback`, `host_too_long`,\n `host_unicode_not_punycode`, `userinfo_present`, `url_too_long`,\n `control_chars`, `not_a_url`\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 409 — Duplicate monitor for this URL.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 422 — Validation error.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
96
96
  },
97
97
  "api/monitors/deletemonitor": {
98
98
  "title": "Cancel monitor",
99
99
  "section": "API Reference",
100
- "body": "# Cancel monitor\n\n**DELETE** `/v1/monitors/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Responses\n\n### 204 — Monitor cancelled.\n\n### 404 — Resource not found.\n- `status`\n- `error`"
100
+ "body": "# Cancel monitor\n\n**DELETE** `/v1/monitors/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Responses\n\n### 204 — Monitor cancelled.\n\n### 404 — Resource not found.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
101
101
  },
102
102
  "api/monitors/getmonitor": {
103
103
  "title": "Get monitor",
104
104
  "section": "API Reference",
105
- "body": "# Get monitor\n\n**GET** `/v1/monitors/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Responses\n\n### 200 — Successful response.\n- `id`\n- `type`\n- `url`\n- `status`\n- `interval_type`\n- `cron_expression`\n- `next_capture_at`\n- `notify_on`\n- `webhook_url`\n- `webhook_headers`\n- `change_threshold`\n- `scrape_options`\n- `last_content_hash`\n- `captures_count`\n- `changes_count`\n- `skipped_captures`\n- `last_captured_at`\n- `last_changed_at`\n- `consecutive_failures`\n- `last_error_code`\n- `suspension_reason`\n- `metadata`\n- `created_at`\n- `updated_at`\n- `cancelled_at`\n\n### 404 — Resource not found.\n- `status`\n- `error`"
105
+ "body": "# Get monitor\n\n**GET** `/v1/monitors/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Responses\n\n### 200 — Successful response.\n- `id`\n- `type`\n- `url`\n- `status`\n- `interval_type`\n- `cron_expression`\n- `next_capture_at`\n- `notify_on`\n- `webhook_url`\n- `webhook_headers`\n- `change_threshold`\n- `scrape_options`\n- `last_content_hash`\n- `captures_count`\n- `changes_count`\n- `skipped_captures`\n- `last_captured_at`\n- `last_changed_at`\n- `consecutive_failures`\n- `last_error_code`\n- `suspension_reason`\n- `metadata`\n- `created_at`\n- `updated_at`\n- `cancelled_at`\n\n### 404 — Resource not found.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
106
106
  },
107
107
  "api/monitors/listmonitorcaptures": {
108
108
  "title": "List monitor captures",
109
109
  "section": "API Reference",
110
- "body": "# List monitor captures\n\n**GET** `/v1/monitors/{id}/captures`\n\n## Parameters\n\n- `id` (path, string, required)\n- `limit` (query, integer)\n- `cursor` (query, string) — Pagination cursor from a previous response.\n\n## Responses\n\n### 200 — Successful response.\n- `data`\n- `next_cursor`\n- `has_more`"
110
+ "body": "# List monitor captures\n\n**GET** `/v1/monitors/{id}/captures`\n\n## Parameters\n\n- `id` (path, string, required)\n- `limit` (query, integer)\n- `cursor` (query, string) — Pagination cursor from a previous response.\n\n## Responses\n\n### 200 — Successful response.\n- `data`\n- `data.id`\n- `data.monitor_id`\n- `data.screenshot_id`\n- `data.scrape_id`\n- `data.image_url`\n- `data.content_hash`\n- `data.previous_hash`\n- `data.hash_distance`\n- `data.change_pct`\n- `data.has_change`\n- `data.title_changed`\n- `data.outcome`\n- `data.captured_at`\n- `next_cursor`\n- `has_more`"
111
111
  },
112
112
  "api/monitors/listmonitors": {
113
113
  "title": "List monitors",
114
114
  "section": "API Reference",
115
- "body": "# List monitors\n\n**GET** `/v1/monitors`\n\n## Parameters\n\n- `limit` (query, integer)\n- `cursor` (query, string) — Pagination cursor from a previous response.\n- `status` (query, string)\n\n## Responses\n\n### 200 — Successful response.\n- `data`\n- `next_cursor`\n- `has_more`"
115
+ "body": "# List monitors\n\n**GET** `/v1/monitors`\n\n## Parameters\n\n- `limit` (query, integer)\n- `cursor` (query, string) — Pagination cursor from a previous response.\n- `status` (query, string)\n\n## Responses\n\n### 200 — Successful response.\n- `data`\n- `data.id`\n- `data.type`\n- `data.url`\n- `data.status`\n- `data.interval_type`\n- `data.cron_expression`\n- `data.next_capture_at`\n- `data.notify_on`\n- `data.webhook_url`\n- `data.webhook_headers`\n- `data.change_threshold`\n- `data.scrape_options`\n- `data.last_content_hash`\n- `data.captures_count`\n- `data.changes_count`\n- `data.skipped_captures`\n- `data.last_captured_at`\n- `data.last_changed_at`\n- `data.consecutive_failures`\n- `data.last_error_code`\n- `data.suspension_reason`\n- `data.metadata`\n- `data.created_at`\n- `data.updated_at`\n- `data.cancelled_at`\n- `next_cursor`\n- `has_more`"
116
116
  },
117
117
  "api/monitors/updatemonitor": {
118
118
  "title": "Update monitor",
119
119
  "section": "API Reference",
120
- "body": "# Update monitor\n\n**PATCH** `/v1/monitors/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Request Body\n\n- `url`\n- `interval_type`\n- `cron_expression`\n- `change_threshold`\n- `notify_on`\n- `webhook_url`\n- `webhook_secret`\n- `webhook_headers`\n- `status`\n- `options`\n- `scrape_options`\n- `metadata`\n\n## Responses\n\n### 200 — Successful response.\n- `id`\n- `type`\n- `url`\n- `status`\n- `interval_type`\n- `cron_expression`\n- `next_capture_at`\n- `notify_on`\n- `webhook_url`\n- `webhook_headers`\n- `change_threshold`\n- `scrape_options`\n- `last_content_hash`\n- `captures_count`\n- `changes_count`\n- `skipped_captures`\n- `last_captured_at`\n- `last_changed_at`\n- `consecutive_failures`\n- `last_error_code`\n- `suspension_reason`\n- `metadata`\n- `created_at`\n- `updated_at`\n- `cancelled_at`\n\n### 400 — Bad request. When the `url` (or `webhook_url`) field fails strict\nvalidation the error code is `invalid_url` and the `details` object\ncontains:\n- `field` — the request field that failed (e.g. `\"url\"`)\n- `url` — the rejected value\n- `reason` — one of: `scheme_missing`, `scheme_unsupported`,\n `scheme_separator_typo`, `host_empty`, `host_invalid`,\n `host_blocked_private`, `host_blocked_loopback`, `host_too_long`,\n `host_unicode_not_punycode`, `userinfo_present`, `url_too_long`,\n `control_chars`, `not_a_url`\n- `status`\n- `error`\n\n### 404 — Resource not found.\n- `status`\n- `error`\n\n### 409 — Duplicate URL.\n- `status`\n- `error`\n\n### 422 — Validation error.\n- `status`\n- `error`"
120
+ "body": "# Update monitor\n\n**PATCH** `/v1/monitors/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Request Body\n\n- `url`\n- `interval_type`\n- `cron_expression`\n- `change_threshold`\n- `notify_on`\n- `webhook_url`\n- `webhook_secret`\n- `webhook_headers`\n- `status`\n- `options`\n- `scrape_options`\n- `metadata`\n\n## Responses\n\n### 200 — Successful response.\n- `id`\n- `type`\n- `url`\n- `status`\n- `interval_type`\n- `cron_expression`\n- `next_capture_at`\n- `notify_on`\n- `webhook_url`\n- `webhook_headers`\n- `change_threshold`\n- `scrape_options`\n- `last_content_hash`\n- `captures_count`\n- `changes_count`\n- `skipped_captures`\n- `last_captured_at`\n- `last_changed_at`\n- `consecutive_failures`\n- `last_error_code`\n- `suspension_reason`\n- `metadata`\n- `created_at`\n- `updated_at`\n- `cancelled_at`\n\n### 400 — Bad request. When the `url` (or `webhook_url`) field fails strict\nvalidation the error code is `invalid_url` and the `details` object\ncontains:\n- `field` — the request field that failed (e.g. `\"url\"`)\n- `url` — the rejected value\n- `reason` — one of: `scheme_missing`, `scheme_unsupported`,\n `scheme_separator_typo`, `host_empty`, `host_invalid`,\n `host_blocked_private`, `host_blocked_loopback`, `host_too_long`,\n `host_unicode_not_punycode`, `userinfo_present`, `url_too_long`,\n `control_chars`, `not_a_url`\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 404 — Resource not found.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 409 — Duplicate URL.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 422 — Validation error.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
121
121
  },
122
122
  "api/plans": {
123
123
  "title": "Plans",
@@ -127,7 +127,7 @@
127
127
  "api/plans/listplans": {
128
128
  "title": "List public plan catalog",
129
129
  "section": "API Reference",
130
- "body": "# List public plan catalog\n\nReturns the catalog of public plans (`is_custom = false`) as the\npricing source-of-truth for the dashboard and marketing site. Custom\ncontract plans are excluded. Unauthenticated — this is catalog data,\nnot per-account state (per-account plan lives on `GET /v1/account`).\n\n**GET** `/v1/plans`\n\n## Responses\n\n### 200 — The public plan catalog.\n- `plans`"
130
+ "body": "# List public plan catalog\n\nReturns the catalog of public plans (`is_custom = false`) as the\npricing source-of-truth for the dashboard and marketing site. Custom\ncontract plans are excluded. Unauthenticated — this is catalog data,\nnot per-account state (per-account plan lives on `GET /v1/account`).\n\n**GET** `/v1/plans`\n\n## Responses\n\n### 200 — The public plan catalog.\n- `plans`\n- `plans.id`\n- `plans.slug`\n- `plans.name`\n- `plans.price_cents`\n- `plans.included_bytes`\n- `plans.included_credits`\n- `plans.topup_price_per_mb_cents`\n- `plans.credit_topup_price_per_k_cents`\n- `plans.max_concurrency`\n- `plans.rate_limit_per_sec`\n- `plans.is_custom`"
131
131
  },
132
132
  "api/schema": {
133
133
  "title": "Schema",
@@ -137,7 +137,7 @@
137
137
  "api/schema/createschemaextraction": {
138
138
  "title": "Schema-driven structured extraction",
139
139
  "section": "API Reference",
140
- "body": "# Schema-driven structured extraction\n\nFetches `url` and extracts structured JSON conforming to the supplied\nJSON Schema (draft 2020-12) using an LLM. Fast-path only — slow-path\nrendering options (`wait_until=networkidle`, `delay_ms`,\n`wait_for_selector`) cause a `400 unsupported_option`.\n\nDual-axis billing: a fixed per-request credit charge **plus** the\nunderlying page's bandwidth, billed at its upstream wire bytes with no\nendpoint factor (a 100 KiB estimate is pre-charged, then reconciled). The\nbandwidth is still billed when the scrape succeeds but extraction later\nfails; both axes are refunded only when the scrape itself never runs.\n\nAvailability is gated by a server-side feature flag; when disabled the\nendpoint returns `404`.\n\n**POST** `/v1/schema`\n\n## Request Body\n\n- `url` (required)\n- `schema` (required)\n- `prompt`\n- `model`\n- `wait_for_selector`\n- `wait_until`\n- `delay_ms`\n- `country`\n- `language`\n\n## Responses\n\n### 200 — Extraction completed (success or graceful extract failure).\n- `data`\n- `model`\n- `validated`\n- `metrics`\n- `scrape`\n- `warnings`\n\n### 400 — Invalid URL (`invalid_url`), unsupported model (`unsupported_model`), or unsupported slow-path option (`unsupported_option`).\n- `status`\n- `error`\n\n### 401 — Missing or invalid bearer key.\n- `status`\n- `error`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n\n### 404 — Endpoint not available (feature flag disabled).\n- `status`\n- `error`\n\n### 422 — Validation error (`validation_error`) or non-normalizable schema (`schema_incompatible`).\n- `status`\n- `error`\n\n### 429 — Per-account rate limit (`rate_limited`) or upstream provider rate limit (`provider_rate_limited`); a `Retry-After` header may be present.\n- `status`\n- `error`\n\n### 503 — Read `error.code` to tell the conditions apart: underlying scrape failed or the\nextraction service was unreachable (`scrape_failed`), upstream provider error\n(`provider_error`), extraction provider unconfigured (`provider_unavailable`), or\nupstream provider timed out (`provider_timeout`). None of these answers `502` or\n`504`: Cloudflare fronts this API and replaces an origin 502 or 504 with its own\n`text/plain` page, discarding the error envelope, while a 503 passes through\nunchanged (#4891).\n- `status`\n- `error`"
140
+ "body": "# Schema-driven structured extraction\n\nFetches `url` and extracts structured JSON conforming to the supplied\nJSON Schema (draft 2020-12) using an LLM. Fast-path only — slow-path\nrendering options (`wait_until=networkidle`, `delay_ms`,\n`wait_for_selector`) cause a `400 unsupported_option`.\n\nDual-axis billing: a fixed per-request credit charge **plus** the\nunderlying page's bandwidth, billed at its upstream wire bytes with no\nendpoint factor (a 100 KiB estimate is pre-charged, then reconciled). The\nbandwidth is still billed when the scrape succeeds but extraction later\nfails; both axes are refunded only when the scrape itself never runs.\n\n**POST** `/v1/schema`\n\n## Request Body\n\n- `url` (required)\n- `schema` (required)\n- `prompt`\n- `model`\n- `wait_for_selector`\n- `wait_until`\n- `delay_ms`\n- `country`\n- `language`\n\n## Responses\n\n### 200 — Extraction completed (success or graceful extract failure).\n- `data`\n- `model`\n- `validated`\n- `metrics`\n- `metrics.scrape_ms`\n- `metrics.llm_total_ms`\n- `metrics.input_tokens`\n- `metrics.output_tokens`\n- `metrics.retries`\n- `metrics.total_ms`\n- `scrape`\n- `scrape.url`\n- `scrape.status_code`\n- `scrape.content_length`\n- `scrape.truncated`\n- `warnings`\n\n### 400 — Invalid URL (`invalid_url`), unsupported model (`unsupported_model`), or unsupported slow-path option (`unsupported_option`).\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 401 — Missing or invalid bearer key.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 422 — Validation error (`validation_error`) or non-normalizable schema (`schema_incompatible`).\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 429 — Per-account rate limit (`rate_limited`) or upstream provider rate limit (`provider_rate_limited`); a `Retry-After` header may be present.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 503 — Read `error.code` to tell the conditions apart: underlying scrape failed or the\nextraction service was unreachable (`scrape_failed`), upstream provider error\n(`provider_error`), extraction provider unconfigured (`provider_unavailable`), or\nupstream provider timed out (`provider_timeout`). None of these answers `502` or\n`504`: Cloudflare fronts this API and replaces an origin 502 or 504 with its own\n`text/plain` page, discarding the error envelope, while a 503 passes through\nunchanged (#4891).\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
141
141
  },
142
142
  "api/scrape": {
143
143
  "title": "Scrape",
@@ -152,22 +152,22 @@
152
152
  "api/scrape-bulk/createscrapebulk": {
153
153
  "title": "Bulk scrape URLs",
154
154
  "section": "API Reference",
155
- "body": "# Bulk scrape URLs\n\nEnqueues multiple URLs for scraping. Results delivered via webhook.\nCompletion deliveries use `X-ByteKit-Event: bulk.completed` and the\n`BulkCompletedWebhook` contract: at most 500 complete items and 1 MiB,\nfollowed by cursor recovery through `GET /v1/scrape/bulk/{id}` whenever\n`recovery_required` is true.\n\n**POST** `/v1/scrape/bulk`\n\n## Request Body\n\n- `urls`\n- `items`\n- `defaults`\n- `webhook_url` (required)\n- `webhook_secret`\n- `metadata`\n- `custom`\n\n## Responses\n\n### 202 — Bulk scrape job accepted.\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n\n### 400 — Bad request. When a `url` (or item URL) fails strict validation the\nerror code is `invalid_url` and the `details` object contains:\n- `field` — the request field that failed (e.g. `\"url\"`)\n- `url` — the rejected value\n- `reason` — one of: `scheme_missing`, `scheme_unsupported`,\n `scheme_separator_typo`, `host_empty`, `host_invalid`,\n `host_blocked_private`, `host_blocked_loopback`, `host_too_long`,\n `host_unicode_not_punycode`, `userinfo_present`, `url_too_long`,\n `control_chars`, `not_a_url`\n- `status`\n- `error`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n\n### 422 — Validation error. `bulk_too_large` is returned when the item count\nexceeds the account plan's `max_bulk_size` cap (also surfaced as\n`max_bulk_size` on `GET /v1/account`).\n- `status`\n- `error`"
155
+ "body": "# Bulk scrape URLs\n\nEnqueues multiple URLs for scraping. Results delivered via webhook.\nCompletion deliveries use `X-ByteKit-Event: bulk.completed` and the\n`BulkCompletedWebhook` contract: at most 500 complete items and 1 MiB,\nfollowed by cursor recovery through `GET /v1/scrape/bulk/{id}` whenever\n`recovery_required` is true.\n\n**POST** `/v1/scrape/bulk`\n\n## Request Body\n\n- `urls`\n- `items`\n- `items.url`\n- `items.formats`\n- `items.country`\n- `items.delay_ms`\n- `items.timeout_ms`\n- `items.metadata`\n- `items.clean_markdown`\n- `items.custom`\n- `defaults`\n- `defaults.formats`\n- `defaults.country`\n- `defaults.delay_ms`\n- `defaults.timeout_ms`\n- `defaults.clean_markdown`\n- `webhook_url` (required)\n- `webhook_secret`\n- `metadata`\n- `custom`\n\n## Responses\n\n### 202 — Bulk scrape job accepted.\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n\n### 400 — Bad request. When a `url` (or item URL) fails strict validation the\nerror code is `invalid_url` and the `details` object contains:\n- `field` — the request field that failed (e.g. `\"url\"`)\n- `url` — the rejected value\n- `reason` — one of: `scheme_missing`, `scheme_unsupported`,\n `scheme_separator_typo`, `host_empty`, `host_invalid`,\n `host_blocked_private`, `host_blocked_loopback`, `host_too_long`,\n `host_unicode_not_punycode`, `userinfo_present`, `url_too_long`,\n `control_chars`, `not_a_url`\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 422 — Validation error. `bulk_too_large` is returned when the item count\nexceeds the account plan's `max_bulk_size` cap (also surfaced as\n`max_bulk_size` on `GET /v1/account`).\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
156
156
  },
157
157
  "api/scrape-bulk/getscrapebulk": {
158
158
  "title": "Get scrape bulk job status",
159
159
  "section": "API Reference",
160
- "body": "# Get scrape bulk job status\n\nReturns the job envelope plus its rehydrated per-URL scrape envelopes.\n\n**Downloading item content.** A `raw` or `markdown` artifact within the\n10-MiB inline cap is returned inline. An oversized one is replaced by a\n**pre-signed** URL, minted fresh on every read of this endpoint and valid\nfor **86400 seconds (24 hours)**. The underlying objects are private, so an\nunsigned URL returns `401`: download the content inside that window, or\nre-poll this endpoint for a fresh signature. An artifact that was never\nstored, or whose object cannot be signed, is omitted from `formats` and\nreported as `artifact_unavailable` in `warnings`. The private unsigned\nstorage URL is never returned.\n\n**GET** `/v1/scrape/bulk/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n- `cursor` (query, string) — Opaque cursor returned by the preceding page. It is bound to this bulk id, this recovery route, and the exact status filter; cross-scope cursors return 422.\n- `limit` (query, integer) — Maximum result rows considered for this page; the 16-MiB response bound may stop sooner.\n- `status` (query, string) — Optional item-status filter. A cursor may be reused only with the same filter.\n\n## Responses\n\n### 200 — Bulk job status with rehydrated item envelopes. Each completed scrape\nresult entry echoes its `custom` payload (resolved per entry as\n`entry.custom ?? body.custom`) at the same position it occupies in the\n`/v1/scrape` success envelope. The key is omitted when no `custom` was\nsupplied for that entry.\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n- `next_cursor`\n- `has_more`\n- `items`\n\n### 202 — Bulk job still processing. `routes/scrape-bulk.ts` ends the poll handler\nwith `status: isTerminal ? 200 : 202` over an identical body, so this is\nthe SAME envelope the 200 documents — only the status code and the\nreachable `status` values differ. Keep polling until you get a 200\n(issue #3533).\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n- `next_cursor`\n- `has_more`\n- `items`\n\n### 404 — Resource not found.\n- `status`\n- `error`"
160
+ "body": "# Get scrape bulk job status\n\nReturns the job envelope plus its rehydrated per-URL scrape envelopes.\n\n**Downloading item content.** A `raw` or `markdown` artifact within the\n10-MiB inline cap is returned inline. An oversized one is replaced by a\n**pre-signed** URL, minted fresh on every read of this endpoint and valid\nfor **86400 seconds (24 hours)**. The underlying objects are private, so an\nunsigned URL returns `401`: download the content inside that window, or\nre-poll this endpoint for a fresh signature. An artifact that was never\nstored, or whose object cannot be signed, is omitted from `formats` and\nreported as `artifact_unavailable` in `warnings`. The private unsigned\nstorage URL is never returned.\n\n**GET** `/v1/scrape/bulk/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n- `cursor` (query, string) — Opaque cursor returned by the preceding page. It is bound to this bulk id, this recovery route, and the exact status filter; cross-scope cursors return 422.\n- `limit` (query, integer) — Maximum result rows considered for this page; the 16-MiB response bound may stop sooner.\n- `status` (query, string) — Optional item-status filter. A cursor may be reused only with the same filter.\n\n## Responses\n\n### 200 — Bulk job status with rehydrated item envelopes. Each completed scrape\nresult entry echoes its `custom` payload (resolved per entry as\n`entry.custom ?? body.custom`) at the same position it occupies in the\n`/v1/scrape` success envelope. The key is omitted when no `custom` was\nsupplied for that entry.\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n- `next_cursor`\n- `has_more`\n- `items`\n- `items.schema_version`\n- `items.status`\n- `items.id`\n- `items.url`\n- `items.final_url`\n- `items.content_type`\n- `items.content_length`\n- `items.status_code`\n- `items.retrieved_at`\n- `items.formats`\n- `items.formats.raw`\n- `items.formats.markdown`\n- `items.formats.links`\n- `items.formats.links.url`\n- `items.formats.links.text`\n- `items.formats.links.isInternal`\n- `items.formats.links.rel`\n- `items.formats.images`\n- `items.formats.images.url`\n- `items.formats.images.alt`\n- `items.formats.images.width`\n- `items.formats.images.height`\n- `items.formats.images.format`\n- `items.formats.images.score`\n- `items.metadata`\n- `items.metadata.title`\n- `items.metadata.description`\n- `items.metadata.language`\n- `items.metadata.canonicalUrl`\n- `items.metadata.ogTitle`\n- `items.metadata.ogDescription`\n- `items.metadata.ogImage`\n- `items.metadata.ogUrl`\n- `items.metadata.ogSiteName`\n- `items.metadata.robots`\n- `items.metadata.byline`\n- `items.metadata.publishedAt`\n- `items.tables`\n- `items.tables.kind`\n- `items.tables.gfm`\n- `items.tables.rows`\n- `items.tables.cols`\n- `items.warnings`\n- `items.warnings.code`\n- `items.warnings.message`\n- `items.warnings.element`\n- `items.stats`\n- `items.stats.chars`\n- `items.stats.tokens`\n- `items.stats.blocks`\n- `items.markdown_tokens`\n- `items.markdown_tokens.kept`\n- `items.markdown_tokens.total`\n- `items.markdown_tokens.truncated`\n- `items.billing`\n- `items.billing.raw_bytes`\n- `items.billing.factors`\n- `items.billing.factors.name`\n- `items.billing.factors.value`\n- `items.billing.factors.reason`\n- `items.billing.multiplier`\n- `items.billing.billed_bytes`\n- `items.custom`\n- `items.cache`\n- `items.cache_age_s`\n- `items.error`\n- `items.error.code`\n- `items.error.message`\n- `items.error.http_status`\n- `items.error.failed_at`\n- `items.status_url`\n- `items.queued_at`\n- `items.events`\n- `items.type`\n- `items.terminal_outcome`\n\n### 202 — Bulk job still processing. `routes/scrape-bulk.ts` ends the poll handler\nwith `status: isTerminal ? 200 : 202` over an identical body, so this is\nthe SAME envelope the 200 documents — only the status code and the\nreachable `status` values differ. Keep polling until you get a 200\n(issue #3533).\n- `id`\n- `status`\n- `total`\n- `completed`\n- `failed`\n- `created_at`\n- `completed_at`\n- `total_credits_charged`\n- `total_billed_bytes`\n- `estimated_credits`\n- `webhook_url`\n- `next_cursor`\n- `has_more`\n- `items`\n- `items.schema_version`\n- `items.status`\n- `items.id`\n- `items.url`\n- `items.final_url`\n- `items.content_type`\n- `items.content_length`\n- `items.status_code`\n- `items.retrieved_at`\n- `items.formats`\n- `items.formats.raw`\n- `items.formats.markdown`\n- `items.formats.links`\n- `items.formats.links.url`\n- `items.formats.links.text`\n- `items.formats.links.isInternal`\n- `items.formats.links.rel`\n- `items.formats.images`\n- `items.formats.images.url`\n- `items.formats.images.alt`\n- `items.formats.images.width`\n- `items.formats.images.height`\n- `items.formats.images.format`\n- `items.formats.images.score`\n- `items.metadata`\n- `items.metadata.title`\n- `items.metadata.description`\n- `items.metadata.language`\n- `items.metadata.canonicalUrl`\n- `items.metadata.ogTitle`\n- `items.metadata.ogDescription`\n- `items.metadata.ogImage`\n- `items.metadata.ogUrl`\n- `items.metadata.ogSiteName`\n- `items.metadata.robots`\n- `items.metadata.byline`\n- `items.metadata.publishedAt`\n- `items.tables`\n- `items.tables.kind`\n- `items.tables.gfm`\n- `items.tables.rows`\n- `items.tables.cols`\n- `items.warnings`\n- `items.warnings.code`\n- `items.warnings.message`\n- `items.warnings.element`\n- `items.stats`\n- `items.stats.chars`\n- `items.stats.tokens`\n- `items.stats.blocks`\n- `items.markdown_tokens`\n- `items.markdown_tokens.kept`\n- `items.markdown_tokens.total`\n- `items.markdown_tokens.truncated`\n- `items.billing`\n- `items.billing.raw_bytes`\n- `items.billing.factors`\n- `items.billing.factors.name`\n- `items.billing.factors.value`\n- `items.billing.factors.reason`\n- `items.billing.multiplier`\n- `items.billing.billed_bytes`\n- `items.custom`\n- `items.cache`\n- `items.cache_age_s`\n- `items.error`\n- `items.error.code`\n- `items.error.message`\n- `items.error.http_status`\n- `items.error.failed_at`\n- `items.status_url`\n- `items.queued_at`\n- `items.events`\n- `items.type`\n- `items.terminal_outcome`\n\n### 404 — Resource not found.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
161
161
  },
162
162
  "api/scrape/createscrape": {
163
163
  "title": "Scrape a URL",
164
164
  "section": "API Reference",
165
- "body": "# Scrape a URL\n\nFetches and processes a URL, returning content in one or more formats wrapped in a ScrapeEnvelope.\n\n**The response shape is decided by your request, not by how we route it.** In precedence order:\n\n1. `async: true` → **202** with a `ScrapeQueuedEnvelope` receipt, returned immediately. Poll `GET /v1/scrape/{id}` for the result.\n2. Otherwise, a request that needs a full page render — today that is `delay_ms > 0` — is **held open** until the render reaches a terminal state, then returns **200** with the content envelope (`success` or `failed`). If the render is still running when the hold window expires (28 seconds by default), the request returns the **202** receipt instead and the job continues in the background.\n3. Otherwise the request is served by the fast HTTP path and returns **200** with the content envelope, typically in under a second.\n\n**A failed fetch is a result, not a transport error.** An unreachable host, a refused connection, or a target whose bot protection defeats every proxy tier all come back on the same **200** as a `failed` envelope — never a 5xx. Narrow on the envelope's `status` before reading the body. A failure the fast path decides inline is recorded as a failed job, so its envelope normally carries that job's `id` and `GET /v1/scrape/{id}` returns the same envelope; if recording the failed job itself fails, the envelope still arrives on the same 200 with `id` set to `null` and there is nothing to poll. A failure a held render reaches carries that render's real `id`. Either way the request transfers no billable bytes and is charged nothing.\n\nSo a 202 means one of exactly two things: you asked for one with `async: true`, or the hold window expired. `wait_for_selector` and `wait_until` are `ScreenshotRequest` options, not `ScrapeRequest` options — sending either to this endpoint returns `422 validation_error`, so neither can produce a 202 here.\n\n**POST** `/v1/scrape`\n\n## Request Body\n\n- `url` (required)\n- `formats`\n- `country`\n- `delay_ms`\n- `timeout_ms`\n- `async`\n- `webhook_url`\n- `events`\n- `markdown_mode`\n- `markdown_query`\n- `markdown_links`\n- `markdown_images`\n- `with_links_summary`\n- `with_images_summary`\n- `markdown_compact`\n- `markdown_filter_images`\n- `markdown_include_media`\n- `markdown_include_warnings`\n- `markdown_include_stats`\n- `token_budget`\n- `token_encoding`\n- `mobile`\n- `solve_challenge`\n- `remove_base64_images`\n- `include_tags`\n- `exclude_tags`\n- `cache_ttl`\n- `custom`\n- `clean_markdown`\n- `x_internal_scrape_path`\n\n## Responses\n\n### 200 — Scrape reached a terminal state and the body is that terminal envelope: `success` carrying content, or `failed` carrying the error envelope. Returned by the fast HTTP path in one round trip, and by a browser-path request without `async: true` once its render reaches a terminal state inside the hold window. A held render that ends in failure answers 200 with the same `failed` envelope `GET /v1/scrape/{id}` returns — narrow on `status` before reading the body. A definitive upstream outcome is a result, not a transport error: an unreachable host, a refused connection, or a target whose bot protection defeats every proxy tier all answer 200 with the `failed` envelope, never a 5xx. An inline failure is recorded as a failed job, so its envelope normally carries that job's `id` and polling it returns the same envelope; `id` is `null` only when recording the failed job itself failed. `error.http_status` is present only when a real upstream HTTP status is known.\n- `schema_version`\n- `status`\n- `id`\n- `url`\n- `final_url`\n- `content_type`\n- `content_length`\n- `status_code`\n- `retrieved_at`\n- `formats`\n- `metadata`\n- `tables`\n- `warnings`\n- `stats`\n- `markdown_tokens`\n- `billing`\n- `custom`\n- `cache`\n- `cache_age_s`\n- `error`\n\n### 202 — Scrape accepted for background processing; the body is a receipt, not content. Returned when `async: true` was requested, or when a browser-path request's hold window expired before the render finished. Poll `GET /v1/scrape/{id}` for the result.\n- `schema_version`\n- `status`\n- `id`\n- `url`\n- `status_url`\n- `queued_at`\n- `events`\n\n### 400 — Bad request. When the `url` field fails strict validation the error\ncode is `invalid_url` and the `details` object contains:\n- `field` — the request field that failed (e.g. `\"url\"`)\n- `url` — the rejected value\n- `reason` — one of: `scheme_missing`, `scheme_unsupported`,\n `scheme_separator_typo`, `host_empty`, `host_invalid`,\n `host_blocked_private`, `host_blocked_loopback`, `host_too_long`,\n `host_unicode_not_punycode`, `userinfo_present`, `url_too_long`,\n `control_chars`, `not_a_url`\n- `status`\n- `error`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n\n### 422 — Validation error.\n- `status`\n- `error`\n\n### 429 — Rate limit (`rate_limited`) or concurrency limit (`concurrency_limit`) exceeded. Carries a `Retry-After` header — seconds derived from the same clock as `X-RateLimit-Reset` for the rate-limit variant, a fixed small back-off for the concurrency variant.\n- `status`\n- `error`\n\n### 500 — Internal server error.\n- `status`\n- `error`"
165
+ "body": "# Scrape a URL\n\nFetches and processes a URL, returning content in one or more formats wrapped in a ScrapeEnvelope.\n\n**The response shape is decided by your request, not by how we route it.** In precedence order:\n\n1. `async: true` → **202** with a `ScrapeQueuedEnvelope` receipt, returned immediately. Poll `GET /v1/scrape/{id}` for the result.\n2. Otherwise, a request that needs a full page render — today that is `delay_ms > 0` — is **held open** until the render reaches a terminal state, then returns **200** with the content envelope (`success` or `failed`). If the render is still running when the hold window expires (28 seconds by default), the request returns the **202** receipt instead and the job continues in the background.\n3. Otherwise the request is served by the fast HTTP path and returns **200** with the content envelope, typically in under a second.\n\n**A failed fetch is a result, not a transport error.** An unreachable host, a refused connection, or a target whose bot protection defeats every proxy tier all come back on the same **200** as a `failed` envelope — never a 5xx. Narrow on the envelope's `status` before reading the body. A failure the fast path decides inline is recorded as a failed job, so its envelope normally carries that job's `id` and `GET /v1/scrape/{id}` returns the same envelope; if recording the failed job itself fails, the envelope still arrives on the same 200 with `id` set to `null` and there is nothing to poll. A failure a held render reaches carries that render's real `id`. Either way the request transfers no billable bytes and is charged nothing.\n\nSo a 202 means one of exactly two things: you asked for one with `async: true`, or the hold window expired. `wait_for_selector` and `wait_until` are `ScreenshotRequest` options, not `ScrapeRequest` options — sending either to this endpoint returns `422 validation_error`, so neither can produce a 202 here.\n\n**POST** `/v1/scrape`\n\n## Request Body\n\n- `url` (required)\n- `formats`\n- `country`\n- `delay_ms`\n- `timeout_ms`\n- `async`\n- `webhook_url`\n- `events`\n- `markdown_mode`\n- `markdown_query`\n- `markdown_links`\n- `markdown_images`\n- `with_links_summary`\n- `with_images_summary`\n- `markdown_compact`\n- `markdown_filter_images`\n- `markdown_include_media`\n- `markdown_include_warnings`\n- `markdown_include_stats`\n- `token_budget`\n- `token_encoding`\n- `mobile`\n- `solve_challenge`\n- `remove_base64_images`\n- `include_tags`\n- `exclude_tags`\n- `cache_ttl`\n- `custom`\n- `clean_markdown`\n- `x_internal_scrape_path`\n\n## Responses\n\n### 200 — Scrape reached a terminal state and the body is that terminal envelope: `success` carrying content, or `failed` carrying the error envelope. Returned by the fast HTTP path in one round trip, and by a browser-path request without `async: true` once its render reaches a terminal state inside the hold window. A held render that ends in failure answers 200 with the same `failed` envelope `GET /v1/scrape/{id}` returns — narrow on `status` before reading the body. A definitive upstream outcome is a result, not a transport error: an unreachable host, a refused connection, or a target whose bot protection defeats every proxy tier all answer 200 with the `failed` envelope, never a 5xx. An inline failure is recorded as a failed job, so its envelope normally carries that job's `id` and polling it returns the same envelope; `id` is `null` only when recording the failed job itself failed. `error.http_status` is present only when a real upstream HTTP status is known.\n- `schema_version`\n- `status`\n- `id`\n- `url`\n- `final_url`\n- `content_type`\n- `content_length`\n- `status_code`\n- `retrieved_at`\n- `formats`\n- `formats.raw`\n- `formats.markdown`\n- `formats.links`\n- `formats.links.url`\n- `formats.links.text`\n- `formats.links.isInternal`\n- `formats.links.rel`\n- `formats.images`\n- `formats.images.url`\n- `formats.images.alt`\n- `formats.images.width`\n- `formats.images.height`\n- `formats.images.format`\n- `formats.images.score`\n- `metadata`\n- `metadata.title`\n- `metadata.description`\n- `metadata.language`\n- `metadata.canonicalUrl`\n- `metadata.ogTitle`\n- `metadata.ogDescription`\n- `metadata.ogImage`\n- `metadata.ogUrl`\n- `metadata.ogSiteName`\n- `metadata.robots`\n- `metadata.byline`\n- `metadata.publishedAt`\n- `tables`\n- `tables.kind`\n- `tables.gfm`\n- `tables.rows`\n- `tables.cols`\n- `warnings`\n- `warnings.code`\n- `warnings.message`\n- `warnings.element`\n- `stats`\n- `stats.chars`\n- `stats.tokens`\n- `stats.blocks`\n- `markdown_tokens`\n- `markdown_tokens.kept`\n- `markdown_tokens.total`\n- `markdown_tokens.truncated`\n- `billing`\n- `billing.raw_bytes`\n- `billing.factors`\n- `billing.factors.name`\n- `billing.factors.value`\n- `billing.factors.reason`\n- `billing.multiplier`\n- `billing.billed_bytes`\n- `custom`\n- `cache`\n- `cache_age_s`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n\n### 202 — Scrape accepted for background processing; the body is a receipt, not content. Returned when `async: true` was requested, or when a browser-path request's hold window expired before the render finished. Poll `GET /v1/scrape/{id}` for the result.\n- `schema_version`\n- `status`\n- `id`\n- `url`\n- `status_url`\n- `queued_at`\n- `events`\n\n### 400 — Bad request. When the `url` field fails strict validation the error\ncode is `invalid_url` and the `details` object contains:\n- `field` — the request field that failed (e.g. `\"url\"`)\n- `url` — the rejected value\n- `reason` — one of: `scheme_missing`, `scheme_unsupported`,\n `scheme_separator_typo`, `host_empty`, `host_invalid`,\n `host_blocked_private`, `host_blocked_loopback`, `host_too_long`,\n `host_unicode_not_punycode`, `userinfo_present`, `url_too_long`,\n `control_chars`, `not_a_url`\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 422 — Validation error.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 429 — Rate limit (`rate_limited`) or concurrency limit (`concurrency_limit`) exceeded. Carries a `Retry-After` header — seconds derived from the same clock as `X-RateLimit-Reset` for the rate-limit variant, a fixed small back-off for the concurrency variant.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 500 — Internal server error.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
166
166
  },
167
167
  "api/scrape/getscrape": {
168
168
  "title": "Get scrape result",
169
169
  "section": "API Reference",
170
- "body": "# Get scrape result\n\nAlways returns 200. Check the `status` discriminator for the scrape state.\n\n**GET** `/v1/scrape/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Responses\n\n### 200 — Scrape state (queued, success, or failed).\n- `schema_version`\n- `status`\n- `id`\n- `url`\n- `final_url`\n- `content_type`\n- `content_length`\n- `status_code`\n- `retrieved_at`\n- `formats`\n- `metadata`\n- `tables`\n- `warnings`\n- `stats`\n- `markdown_tokens`\n- `billing`\n- `custom`\n- `cache`\n- `cache_age_s`\n- `error`\n- `status_url`\n- `queued_at`\n- `events`\n\n### 404 — Resource not found.\n- `status`\n- `error`"
170
+ "body": "# Get scrape result\n\nAlways returns 200. Check the `status` discriminator for the scrape state.\n\n**GET** `/v1/scrape/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Responses\n\n### 200 — Scrape state (queued, success, or failed).\n- `schema_version`\n- `status`\n- `id`\n- `url`\n- `final_url`\n- `content_type`\n- `content_length`\n- `status_code`\n- `retrieved_at`\n- `formats`\n- `formats.raw`\n- `formats.markdown`\n- `formats.links`\n- `formats.links.url`\n- `formats.links.text`\n- `formats.links.isInternal`\n- `formats.links.rel`\n- `formats.images`\n- `formats.images.url`\n- `formats.images.alt`\n- `formats.images.width`\n- `formats.images.height`\n- `formats.images.format`\n- `formats.images.score`\n- `metadata`\n- `metadata.title`\n- `metadata.description`\n- `metadata.language`\n- `metadata.canonicalUrl`\n- `metadata.ogTitle`\n- `metadata.ogDescription`\n- `metadata.ogImage`\n- `metadata.ogUrl`\n- `metadata.ogSiteName`\n- `metadata.robots`\n- `metadata.byline`\n- `metadata.publishedAt`\n- `tables`\n- `tables.kind`\n- `tables.gfm`\n- `tables.rows`\n- `tables.cols`\n- `warnings`\n- `warnings.code`\n- `warnings.message`\n- `warnings.element`\n- `stats`\n- `stats.chars`\n- `stats.tokens`\n- `stats.blocks`\n- `markdown_tokens`\n- `markdown_tokens.kept`\n- `markdown_tokens.total`\n- `markdown_tokens.truncated`\n- `billing`\n- `billing.raw_bytes`\n- `billing.factors`\n- `billing.factors.name`\n- `billing.factors.value`\n- `billing.factors.reason`\n- `billing.multiplier`\n- `billing.billed_bytes`\n- `custom`\n- `cache`\n- `cache_age_s`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `status_url`\n- `queued_at`\n- `events`\n\n### 404 — Resource not found.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
171
171
  },
172
172
  "api/screenshots": {
173
173
  "title": "Screenshots",
@@ -177,12 +177,12 @@
177
177
  "api/screenshots/createscreenshot": {
178
178
  "title": "Capture a screenshot",
179
179
  "section": "API Reference",
180
- "body": "# Capture a screenshot\n\nSync by default (holds up to 28s). Pass `?async=true` to return 202 immediately.\nPoll via GET /v1/screenshots/{id}.\n\n**Limits:** request bodies are capped at 512 KB. An oversized body\nreturns a `400` with error code `request_too_large`.\n\n**POST** `/v1/screenshots`\n\n## Parameters\n\n- `async` (query, boolean)\n\n## Request Body\n\n- `url` (required)\n- `device`\n- `viewport`\n- `full_page`\n- `format`\n- `quality`\n- `block_ads`\n- `block_cookie_banners`\n- `wait_until`\n- `wait_for_selector`\n- `delay_ms`\n- `scroll`\n- `clip`\n- `dark_mode`\n- `device_scale_factor`\n- `include_html`\n- `country`\n- `language`\n- `metadata`\n\n## Responses\n\n### 200 — Screenshot completed (sync mode).\n- `id`\n- `status`\n- `url`\n- `image_url`\n- `page_title`\n- `image_width`\n- `image_height`\n- `file_size_bytes`\n- `credits_charged`\n- `billing`\n- `error_code`\n- `error_message`\n- `created_at`\n- `completed_at`\n- `expires_at`\n- `poll_url`\n\n### 202 — Screenshot accepted (async mode or sync timeout).\n- `id`\n- `status`\n- `url`\n- `image_url`\n- `page_title`\n- `image_width`\n- `image_height`\n- `file_size_bytes`\n- `credits_charged`\n- `billing`\n- `error_code`\n- `error_message`\n- `created_at`\n- `completed_at`\n- `expires_at`\n- `poll_url`\n\n### 400 — Bad request. When the `url` field fails strict validation the error\ncode is `invalid_url` and the `details` object contains:\n- `field` — the request field that failed (e.g. `\"url\"`)\n- `url` — the rejected value\n- `reason` — one of: `scheme_missing`, `scheme_unsupported`,\n `scheme_separator_typo`, `host_empty`, `host_invalid`,\n `host_blocked_private`, `host_blocked_loopback`, `host_too_long`,\n `host_unicode_not_punycode`, `userinfo_present`, `url_too_long`,\n `control_chars`, `not_a_url`\n- `status`\n- `error`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n\n### 422 — Validation error, or a screenshot that failed inside the sync hold.\nThe two carry DIFFERENT bodies (issue #2679):\n\n- A request-validation failure returns the unified `Error` envelope\n with code `validation_error`.\n- A capture that reached a terminal `failed` state inside the sync\n hold returns the full `ScreenshotResponse` resource, whose\n `error_code`/`error_message` carry the real failure (`blocked`,\n `timeout`, …). This is the canonical shape for that case: the\n resource body is what carries the `ss_` handle, `poll_url` and\n `expires_at` a client needs to redeem the failed capture, none of\n which fit the `Error` envelope.\n\nDiscriminate on the shape of the top-level `error` key. The envelope\nform carries `error` as an OBJECT (`{ code, message, http_status,\nfailed_at }`); the resource form has no `error` key at all, and\ncarries the flat `error_code`/`error_message` pair plus `id` instead.\n\nDo NOT discriminate on `status`. Both forms carry\n`\"status\": \"failed\"` on this response — `Error.status` is a required\nproperty with `enum: [failed]` — so it separates nothing here.\n\n`X-Screenshot-ID` accompanies the resource form only: a\nrequest-validation failure is raised before a screenshot row exists,\nso no screenshot headers travel with it.\n- `status`\n- `error`\n- `id`\n- `url`\n- `image_url`\n- `page_title`\n- `image_width`\n- `image_height`\n- `file_size_bytes`\n- `credits_charged`\n- `billing`\n- `error_code`\n- `error_message`\n- `created_at`\n- `completed_at`\n- `expires_at`\n- `poll_url`\n\n### 429 — Rate limit (`rate_limited`) or concurrency limit (`concurrency_limit`) exceeded. Carries a `Retry-After` header — seconds derived from the same clock as `X-RateLimit-Reset` for the rate-limit variant, a fixed small back-off for the concurrency variant.\n- `status`\n- `error`"
180
+ "body": "# Capture a screenshot\n\nSync by default (holds up to 28s). Pass `?async=true` to return 202 immediately.\nPoll via GET /v1/screenshots/{id}.\n\n**Limits:** request bodies are capped at 512 KB. An oversized body\nreturns a `400` with error code `request_too_large`.\n\n**POST** `/v1/screenshots`\n\n## Parameters\n\n- `async` (query, boolean)\n\n## Request Body\n\n- `url` (required)\n- `device`\n- `viewport`\n- `viewport.width`\n- `viewport.height`\n- `full_page`\n- `format`\n- `quality`\n- `block_ads`\n- `block_cookie_banners`\n- `wait_until`\n- `wait_for_selector`\n- `delay_ms`\n- `scroll`\n- `clip`\n- `clip.x`\n- `clip.y`\n- `clip.width`\n- `clip.height`\n- `dark_mode`\n- `device_scale_factor`\n- `include_html`\n- `country`\n- `language`\n- `metadata`\n\n## Responses\n\n### 200 — Screenshot completed (sync mode).\n- `id`\n- `status`\n- `url`\n- `image_url`\n- `page_title`\n- `image_width`\n- `image_height`\n- `file_size_bytes`\n- `credits_charged`\n- `billing`\n- `billing.raw_bytes`\n- `billing.factors`\n- `billing.factors.name`\n- `billing.factors.value`\n- `billing.factors.reason`\n- `billing.multiplier`\n- `billing.billed_bytes`\n- `error_code`\n- `error_message`\n- `created_at`\n- `completed_at`\n- `expires_at`\n- `poll_url`\n\n### 202 — Screenshot accepted (async mode or sync timeout).\n- `id`\n- `status`\n- `url`\n- `image_url`\n- `page_title`\n- `image_width`\n- `image_height`\n- `file_size_bytes`\n- `credits_charged`\n- `billing`\n- `billing.raw_bytes`\n- `billing.factors`\n- `billing.factors.name`\n- `billing.factors.value`\n- `billing.factors.reason`\n- `billing.multiplier`\n- `billing.billed_bytes`\n- `error_code`\n- `error_message`\n- `created_at`\n- `completed_at`\n- `expires_at`\n- `poll_url`\n\n### 400 — Bad request. When the `url` field fails strict validation the error\ncode is `invalid_url` and the `details` object contains:\n- `field` — the request field that failed (e.g. `\"url\"`)\n- `url` — the rejected value\n- `reason` — one of: `scheme_missing`, `scheme_unsupported`,\n `scheme_separator_typo`, `host_empty`, `host_invalid`,\n `host_blocked_private`, `host_blocked_loopback`, `host_too_long`,\n `host_unicode_not_punycode`, `userinfo_present`, `url_too_long`,\n `control_chars`, `not_a_url`\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 422 — Validation error, or a screenshot that failed inside the sync hold.\nThe two carry DIFFERENT bodies (issue #2679):\n\n- A request-validation failure returns the unified `Error` envelope\n with code `validation_error`.\n- A capture that reached a terminal `failed` state inside the sync\n hold returns the full `ScreenshotResponse` resource, whose\n `error_code`/`error_message` carry the real failure (`blocked`,\n `timeout`, …). This is the canonical shape for that case: the\n resource body is what carries the `ss_` handle, `poll_url` and\n `expires_at` a client needs to redeem the failed capture, none of\n which fit the `Error` envelope.\n\nDiscriminate on the shape of the top-level `error` key. The envelope\nform carries `error` as an OBJECT (`{ code, message, http_status,\nfailed_at }`); the resource form has no `error` key at all, and\ncarries the flat `error_code`/`error_message` pair plus `id` instead.\n\nDo NOT discriminate on `status`. Both forms carry\n`\"status\": \"failed\"` on this response — `Error.status` is a required\nproperty with `enum: [failed]` — so it separates nothing here.\n\n`X-Screenshot-ID` accompanies the resource form only: a\nrequest-validation failure is raised before a screenshot row exists,\nso no screenshot headers travel with it.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n- `id`\n- `url`\n- `image_url`\n- `page_title`\n- `image_width`\n- `image_height`\n- `file_size_bytes`\n- `credits_charged`\n- `billing`\n- `billing.raw_bytes`\n- `billing.factors`\n- `billing.factors.name`\n- `billing.factors.value`\n- `billing.factors.reason`\n- `billing.multiplier`\n- `billing.billed_bytes`\n- `error_code`\n- `error_message`\n- `created_at`\n- `completed_at`\n- `expires_at`\n- `poll_url`\n\n### 429 — Rate limit (`rate_limited`) or concurrency limit (`concurrency_limit`) exceeded. Carries a `Retry-After` header — seconds derived from the same clock as `X-RateLimit-Reset` for the rate-limit variant, a fixed small back-off for the concurrency variant.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
181
181
  },
182
182
  "api/screenshots/getscreenshot": {
183
183
  "title": "Get screenshot status",
184
184
  "section": "API Reference",
185
- "body": "# Get screenshot status\n\n**GET** `/v1/screenshots/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Responses\n\n### 200 — Screenshot completed or failed. A `completed` screenshot returns the\nfull `ScreenshotResponse` resource (signed `image_url`, dimensions,\netc.). A terminal-`failed` screenshot is a successfully retrieved\nterminal state (like a failed async scrape) and instead returns the\nunified failed envelope (`Error` schema) populated from the\nscreenshot's own `error_code`/`error_message` (issue #2027).\n- `id`\n- `status`\n- `url`\n- `image_url`\n- `page_title`\n- `image_width`\n- `image_height`\n- `file_size_bytes`\n- `credits_charged`\n- `billing`\n- `error_code`\n- `error_message`\n- `created_at`\n- `completed_at`\n- `expires_at`\n- `poll_url`\n- `error`\n\n### 202 — Screenshot still processing.\n- `id`\n- `status`\n- `url`\n- `image_url`\n- `page_title`\n- `image_width`\n- `image_height`\n- `file_size_bytes`\n- `credits_charged`\n- `billing`\n- `error_code`\n- `error_message`\n- `created_at`\n- `completed_at`\n- `expires_at`\n- `poll_url`\n\n### 404 — Resource not found.\n- `status`\n- `error`"
185
+ "body": "# Get screenshot status\n\n**GET** `/v1/screenshots/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Responses\n\n### 200 — Screenshot completed or failed. A `completed` screenshot returns the\nfull `ScreenshotResponse` resource (signed `image_url`, dimensions,\netc.). A terminal-`failed` screenshot is a successfully retrieved\nterminal state (like a failed async scrape) and instead returns the\nunified failed envelope (`Error` schema) populated from the\nscreenshot's own `error_code`/`error_message` (issue #2027).\n- `id`\n- `status`\n- `url`\n- `image_url`\n- `page_title`\n- `image_width`\n- `image_height`\n- `file_size_bytes`\n- `credits_charged`\n- `billing`\n- `billing.raw_bytes`\n- `billing.factors`\n- `billing.factors.name`\n- `billing.factors.value`\n- `billing.factors.reason`\n- `billing.multiplier`\n- `billing.billed_bytes`\n- `error_code`\n- `error_message`\n- `created_at`\n- `completed_at`\n- `expires_at`\n- `poll_url`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 202 — Screenshot still processing.\n- `id`\n- `status`\n- `url`\n- `image_url`\n- `page_title`\n- `image_width`\n- `image_height`\n- `file_size_bytes`\n- `credits_charged`\n- `billing`\n- `billing.raw_bytes`\n- `billing.factors`\n- `billing.factors.name`\n- `billing.factors.value`\n- `billing.factors.reason`\n- `billing.multiplier`\n- `billing.billed_bytes`\n- `error_code`\n- `error_message`\n- `created_at`\n- `completed_at`\n- `expires_at`\n- `poll_url`\n\n### 404 — Resource not found.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
186
186
  },
187
187
  "api/search": {
188
188
  "title": "Search",
@@ -192,7 +192,7 @@
192
192
  "api/search/createsearch": {
193
193
  "title": "Search the web",
194
194
  "section": "API Reference",
195
- "body": "# Search the web\n\nRuns a web search for `query` and returns ranked organic results with\ncontiguous `position` values from 1.\n\nUse `limit` (1–100, default 10) to request more results in a single\ncall. Results are fetched in pages of 10, so a call consumes\n`ceil(limit / 10)` credits (capped at 10) from the account's monthly\ncredits bucket — for example `limit=10` costs 1 credit and `limit=35`\ncosts 4. Credits are charged for every page fetched regardless of how\nmany results a page returns. The credit count is reported as\n`credits_used` in the response.\n\n**POST** `/v1/search`\n\n## Request Body\n\n- `query` (required)\n- `type`\n- `limit`\n- `country`\n- `language`\n- `date_range`\n\n## Responses\n\n### 200 — Search completed.\n- `id`\n- `query`\n- `results`\n- `related_searches`\n- `credits_used`\n\n### 400 — Bad request (e.g. missing or empty `query`).\n- `status`\n- `error`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n\n### 429 — Rate limit exceeded (`rate_limited`). Carries the `X-RateLimit-Limit`/`X-RateLimit-Remaining`/`X-RateLimit-Reset` triplet and a `Retry-After` header. The window is per-second for a bearer API key, or the 60-request/60-second Clerk session window when authenticated via `resolveDualAuth` — `Retry-After` reflects whichever window applies to the request.\n- `status`\n- `error`\n\n### 500 — Internal error (code `internal_error`) — the search request could not\nbe recorded before the provider call. The pre-incremented credits are\nrefunded and no provider call is made.\n- `status`\n- `error`\n\n### 503 — Upstream search provider error, answered at `503` rather than `502` because\nCloudflare replaces an origin 502 body with its own page (#4891). The body is a fixed,\nvendor-masked shape — deliberately NOT the unified `Error`\nenvelope. The upstream provider's identity and message are\nnever surfaced, so the response carries only the constant\n`error` code `search_provider_error`.\n- `error`"
195
+ "body": "# Search the web\n\nRuns a web search for `query` and returns ranked organic results with\ncontiguous `position` values from 1.\n\nUse `limit` (1–100, default 10) to request more results in a single\ncall. Results are fetched in pages of 10, so a call consumes\n`ceil(limit / 10)` credits (capped at 10) from the account's monthly\ncredits bucket — for example `limit=10` costs 1 credit and `limit=35`\ncosts 4. Credits are charged for every page fetched regardless of how\nmany results a page returns. The credit count is reported as\n`credits_used` in the response.\n\n**POST** `/v1/search`\n\n## Request Body\n\n- `query` (required)\n- `type`\n- `limit`\n- `country`\n- `language`\n- `date_range`\n\n## Responses\n\n### 200 — Search completed.\n- `id`\n- `query`\n- `results`\n- `results.position`\n- `results.title`\n- `results.url`\n- `results.snippet`\n- `results.date`\n- `results.source`\n- `results.domain`\n- `results.image`\n- `results.image.url`\n- `results.image.width`\n- `results.image.height`\n- `results.image.thumbnail_url`\n- `results.image.thumbnail_width`\n- `results.image.thumbnail_height`\n- `related_searches`\n- `credits_used`\n\n### 400 — Bad request (e.g. missing or empty `query`).\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 429 — Rate limit exceeded (`rate_limited`). Carries the `X-RateLimit-Limit`/`X-RateLimit-Remaining`/`X-RateLimit-Reset` triplet and a `Retry-After` header. The window is per-second for a bearer API key, or the 60-request/60-second Clerk session window when authenticated via `resolveDualAuth` — `Retry-After` reflects whichever window applies to the request.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 500 — Internal error (code `internal_error`) — the search request could not\nbe recorded before the provider call. The pre-incremented credits are\nrefunded and no provider call is made.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 503 — Upstream search provider error, answered at `503` rather than `502` because\nCloudflare replaces an origin 502 body with its own page (#4891). The body is a fixed,\nvendor-masked shape — deliberately NOT the unified `Error`\nenvelope. The upstream provider's identity and message are\nnever surfaced, so the response carries only the constant\n`error` code `search_provider_error`.\n- `error`"
196
196
  },
197
197
  "api/sitemap": {
198
198
  "title": "Sitemap",
@@ -202,12 +202,12 @@
202
202
  "api/sitemap/createsitemap": {
203
203
  "title": "Discover URLs on a domain",
204
204
  "section": "API Reference",
205
- "body": "# Discover URLs on a domain\n\nCrawls a domain to build a sitemap. Returns cached results if available\nwithin cache_ttl. Results delivered via webhook and downloadable from results_url.\nWebhook deliveries include `X-ByteKit-Event: sitemap.completed` or\n`X-ByteKit-Event: sitemap.failed` so receivers can dispatch on the\nheader without parsing the body shape.\n\n**Limits:** request bodies are capped at 512 KB. An oversized body\nreturns a `400` with error code `request_too_large`.\n\n**POST** `/v1/sitemap`\n\n## Request Body\n\n- `url` (required)\n- `strategy`\n- `max_depth`\n- `max_urls`\n- `process`\n- `webhook_url`\n- `webhook_secret`\n- `cache_ttl`\n- `compact`\n- `metadata`\n\n## Responses\n\n### 202 — Sitemap job accepted (or cached result returned).\n- `id`\n- `url`\n- `strategy`\n- `max_depth`\n- `max_urls`\n- `status`\n- `total_urls`\n- `sources`\n- `total_bytes`\n- `results_url`\n- `cache`\n- `cache_age_s`\n- `billing`\n- `warnings`\n- `error_code`\n- `error_message`\n- `compact`\n- `process`\n- `metadata`\n- `created_at`\n- `completed_at`\n- `expires_at`\n\n### 400 — Bad request. When the `url` field fails strict validation the error\ncode is `invalid_url` and the `details` object contains:\n- `field` — the request field that failed (e.g. `\"url\"`)\n- `url` — the rejected value\n- `reason` — one of: `scheme_missing`, `scheme_unsupported`,\n `scheme_separator_typo`, `host_empty`, `host_invalid`,\n `host_blocked_private`, `host_blocked_loopback`, `host_too_long`,\n `host_unicode_not_punycode`, `userinfo_present`, `url_too_long`,\n `control_chars`, `not_a_url`\n- `status`\n- `error`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n\n### 422 — Validation error.\n- `status`\n- `error`\n\n### 429 — Rate limit (`rate_limited`) or concurrency limit (`concurrency_limit`) exceeded. Carries a `Retry-After` header — seconds derived from the same clock as `X-RateLimit-Reset` for the rate-limit variant, a fixed small back-off for the concurrency variant.\n- `status`\n- `error`"
205
+ "body": "# Discover URLs on a domain\n\nCrawls a domain to build a sitemap. Returns cached results if available\nwithin cache_ttl. Results delivered via webhook and downloadable from results_url.\nWebhook deliveries include `X-ByteKit-Event: sitemap.completed` or\n`X-ByteKit-Event: sitemap.failed` so receivers can dispatch on the\nheader without parsing the body shape.\n\n**Limits:** request bodies are capped at 512 KB. An oversized body\nreturns a `400` with error code `request_too_large`.\n\n**POST** `/v1/sitemap`\n\n## Request Body\n\n- `url` (required)\n- `strategy`\n- `max_depth`\n- `max_urls`\n- `process`\n- `process.action`\n- `process.options`\n- `webhook_url`\n- `webhook_secret`\n- `cache_ttl`\n- `compact`\n- `metadata`\n\n## Responses\n\n### 202 — Sitemap job accepted (or cached result returned).\n- `id`\n- `url`\n- `strategy`\n- `max_depth`\n- `max_urls`\n- `status`\n- `total_urls`\n- `sources`\n- `total_bytes`\n- `results_url`\n- `cache`\n- `cache_age_s`\n- `billing`\n- `billing.raw_bytes`\n- `billing.factors`\n- `billing.factors.name`\n- `billing.factors.value`\n- `billing.factors.reason`\n- `billing.multiplier`\n- `billing.billed_bytes`\n- `warnings`\n- `error_code`\n- `error_message`\n- `compact`\n- `process`\n- `metadata`\n- `created_at`\n- `completed_at`\n- `expires_at`\n\n### 400 — Bad request. When the `url` field fails strict validation the error\ncode is `invalid_url` and the `details` object contains:\n- `field` — the request field that failed (e.g. `\"url\"`)\n- `url` — the rejected value\n- `reason` — one of: `scheme_missing`, `scheme_unsupported`,\n `scheme_separator_typo`, `host_empty`, `host_invalid`,\n `host_blocked_private`, `host_blocked_loopback`, `host_too_long`,\n `host_unicode_not_punycode`, `userinfo_present`, `url_too_long`,\n `control_chars`, `not_a_url`\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 402 — Payment required. The account cannot fund this request, and no work was\nperformed. The unified `Error` envelope carries one of the billing codes\nbelow in `error.code`; match on the code, never on the prose.\n\n- `quota_exceeded` — the enforced balance for this request's meter\n cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth: they reject when the balance cannot fund the request's\n byte reservation, and `error.details.required_bytes` and\n `error.details.available_bytes` report the bytes the request reserves\n and the bytes available. `/v1/search` meters credits.\n- `spending_cap_reached` — the request would push overage spend past the\n account's configured cap. Only reachable on a custom overage-enabled\n plan; standard plans stop at `quota_exceeded`.\n- `billing_entitlement_impaired` — the paid subscription is in a payment\n impairment (e.g. `past_due`). `error.message` names the reason.\n- `billing_entitlement_expired` — the paid subscription entitlement\n period has ended, or its dunning grace period has run out.\n\nNot retryable as-is: settle the balance, raise the cap, or restore the\nsubscription first. This response carries no `X-Quota-*` headers — they\ntravel with the 2xx responses of the operations that emit them.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 422 — Validation error.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 429 — Rate limit (`rate_limited`) or concurrency limit (`concurrency_limit`) exceeded. Carries a `Retry-After` header — seconds derived from the same clock as `X-RateLimit-Reset` for the rate-limit variant, a fixed small back-off for the concurrency variant.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
206
206
  },
207
207
  "api/sitemap/getsitemap": {
208
208
  "title": "Get sitemap job status",
209
209
  "section": "API Reference",
210
- "body": "# Get sitemap job status\n\n**GET** `/v1/sitemap/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Responses\n\n### 200 — Successful response.\n- `id`\n- `url`\n- `strategy`\n- `max_depth`\n- `max_urls`\n- `status`\n- `total_urls`\n- `sources`\n- `total_bytes`\n- `results_url`\n- `cache`\n- `cache_age_s`\n- `billing`\n- `warnings`\n- `error_code`\n- `error_message`\n- `compact`\n- `process`\n- `metadata`\n- `created_at`\n- `completed_at`\n- `expires_at`\n\n### 404 — Resource not found.\n- `status`\n- `error`\n\n### 422 — The id path segment is not a well-formed sitemap job id (genuinely malformed — a well-formed-but-absent id returns 404, not 422; see the Inverse case in issue\n- `status`\n- `error`"
210
+ "body": "# Get sitemap job status\n\n**GET** `/v1/sitemap/{id}`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Responses\n\n### 200 — Successful response.\n- `id`\n- `url`\n- `strategy`\n- `max_depth`\n- `max_urls`\n- `status`\n- `total_urls`\n- `sources`\n- `total_bytes`\n- `results_url`\n- `cache`\n- `cache_age_s`\n- `billing`\n- `billing.raw_bytes`\n- `billing.factors`\n- `billing.factors.name`\n- `billing.factors.value`\n- `billing.factors.reason`\n- `billing.multiplier`\n- `billing.billed_bytes`\n- `warnings`\n- `error_code`\n- `error_message`\n- `compact`\n- `process`\n- `metadata`\n- `created_at`\n- `completed_at`\n- `expires_at`\n\n### 404 — Resource not found.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 422 — The id path segment is not a well-formed sitemap job id (genuinely malformed — a well-formed-but-absent id returns 404, not 422; see the Inverse case in issue\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
211
211
  },
212
212
  "api/usage": {
213
213
  "title": "Usage",
@@ -217,17 +217,17 @@
217
217
  "api/usage/getusage": {
218
218
  "title": "Get current billing period usage",
219
219
  "section": "API Reference",
220
- "body": "# Get current billing period usage\n\n**GET** `/v1/usage`\n\n## Responses\n\n### 200 — Period summary. In bytes or dual billing mode, includes byte fields\nand structured bandwidth/credits objects.\n- `period_start`\n- `period_end`\n- `credits_used`\n- `credits_single`\n- `credits_bulk`\n- `credits_monitor`\n- `credits_scrape`\n- `credits_search`\n- `credits_limit`\n- `credits_remaining`\n- `has_overage`\n- `overage_credits`\n- `plan_name`\n- `plan_price_cents`\n- `plan_type`\n- `topup_spent_cents`\n- `topup_balance_bytes`\n- `period_days_elapsed`\n- `bytes_used`\n- `bytes_single`\n- `bytes_bulk`\n- `bytes_scrape`\n- `bytes_monitor`\n- `bytes_limit`\n- `bytes_remaining`\n- `rollover_bytes`\n- `topup_bytes`\n- `request_count`\n- `request_count_previous_period`\n- `playground_api_key_id`\n- `bandwidth`\n- `credits`"
220
+ "body": "# Get current billing period usage\n\n**GET** `/v1/usage`\n\n## Responses\n\n### 200 — Period summary. In bytes or dual billing mode, includes byte fields\nand structured bandwidth/credits objects.\n- `period_start`\n- `period_end`\n- `credits_used`\n- `credits_single`\n- `credits_bulk`\n- `credits_monitor`\n- `credits_scrape`\n- `credits_search`\n- `credits_limit`\n- `credits_remaining`\n- `has_overage`\n- `overage_credits`\n- `plan_name`\n- `plan_price_cents`\n- `plan_type`\n- `topup_spent_cents`\n- `topup_balance_bytes`\n- `period_days_elapsed`\n- `bytes_used`\n- `bytes_single`\n- `bytes_bulk`\n- `bytes_scrape`\n- `bytes_monitor`\n- `bytes_limit`\n- `bytes_remaining`\n- `rollover_bytes`\n- `topup_bytes`\n- `request_count`\n- `request_count_previous_period`\n- `playground_api_key_id`\n- `bandwidth`\n- `bandwidth.used_bytes`\n- `bandwidth.limit_bytes`\n- `bandwidth.remaining_bytes`\n- `bandwidth.topup_bytes`\n- `bandwidth.purchased_topup_bytes`\n- `bandwidth.granted_topup_bytes`\n- `bandwidth.rollover_bytes`\n- `credits`\n- `credits.used`\n- `credits.limit`\n- `credits.remaining`\n- `credits.topup_credits`\n- `credits.purchased_topup_credits`\n- `credits.granted_topup_credits`\n- `credits.rollover_credits`"
221
221
  },
222
222
  "api/usage/getusagebyendpoint": {
223
223
  "title": "Get per-endpoint bandwidth breakdown",
224
224
  "section": "API Reference",
225
- "body": "# Get per-endpoint bandwidth breakdown\n\nReturns bandwidth usage broken down by endpoint (screenshots, recordings, scrape, scrape_md, fetch, fetch_md, crawl, crawl_links, sitemap, monitors) for a date range. Each row carries raw bytes, the billing multiplier, and billable bytes. Endpoints with zero raw bytes for the range are omitted from `rows`; `totals` is always present. Default range is the last 30 days; max 366 days.\n\n**GET** `/v1/usage/by-endpoint`\n\n## Parameters\n\n- `from` (query, string) — Start date (YYYY-MM-DD). Default 30 days ago.\n- `to` (query, string) — End date (YYYY-MM-DD). Default today.\n- `api_key` (query, string) — Filter by API key (prefixed ID, e.g. `ak_xxx`). When provided, scopes the breakdown to that key only. The key must belong to the requesting account; cross-account keys return an empty breakdown. When absent, aggregates across all keys.\n\n## Responses\n\n### 200 — Successful response.\n- `from`\n- `to`\n- `rows`\n- `totals`"
225
+ "body": "# Get per-endpoint bandwidth breakdown\n\nReturns bandwidth usage broken down by endpoint (screenshots, recordings, scrape, scrape_md, fetch, fetch_md, crawl, crawl_links, sitemap, monitors) for a date range. Each row carries raw bytes, the billing multiplier, and billable bytes. Endpoints with zero raw bytes for the range are omitted from `rows`; `totals` is always present. Default range is the last 30 days; max 366 days.\n\n**GET** `/v1/usage/by-endpoint`\n\n## Parameters\n\n- `from` (query, string) — Start date (YYYY-MM-DD). Default 30 days ago.\n- `to` (query, string) — End date (YYYY-MM-DD). Default today.\n- `api_key` (query, string) — Filter by API key (prefixed ID, e.g. `ak_xxx`). When provided, scopes the breakdown to that key only. The key must belong to the requesting account; cross-account keys return an empty breakdown. When absent, aggregates across all keys.\n\n## Responses\n\n### 200 — Successful response.\n- `from`\n- `to`\n- `rows`\n- `rows.endpoint`\n- `rows.raw_bytes`\n- `rows.multiplier`\n- `rows.billable_bytes`\n- `totals`\n- `totals.raw_bytes`\n- `totals.billable_bytes`"
226
226
  },
227
227
  "api/usage/getusagedaily": {
228
228
  "title": "Get daily usage breakdown",
229
229
  "section": "API Reference",
230
- "body": "# Get daily usage breakdown\n\nDefault range is last 30 days. Max range is 366 days.\n\n**GET** `/v1/usage/daily`\n\n## Parameters\n\n- `from` (query, string) — Start date (YYYY-MM-DD). Default 30 days ago.\n- `to` (query, string) — End date (YYYY-MM-DD). Default today.\n- `api_key` (query, string) — Filter by API key (prefixed ID, e.g. `ak_xxx`). When provided, returns usage rows attributed to that key only. The key must belong to the requesting account; cross-account keys return empty data. Revoked keys still return historical data. When absent, aggregates across all keys.\n\n## Responses\n\n### 200 — Successful response.\n- `from`\n- `to`\n- `data`"
230
+ "body": "# Get daily usage breakdown\n\nDefault range is last 30 days. Max range is 366 days.\n\n**GET** `/v1/usage/daily`\n\n## Parameters\n\n- `from` (query, string) — Start date (YYYY-MM-DD). Default 30 days ago.\n- `to` (query, string) — End date (YYYY-MM-DD). Default today.\n- `api_key` (query, string) — Filter by API key (prefixed ID, e.g. `ak_xxx`). When provided, returns usage rows attributed to that key only. The key must belong to the requesting account; cross-account keys return empty data. Revoked keys still return historical data. When absent, aggregates across all keys.\n\n## Responses\n\n### 200 — Successful response.\n- `from`\n- `to`\n- `data`\n- `data.date`\n- `data.credits_single`\n- `data.credits_bulk`\n- `data.credits_monitor`\n- `data.credits_scrape`\n- `data.credits_search`\n- `data.credits_total`\n- `data.bytes_total`\n- `data.bytes_single`\n- `data.bytes_bulk`\n- `data.bytes_scrape`\n- `data.bytes_monitor`\n- `data.bytes_screenshot`\n- `data.bytes_recording`\n- `data.bytes_scrape_md`\n- `data.bytes_fetch`\n- `data.bytes_fetch_md`\n- `data.bytes_crawl`\n- `data.bytes_crawl_links`\n- `data.bytes_sitemap`"
231
231
  },
232
232
  "api/webhooks": {
233
233
  "title": "Webhooks",
@@ -237,12 +237,12 @@
237
237
  "api/webhooks/listwebhookdeliveries": {
238
238
  "title": "List webhook deliveries",
239
239
  "section": "API Reference",
240
- "body": "# List webhook deliveries\n\n**GET** `/v1/webhook-deliveries`\n\n## Parameters\n\n- `limit` (query, integer)\n- `cursor` (query, string) — Pagination cursor from a previous response.\n- `status` (query, string)\n- `since` (query, string) — Filter deliveries created after this ISO date.\n\n## Responses\n\n### 200 — Successful response.\n- `data`\n- `next_cursor`\n- `has_more`"
240
+ "body": "# List webhook deliveries\n\n**GET** `/v1/webhook-deliveries`\n\n## Parameters\n\n- `limit` (query, integer)\n- `cursor` (query, string) — Pagination cursor from a previous response.\n- `status` (query, string)\n- `since` (query, string) — Filter deliveries created after this ISO date.\n\n## Responses\n\n### 200 — Successful response.\n- `data`\n- `data.id`\n- `data.event_type`\n- `data.target_url`\n- `data.status`\n- `data.attempts`\n- `data.max_attempts`\n- `data.next_attempt_at`\n- `data.response_status`\n- `data.response_ms`\n- `data.created_at`\n- `data.delivered_at`\n- `data.screenshot_id`\n- `data.recording_id`\n- `data.bulk_id`\n- `data.monitor_id`\n- `data.scrape_id`\n- `next_cursor`\n- `has_more`"
241
241
  },
242
242
  "api/webhooks/retrywebhookdelivery": {
243
243
  "title": "Retry a webhook delivery",
244
244
  "section": "API Reference",
245
- "body": "# Retry a webhook delivery\n\nRequeues a failed or exhausted webhook delivery for another attempt.\n\n**Limits:** this endpoint takes no request body; any body sent is\ncapped at 64 KB. An oversized body returns a `400` with error code\n`request_too_large`.\n\n**POST** `/v1/webhook-deliveries/{id}/retry`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Responses\n\n### 200 — Successful response.\n- `id`\n- `event_type`\n- `target_url`\n- `status`\n- `attempts`\n- `max_attempts`\n- `next_attempt_at`\n- `response_status`\n- `response_ms`\n- `created_at`\n- `delivered_at`\n- `screenshot_id`\n- `recording_id`\n- `bulk_id`\n- `monitor_id`\n- `scrape_id`\n\n### 400 — Bad request. Returned when the request body exceeds this\nendpoint's size limit; the error code is `request_too_large`.\n- `status`\n- `error`\n\n### 404 — Delivery not found or not in a retryable state.\n- `status`\n- `error`"
245
+ "body": "# Retry a webhook delivery\n\nRequeues a failed or exhausted webhook delivery for another attempt.\n\n**Limits:** this endpoint takes no request body; any body sent is\ncapped at 64 KB. An oversized body returns a `400` with error code\n`request_too_large`.\n\n**POST** `/v1/webhook-deliveries/{id}/retry`\n\n## Parameters\n\n- `id` (path, string, required)\n\n## Responses\n\n### 200 — Successful response.\n- `id`\n- `event_type`\n- `target_url`\n- `status`\n- `attempts`\n- `max_attempts`\n- `next_attempt_at`\n- `response_status`\n- `response_ms`\n- `created_at`\n- `delivered_at`\n- `screenshot_id`\n- `recording_id`\n- `bulk_id`\n- `monitor_id`\n- `scrape_id`\n\n### 400 — Bad request. Returned when the request body exceeds this\nendpoint's size limit; the error code is `request_too_large`.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`\n\n### 404 — Delivery not found or not in a retryable state.\n- `status`\n- `error`\n- `error.code`\n- `error.message`\n- `error.http_status`\n- `error.failed_at`\n- `error.details`"
246
246
  },
247
247
  "billing": {
248
248
  "title": "Billing",
@@ -252,7 +252,7 @@
252
252
  "billing/balance": {
253
253
  "title": "Balance and exhausted quota",
254
254
  "section": "General",
255
- "body": "# Balance and exhausted quota\n\nWhat happens when a ByteKit bandwidth or credit balance reaches zero.\n\nByteKit checks the relevant balance before admitting billable work. Capture endpoints use the bandwidth balance; search uses the credit balance; schema extraction requires both.\n\nWhen a request would exceed an enforced balance, ByteKit returns **HTTP 402** with the error code `quota_exceeded`. The request does not continue as unpriced usage.\n\nThere is no automatic overage: availability is an explicit plan setting, reported as the `has_overage` field on your plan (`GET /v1/account`, `GET /v1/plans`) and on `GET /v1/usage`. No standard plan enables it — Starter, Growth and Scale report `has_overage: false`, so a credit-metered request past the included allowance is refused with 402 `quota_exceeded` rather than admitted as billable overage. Only a custom plan arranged with ByteKit can enable overage; on such a plan a configured spending cap can permit or reject additional usage, returning 402 `spending_cap_reached` when the cap is crossed. Capture endpoints still enforce their bandwidth budget.\n\n## Starter grant\n\nA new pay-as-you-go account receives a one-time starter grant when it is first created: **50 MB of bandwidth and 100 credits**. It is issued once per account, is not a purchase, and does not expire. Granted value is spent last — after your plan's included allowance and after any purchased top-up — so a top-up you paid for is never consumed while free grant remains.\n\n`GET /v1/billing/balance` reports the grant separately from purchases: `granted_topup_bytes` and `granted_topup_credits` hold the grant, `purchased_topup_bytes` and `purchased_topup_credits` hold what you bought, and `topup_bytes` / `topup_credits` are the two added together.\n\nTo continue after a hard balance stop, purchase a top-up or move to a plan with more included usage. Auto-top-up can add funds to your USD balance when your remaining value drops below the configured dollar threshold, but it must be enabled and configured in advance; reaching zero does not silently enable it.\n\nSee **Dashboard → Settings → Billing** for included usage, purchased and rollover balances, and auto-top-up status."
255
+ "body": "# Balance and exhausted quota\n\nWhat happens when a ByteKit bandwidth or credit balance reaches zero.\n\nByteKit checks the relevant balance before admitting billable work. Capture endpoints use the bandwidth balance; search uses the credit balance; schema extraction requires both.\n\nWhen a request would exceed an enforced balance, ByteKit returns **HTTP 402** with the error code `quota_exceeded`. The request does not continue as unpriced usage.\n\nThere is no automatic overage: availability is an explicit plan setting, reported as the `has_overage` field on your plan (`GET /v1/account`, `GET /v1/plans`) and on `GET /v1/usage`. No standard plan enables it — Starter, Growth and Scale report `has_overage: false`, so a credit-metered request past the included allowance is refused with 402 `quota_exceeded` rather than admitted as billable overage. Only a custom plan arranged with ByteKit can enable overage; on such a plan a configured spending cap can permit or reject additional usage, returning 402 `spending_cap_reached` when the cap is crossed. Capture endpoints still enforce their bandwidth budget.\n\n## Starter grant\n\nA new pay-as-you-go account receives a one-time starter grant when it is first created: **100 MB of bandwidth and 100 credits**. It is issued once per account, is not a purchase, and does not expire. Granted value is spent last — after your plan's included allowance and after any purchased top-up — so a top-up you paid for is never consumed while free grant remains.\n\n`GET /v1/billing/balance` reports the grant separately from purchases: `granted_topup_bytes` and `granted_topup_credits` hold the grant, `purchased_topup_bytes` and `purchased_topup_credits` hold what you bought, and `topup_bytes` / `topup_credits` are the two added together.\n\nTo continue after a hard balance stop, purchase a top-up or move to a plan with more included usage. Auto-top-up can add funds to your USD balance when your remaining value drops below the configured dollar threshold, but it must be enabled and configured in advance; reaching zero does not silently enable it.\n\nSee **Dashboard → Settings → Billing** for included usage, purchased and rollover balances, and auto-top-up status."
256
256
  },
257
257
  "billing/bandwidth": {
258
258
  "title": "Bandwidth billing",
@@ -367,7 +367,7 @@
367
367
  "introduction": {
368
368
  "title": "Introduction",
369
369
  "section": "General",
370
- "body": "# Introduction\n\nA REST API for screenshots, scraping, and page-change monitoring — one key, one base URL, every output.\n\n## What ByteKit is\n\nByteKit is a REST API for capturing what a webpage looks like and what it says —\nscreenshots, raw HTML or clean markdown, and page-change monitoring.\nOne API key, one base URL, every output you'd otherwise stitch together from a headless-browser\nfarm and a scraping proxy.\n\n## Integrate in 60 seconds\n\n- **Base URL:** `https://api.bytekit.com`\n- **Auth:** send `Authorization: Bearer $BYTEKIT_API_KEY` on every request. Create a key in the\n [ByteKit dashboard](https://app.bytekit.com) and export it as `BYTEKIT_API_KEY`.\n- **Install:** `npm install @hunt-labs/bytekit-sdk` for TypeScript, or `pip install bytekit-sdk`\n for Python (import name `bytekit`).\n\nThe npm package is `@hunt-labs/bytekit-sdk` — not `bytekit`, which is an unrelated package.\n\nOne call with curl:\n\n```bash\ncurl -X POST https://api.bytekit.com/v1/scrape \\\n -H \"Authorization: Bearer $BYTEKIT_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"url\":\"https://example.com\"}'\n```\n\nThe same call with the TypeScript SDK:\n\n```ts\nimport { ByteKit } from '@hunt-labs/bytekit-sdk';\n\nconst client = new ByteKit({ apiKey: process.env.BYTEKIT_API_KEY! });\nconst result = await client.scrape.create({ url: 'https://example.com' });\nconsole.log(result);\n```\n\nFull SDK guides: [TypeScript](https://bytekit.com/docs/libraries/typescript) and [Python](https://bytekit.com/docs/libraries/python).\n\n## What you can do with it\n\n- **Scrape** — Fetch a URL as raw HTML, clean markdown, or structured content.\n- **Screenshot** — Capture full-page or viewport PNG/JPEG.\n- **Monitor** — Watch a URL on a schedule and webhook you when the rendered output changes.\n- **Bulk** — Fan out thousands of URLs in parallel and receive a webhook as each finishes.\n- **Sitemap** — Discover URLs from a domain's sitemap or by light crawling.\n\nScrape calls accept an `\"async\": true` body field, in which case the API returns `202` with a `sc_…`\nID that you poll or receive via webhook. Screenshots are synchronous by default (the call holds up to\n28s and returns `200`); pass the `?async=true` query parameter to get back `202` with an `ss_…` ID\nimmediately.\n\n## Authentication and accounts\n\nEvery request carries a Bearer API key, prefixed `sk_live_`. Manage keys from the [dashboard](https://app.bytekit.com) —\nup to 50 active keys per account, with per-key billing attribution so you can split usage\ncleanly across services.\n\nFull details in the [Authentication guide](https://bytekit.com/docs/guides/authentication).\n\n## Where to go next\n\n- [Quickstart](https://bytekit.com/docs/quickstart) — first call in under five minutes, no SDK required.\n- [Client Libraries](https://bytekit.com/docs/libraries/typescript) — official TypeScript and Python SDKs.\n- [Scraping](https://bytekit.com/docs/guides/scraping) — formats, options, async polling.\n- [Rate Limits](https://bytekit.com/docs/guides/rate-limits) — quota model, concurrency slots, response headers.\n- [Monitors](https://bytekit.com/docs/guides/monitors) — schedule-based change detection with webhooks.\n- [API Reference](https://bytekit.com/docs/api) — every endpoint, request, and response."
370
+ "body": "# Introduction\n\nA REST API for screenshots, scraping, and page-change monitoring — one key, one base URL, every output.\n\n## What ByteKit is\n\nByteKit is a REST API for capturing what a webpage looks like and what it says —\nscreenshots, raw HTML or clean markdown, and page-change monitoring.\nOne API key, one base URL, every output you'd otherwise stitch together from a headless-browser\nfarm and a scraping proxy.\n\n## Integrate in 60 seconds\n\n- **Base URL:** `https://api.bytekit.com`\n- **Auth:** send `Authorization: Bearer $BYTEKIT_API_KEY` on every request. Create a key in the\n [ByteKit dashboard](https://app.bytekit.com) and export it as `BYTEKIT_API_KEY`.\n- **Install:** `npm install @hunt-labs/bytekit-sdk` for TypeScript, or `pip install bytekit-sdk`\n for Python (import name `bytekit`).\n\nThe npm package is `@hunt-labs/bytekit-sdk` — not `bytekit`, which is an unrelated package.\n\nOne call with curl:\n\n```bash\ncurl -X POST https://api.bytekit.com/v1/scrape \\\n -H \"Authorization: Bearer $BYTEKIT_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"url\":\"https://example.com\"}'\n```\n\nThe same call with the TypeScript SDK:\n\n```ts\nimport { ByteKit } from '@hunt-labs/bytekit-sdk';\n\nconst client = new ByteKit({ apiKey: process.env.BYTEKIT_API_KEY! });\nconst result = await client.scrape.create({ url: 'https://example.com', formats: ['markdown'] });\nif (result.status === 'success') {\n console.log(result.metadata.title);\n console.log(result.formats.markdown);\n} else {\n console.log(result); // the queued receipt; a failed scrape throws ByteKitError instead\n}\n```\n\nThe same call with the Python SDK:\n\n```python\nimport os\n\nfrom bytekit import AuthenticatedClient\nfrom bytekit.api.scrape import create_scrape\nfrom bytekit.models import ScrapeRequest, ScrapeRequestFormatsItem, ScrapeSuccessEnvelope\n\nclient = AuthenticatedClient(\n base_url=\"https://api.bytekit.com\",\n token=os.environ[\"BYTEKIT_API_KEY\"],\n)\nresult = create_scrape.sync(\n client=client,\n body=ScrapeRequest(url=\"https://example.com\", formats=[ScrapeRequestFormatsItem.MARKDOWN]),\n)\nif isinstance(result, ScrapeSuccessEnvelope):\n print(result.metadata.title)\n print(result.formats.markdown)\nelse:\n print(result) # the queued receipt or an Error model; a failed scrape raises instead\n```\n\nFull SDK guides: [TypeScript](https://bytekit.com/docs/libraries/typescript) and [Python](https://bytekit.com/docs/libraries/python).\n\n## What you can do with it\n\n- **Scrape** — Fetch a URL as raw HTML, clean markdown, or structured content.\n- **Screenshot** — Capture full-page or viewport PNG/JPEG.\n- **Monitor** — Watch a URL on a schedule and webhook you when the rendered output changes.\n- **Bulk** — Fan out thousands of URLs in parallel and receive a webhook as each finishes.\n- **Sitemap** — Discover URLs from a domain's sitemap or by light crawling.\n\nScrape calls accept an `\"async\": true` body field, in which case the API returns `202` with a `sc_…`\nID that you poll or receive via webhook. Screenshots are synchronous by default (the call holds up to\n28s and returns `200`); pass the `?async=true` query parameter to get back `202` with an `ss_…` ID\nimmediately.\n\n## Authentication and accounts\n\nEvery request carries a Bearer API key, prefixed `sk_live_`. Manage keys from the [dashboard](https://app.bytekit.com) —\nup to 50 active keys per account, with per-key billing attribution so you can split usage\ncleanly across services.\n\nFull details in the [Authentication guide](https://bytekit.com/docs/guides/authentication).\n\n## Where to go next\n\n- [Quickstart](https://bytekit.com/docs/quickstart) — first call in under five minutes, no SDK required.\n- [Client Libraries](https://bytekit.com/docs/libraries/typescript) — official TypeScript and Python SDKs.\n- [Scraping](https://bytekit.com/docs/guides/scraping) — formats, options, async polling.\n- [Rate Limits](https://bytekit.com/docs/guides/rate-limits) — quota model, concurrency slots, response headers.\n- [Monitors](https://bytekit.com/docs/guides/monitors) — schedule-based change detection with webhooks.\n- [API Reference](https://bytekit.com/docs/api) — every endpoint, request, and response."
371
371
  },
372
372
  "libraries": {
373
373
  "title": "Client Libraries",
@@ -417,7 +417,7 @@
417
417
  "sdk/python/client": {
418
418
  "title": "Client",
419
419
  "section": "SDK Reference",
420
- "body": "# Client\n\nThe ByteKit Python SDK provides two client classes for making API requests.\n\n## Client\n\nA class for keeping track of data related to the API\n\nThe following are accepted as keyword arguments and will be used to construct httpx Clients internally:\n\n``base_url``: The base URL for the API, all requests are made to a relative path to this URL\n\n``cookies``: A dictionary of cookies to be sent with every request\n\n``headers``: A dictionary of headers to be sent with every request\n\n``timeout``: The maximum amount of a time a request can take. API functions will raise\nhttpx.TimeoutException if this is exceeded. A connection that never gets established at\nall — DNS failure, refused connection, TLS handshake failure — raises its transport\nsibling httpx.ConnectError instead. Neither is caught by this SDK: both propagate to the\ncaller, on the generated operations and on ``AuthenticatedClient.search`` alike.\n\n``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production,\nbut can be set to False for testing purposes.\n\n``follow_redirects``: Whether or not to follow redirects. Default value is False.\n\n``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor.\n\nAttributes:\nraise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a\nstatus code that was not documented in the source OpenAPI document. Can also be provided as a keyword\nargument to the constructor.\nExplicit constructor arguments always win over these defaults (explicit arg > default).\n\n### with_headers\n\n```python\nwith_headers(headers: dict[str, str]) -> 'Client'\n```\n\nGet a new client matching this one with additional headers\n\n### with_cookies\n\n```python\nwith_cookies(cookies: dict[str, str]) -> 'Client'\n```\n\nGet a new client matching this one with additional cookies\n\n### with_timeout\n\n```python\nwith_timeout(timeout: httpx.Timeout) -> 'Client'\n```\n\nGet a new client matching this one with a new timeout (in seconds)\n\n### set_httpx_client\n\n```python\nset_httpx_client(client: httpx.Client) -> 'Client'\n```\n\nManually set the underlying httpx.Client\n\n**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.\n\n### get_httpx_client\n\n```python\nget_httpx_client() -> httpx.Client\n```\n\nGet the underlying httpx.Client, constructing a new one if not previously set\n\n### set_async_httpx_client\n\n```python\nset_async_httpx_client(async_client: httpx.AsyncClient) -> 'Client'\n```\n\nManually the underlying httpx.AsyncClient\n\n**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.\n\nA client set here is YOURS to manage: the SDK never rebuilds or closes it, even if\nit is later used from a different event loop. Clients the SDK constructs itself are\nrebuilt automatically when the running event loop changes.\n\n### get_async_httpx_client\n\n```python\nget_async_httpx_client() -> httpx.AsyncClient\n```\n\nGet the underlying httpx.AsyncClient, constructing a new one if not previously set\n\n## AuthenticatedClient\n\nA Client which has been authenticated for use on secured endpoints\n\nThe following are accepted as keyword arguments and will be used to construct httpx Clients internally:\n\n``base_url``: The base URL for the API, all requests are made to a relative path to this URL\n\n``cookies``: A dictionary of cookies to be sent with every request\n\n``headers``: A dictionary of headers to be sent with every request\n\n``timeout``: The maximum amount of a time a request can take. API functions will raise\nhttpx.TimeoutException if this is exceeded. A connection that never gets established at\nall — DNS failure, refused connection, TLS handshake failure — raises its transport\nsibling httpx.ConnectError instead. Neither is caught by this SDK: both propagate to the\ncaller, on the generated operations and on ``AuthenticatedClient.search`` alike.\n\n``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production,\nbut can be set to False for testing purposes.\n\n``follow_redirects``: Whether or not to follow redirects. Default value is False.\n\n``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor.\n\nAttributes:\nraise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a\nstatus code that was not documented in the source OpenAPI document. Can also be provided as a keyword\nargument to the constructor.\nExplicit constructor arguments always win over these defaults (explicit arg > default).\ntoken: The token to use for authentication. KEYWORD-ONLY.\nprefix: The prefix to use for the Authorization header. KEYWORD-ONLY.\nauth_header_name: The name of the Authorization header. KEYWORD-ONLY.\nAll three are keyword-only so that the pre-0.3.0 positional call\n``AuthenticatedClient(base_url, token)`` raises TypeError instead of\nsilently binding the base URL to ``token`` and the API key to ``prefix``.\n\n### search\n\n```python\nsearch(query: str, type: Optional[Union['CreateSearchBodyType', Literal['web', 'news', 'images']]] = None, limit: Optional[int] = None, country: Optional[str] = None, language: Optional[str] = None, date_range: Optional[Union['CreateSearchBodyDateRange', Literal['any', 'hour', 'day', 'week', 'month', 'year']]] = None) -> 'CreateSearchResponse200'\n```\n\nRun a web search and return ranked organic results.\n\nThin, statically-declared delegate to the hand-written ``_search`` appended at the\nbottom of this module; the full contract (argument semantics, the\n``errors.UnexpectedStatus`` guarantee) is documented there.\n\n### with_headers\n\n```python\nwith_headers(headers: dict[str, str]) -> 'AuthenticatedClient'\n```\n\nGet a new client matching this one with additional headers\n\n### with_cookies\n\n```python\nwith_cookies(cookies: dict[str, str]) -> 'AuthenticatedClient'\n```\n\nGet a new client matching this one with additional cookies\n\n### with_timeout\n\n```python\nwith_timeout(timeout: httpx.Timeout) -> 'AuthenticatedClient'\n```\n\nGet a new client matching this one with a new timeout (in seconds)\n\n### set_httpx_client\n\n```python\nset_httpx_client(client: httpx.Client) -> 'AuthenticatedClient'\n```\n\nManually set the underlying httpx.Client\n\n**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.\n\n### get_httpx_client\n\n```python\nget_httpx_client() -> httpx.Client\n```\n\nGet the underlying httpx.Client, constructing a new one if not previously set\n\n### set_async_httpx_client\n\n```python\nset_async_httpx_client(async_client: httpx.AsyncClient) -> 'AuthenticatedClient'\n```\n\nManually the underlying httpx.AsyncClient\n\n**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.\n\nA client set here is YOURS to manage: the SDK never rebuilds or closes it, even if\nit is later used from a different event loop. Clients the SDK constructs itself are\nrebuilt automatically when the running event loop changes.\n\n### get_async_httpx_client\n\n```python\nget_async_httpx_client() -> httpx.AsyncClient\n```\n\nGet the underlying httpx.AsyncClient, constructing a new one if not previously set"
420
+ "body": "# Client\n\nThe ByteKit Python SDK provides two client classes for making API requests.\n\nInstall the SDK, create a client, run a scrape and read the markdown:\n\n```python\n# pip install bytekit-sdk (import name: bytekit)\nimport os\n\nfrom bytekit import AuthenticatedClient\nfrom bytekit.api.scrape import create_scrape\nfrom bytekit.models.scrape_request import ScrapeRequest\nfrom bytekit.models.scrape_request_formats_item import ScrapeRequestFormatsItem\nfrom bytekit.models.scrape_success_envelope import ScrapeSuccessEnvelope\n\nclient = AuthenticatedClient(\n base_url=\"https://api.bytekit.com\",\n token=os.environ[\"BYTEKIT_API_KEY\"],\n)\nresult = create_scrape.sync(\n client=client,\n body=ScrapeRequest(url=\"https://example.com\", formats=[ScrapeRequestFormatsItem.MARKDOWN]),\n)\nif isinstance(result, ScrapeSuccessEnvelope):\n print(result.formats.markdown)\n```\n\n## Client\n\nA class for keeping track of data related to the API\n\nThe following are accepted as keyword arguments and will be used to construct httpx Clients internally:\n\n``base_url``: The base URL for the API, all requests are made to a relative path to this URL\n\n``cookies``: A dictionary of cookies to be sent with every request\n\n``headers``: A dictionary of headers to be sent with every request\n\n``timeout``: The maximum amount of a time a request can take. API functions will raise\nhttpx.TimeoutException if this is exceeded. A connection that never gets established at\nall — DNS failure, refused connection, TLS handshake failure — raises its transport\nsibling httpx.ConnectError instead. Neither is caught by this SDK: both propagate to the\ncaller, on the generated operations and on ``AuthenticatedClient.search`` alike.\n\n``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production,\nbut can be set to False for testing purposes.\n\n``follow_redirects``: Whether or not to follow redirects. Default value is False.\n\n``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor.\n\nAttributes:\nraise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a\nstatus code that was not documented in the source OpenAPI document. Can also be provided as a keyword\nargument to the constructor.\nExplicit constructor arguments always win over these defaults (explicit arg > default).\n\n### with_headers\n\n```python\nwith_headers(headers: dict[str, str]) -> 'Client'\n```\n\nGet a new client matching this one with additional headers\n\n### with_cookies\n\n```python\nwith_cookies(cookies: dict[str, str]) -> 'Client'\n```\n\nGet a new client matching this one with additional cookies\n\n### with_timeout\n\n```python\nwith_timeout(timeout: httpx.Timeout) -> 'Client'\n```\n\nGet a new client matching this one with a new timeout (in seconds)\n\n### set_httpx_client\n\n```python\nset_httpx_client(client: httpx.Client) -> 'Client'\n```\n\nManually set the underlying httpx.Client\n\n**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.\n\n### get_httpx_client\n\n```python\nget_httpx_client() -> httpx.Client\n```\n\nGet the underlying httpx.Client, constructing a new one if not previously set\n\n### set_async_httpx_client\n\n```python\nset_async_httpx_client(async_client: httpx.AsyncClient) -> 'Client'\n```\n\nManually the underlying httpx.AsyncClient\n\n**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.\n\nA client set here is YOURS to manage: the SDK never rebuilds or closes it, even if\nit is later used from a different event loop. Clients the SDK constructs itself are\nrebuilt automatically when the running event loop changes.\n\n### get_async_httpx_client\n\n```python\nget_async_httpx_client() -> httpx.AsyncClient\n```\n\nGet the underlying httpx.AsyncClient, constructing a new one if not previously set\n\n## AuthenticatedClient\n\nA Client which has been authenticated for use on secured endpoints\n\nThe following are accepted as keyword arguments and will be used to construct httpx Clients internally:\n\n``base_url``: The base URL for the API, all requests are made to a relative path to this URL\n\n``cookies``: A dictionary of cookies to be sent with every request\n\n``headers``: A dictionary of headers to be sent with every request\n\n``timeout``: The maximum amount of a time a request can take. API functions will raise\nhttpx.TimeoutException if this is exceeded. A connection that never gets established at\nall — DNS failure, refused connection, TLS handshake failure — raises its transport\nsibling httpx.ConnectError instead. Neither is caught by this SDK: both propagate to the\ncaller, on the generated operations and on ``AuthenticatedClient.search`` alike.\n\n``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production,\nbut can be set to False for testing purposes.\n\n``follow_redirects``: Whether or not to follow redirects. Default value is False.\n\n``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor.\n\nAttributes:\nraise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a\nstatus code that was not documented in the source OpenAPI document. Can also be provided as a keyword\nargument to the constructor.\nExplicit constructor arguments always win over these defaults (explicit arg > default).\ntoken: The token to use for authentication. KEYWORD-ONLY.\nprefix: The prefix to use for the Authorization header. KEYWORD-ONLY.\nauth_header_name: The name of the Authorization header. KEYWORD-ONLY.\nAll three are keyword-only so that the pre-0.3.0 positional call\n``AuthenticatedClient(base_url, token)`` raises TypeError instead of\nsilently binding the base URL to ``token`` and the API key to ``prefix``.\n\n### search\n\n```python\nsearch(query: str, type: Optional[Union['CreateSearchBodyType', Literal['web', 'news', 'images']]] = None, limit: Optional[int] = None, country: Optional[str] = None, language: Optional[str] = None, date_range: Optional[Union['CreateSearchBodyDateRange', Literal['any', 'hour', 'day', 'week', 'month', 'year']]] = None) -> 'CreateSearchResponse200'\n```\n\nRun a web search and return ranked organic results.\n\nThin, statically-declared delegate to the hand-written ``_search`` appended at the\nbottom of this module; the full contract (argument semantics, the\n``errors.UnexpectedStatus`` guarantee) is documented there.\n\n### with_headers\n\n```python\nwith_headers(headers: dict[str, str]) -> 'AuthenticatedClient'\n```\n\nGet a new client matching this one with additional headers\n\n### with_cookies\n\n```python\nwith_cookies(cookies: dict[str, str]) -> 'AuthenticatedClient'\n```\n\nGet a new client matching this one with additional cookies\n\n### with_timeout\n\n```python\nwith_timeout(timeout: httpx.Timeout) -> 'AuthenticatedClient'\n```\n\nGet a new client matching this one with a new timeout (in seconds)\n\n### set_httpx_client\n\n```python\nset_httpx_client(client: httpx.Client) -> 'AuthenticatedClient'\n```\n\nManually set the underlying httpx.Client\n\n**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.\n\n### get_httpx_client\n\n```python\nget_httpx_client() -> httpx.Client\n```\n\nGet the underlying httpx.Client, constructing a new one if not previously set\n\n### set_async_httpx_client\n\n```python\nset_async_httpx_client(async_client: httpx.AsyncClient) -> 'AuthenticatedClient'\n```\n\nManually the underlying httpx.AsyncClient\n\n**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.\n\nA client set here is YOURS to manage: the SDK never rebuilds or closes it, even if\nit is later used from a different event loop. Clients the SDK constructs itself are\nrebuilt automatically when the running event loop changes.\n\n### get_async_httpx_client\n\n```python\nget_async_httpx_client() -> httpx.AsyncClient\n```\n\nGet the underlying httpx.AsyncClient, constructing a new one if not previously set"
421
421
  },
422
422
  "sdk/python/fetch": {
423
423
  "title": "Fetch",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hunt-labs/bytekit-mcp",
3
- "version": "0.3.16",
3
+ "version": "0.3.17",
4
4
  "description": "ByteKit MCP server — exposes ByteKit web-data tools (scrape, screenshot, search, docs) to AI agents over the Model Context Protocol, hosted or as a local stdio server.",
5
5
  "license": "MIT",
6
6
  "type": "module",