@hunt-labs/bytekit-mcp 0.3.4 → 0.3.5
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 +44 -0
- package/dist/docs-bundle/docs-bundle.json +46 -46
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,50 @@ today, see [README.md](./README.md), which remains the authoritative usage guide
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
## [0.3.5] - 2026-09-06
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- Refreshed the bundled documentation snapshot after the TypeScript and Python SDK changelog
|
|
18
|
+
entries for #4251, which correct `GET /v1/usage`'s `topup_balance_bytes` description to name
|
|
19
|
+
the one-time starter grant alongside the purchased top-up lots it already named. The only
|
|
20
|
+
bundled bytes that move are on the `changelog` page. That page concatenates four package
|
|
21
|
+
changelogs and is cut at the same 16,384-byte per-page bound: the TypeScript SDK entry lands
|
|
22
|
+
near the top of the page, inside the bundled body, while the Python SDK entry is past the cut
|
|
23
|
+
and is only reachable at https://bytekit.com/docs/changelog. Bundled content only: no tool,
|
|
24
|
+
schema or transport change.
|
|
25
|
+
- Refreshed the bundled documentation snapshot after the TypeScript and Python SDK changelog
|
|
26
|
+
entries for #4237, which record that `GET /v1/scrape/{id}` reports `cache: hit` without the
|
|
27
|
+
scrape envelope's `cache_age_s` field. The only bundled bytes that move are on the `changelog`
|
|
28
|
+
page. That page concatenates four package changelogs and is cut at the same 16,384-byte
|
|
29
|
+
per-page bound: the TypeScript SDK entry lands near the top of the page, inside the bundled
|
|
30
|
+
body, while the Python SDK entry is past the cut and is only reachable at
|
|
31
|
+
https://bytekit.com/docs/changelog. Bundled content only: no tool, schema or transport change.
|
|
32
|
+
- Refreshed the bundled documentation snapshot after the TypeScript and Python SDK changelog
|
|
33
|
+
entries for #4203, which record `GET /v1/scrape/{id}` as a third delivery path for the scrape
|
|
34
|
+
envelope's `cache` field. The only bundled bytes that move are on the `changelog` page. That
|
|
35
|
+
page concatenates four package changelogs and is cut at the same 16,384-byte per-page bound: the
|
|
36
|
+
TypeScript SDK entry lands near the top of the page, inside the bundled body, while the Python
|
|
37
|
+
SDK entry is past the cut and is only reachable at https://bytekit.com/docs/changelog. Bundled
|
|
38
|
+
content only: no tool, schema or transport change.
|
|
39
|
+
- Refreshed the bundled documentation snapshot after the TypeScript SDK's `0.9.4` changelog entry
|
|
40
|
+
for #3984. The only bundled bytes that move are on the `changelog` page. That page concatenates
|
|
41
|
+
four package changelogs and is cut at the same 16,384-byte per-page bound; the added entry lands
|
|
42
|
+
near the top of the page, inside the bundled body. Bundled content only: no tool, schema or
|
|
43
|
+
transport change.
|
|
44
|
+
- Regenerated the bundled documentation corpus so the offline docs describe monitor
|
|
45
|
+
`scrape_options` correctly (#4024): the description no longer lists `headers` among the
|
|
46
|
+
accepted fields, since `POST /v1/monitors` never honoured a caller-supplied `headers`
|
|
47
|
+
option and now rejects it with the same 400 every other capture endpoint returns for the
|
|
48
|
+
field. No tool, argument or output shape changed.
|
|
49
|
+
- Refreshed the bundled documentation snapshot after the TypeScript SDK's `0.9.4` changelog entry
|
|
50
|
+
for #4030, which records the third case in which `X-Scrape-Proxy-Tier-Label` reports no tier: a
|
|
51
|
+
response replayed from stored bytes after this request's own cache lookup missed, which arrives
|
|
52
|
+
as `X-Scrape-Cache: miss`. Bundled content only: no tool, schema or transport change.
|
|
53
|
+
- Refreshed the bundled documentation snapshot after the TypeScript SDK's `0.9.4` changelog entry
|
|
54
|
+
for #4132, which qualifies that third case as an internal deploy-skew safeguard no API request
|
|
55
|
+
can reach. Bundled content only: no tool, schema or transport change.
|
|
56
|
+
|
|
13
57
|
## [0.3.4] - 2026-09-04
|
|
14
58
|
|
|
15
59
|
### Changed
|
|
@@ -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"
|
|
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- `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`"
|
|
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.\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"
|
|
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- `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 is\n exhausted. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth; `/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`"
|
|
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."
|
|
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- `estimated_credits`\n- `webhook_url`\n\n### 404 — Resource not found.\n- `status`\n- `error`"
|
|
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"
|
|
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- `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- `estimated_credits`\n- `webhook_url`\n\n### 404 — Resource not found.\n- `status`\n- `error`"
|
|
36
36
|
},
|
|
37
37
|
"api/bulk/listbulk": {
|
|
38
38
|
"title": "List in-flight bulk jobs",
|
|
39
39
|
"section": "API Reference",
|
|
40
|
-
"body": "# List in-flight bulk jobs\n\nReturns the caller's bulk jobs, most recent first. Optionally filter\nto a single status; when omitted, jobs of every status are returned.\n"
|
|
40
|
+
"body": "# List in-flight bulk jobs\n\nReturns the caller's bulk jobs, most recent first. Optionally filter\nto a single status; when omitted, jobs of every status are returned.\n\n**GET** `/v1/bulk`\n\n## Parameters\n\n- `status` (query, string)\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- `estimated_credits`\n- `webhook_url`\n\n### 422 — Validation error. Returned when `status` is not one of the documented values.\n- `status`\n- `error`"
|
|
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.** `image_url` (`type: screenshot`) and both
|
|
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`"
|
|
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.).\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"
|
|
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- `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 is\n exhausted. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth; `/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`"
|
|
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, carry
|
|
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- `estimated_credits`\n- `webhook_url`\n- `next_cursor`\n- `has_more`\n- `items`\n\n### 202 — Bulk job still processing. `routes/fetch-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; a\n**cancelled** job stays on this branch forever (issue #3533).\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- `estimated_credits`\n- `webhook_url`\n- `next_cursor`\n- `has_more`\n- `items`\n\n### 404 — Resource not found.\n- `status`\n- `error`"
|
|
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"
|
|
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 is\n exhausted. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth; `/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).\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### 502 — Content transform failed, or a non-2xx upstream response relayed as the unified\nError envelope. On an upstream relay the HTTP status equals the upstream status\n(code `upstream_error`), so any 4xx/5xx the target returns surfaces here as an\nError envelope rather than a raw body (#1462).\n\n**One divergence.** An upstream `502` is relayed at HTTP `503`, not `502` — see\nthe `503` response below. A fetch service that cannot be reached also answers\n`503`, not `502` (#3373); this status no longer covers that condition.\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`, relayed here as `503`.\n Cloudflare fronts this API and replaces a clean origin 502 with its own generic\n `text/plain` error page, discarding the envelope before it reaches you, while a\n 503 is passed through unchanged. The body's `error.http_status` still reports\n the **true upstream status**, `502` — not `503` — and is the only surviving\n record of what the target answered, so the body rather than the HTTP status is\n authoritative here (#3355).\n- **`internal_error`** (message `Fetch service unavailable.`) — the fetch service\n could not be reached at all. There is no upstream status to preserve: the `503`\n is this API's own choice of wire status, so the body's `error.http_status`\n reports `503`, mirroring what was served (#3373).\n- `status`\n- `error`"
|
|
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"
|
|
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 is\n exhausted. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth; `/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 field).\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### 502 — Content transform failed, or a non-2xx upstream response relayed as the unified\nError envelope. On an upstream relay the HTTP status equals the upstream status\n(code `upstream_error`), so any 4xx/5xx the target returns surfaces here as an\nError envelope rather than a raw body (#1462).\n\n**One divergence.** An upstream `502` is relayed at HTTP `503`, not `502` — see\nthe `503` response below. A fetch service that cannot be reached also answers\n`503`, not `502` (#3373); this status no longer covers that condition.\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`, relayed here as `503`.\n Cloudflare fronts this API and replaces a clean origin 502 with its own generic\n `text/plain` error page, discarding the envelope before it reaches you, while a\n 503 is passed through unchanged. The body's `error.http_status` still reports\n the **true upstream status**, `502` — not `503` — and is the only surviving\n record of what the target answered, so the body rather than the HTTP status is\n authoritative here (#3355).\n- **`internal_error`** (message `Fetch service unavailable.`) — the fetch service\n could not be reached at all. There is no upstream status to preserve: the `503`\n is this API's own choice of wire status, so the body's `error.http_status`\n reports `503`, mirroring what was served (#3373).\n- `status`\n- `error`"
|
|
76
76
|
},
|
|
77
77
|
"api/health": {
|
|
78
78
|
"title": "Health",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"api/health/healthcheck": {
|
|
83
83
|
"title": "Health check",
|
|
84
84
|
"section": "API Reference",
|
|
85
|
-
"body": "# Health check"
|
|
85
|
+
"body": "# Health check\n\n**GET** `/health`\n\n## Responses\n\n### 200 — Service is healthy.\n- `status`"
|
|
86
86
|
},
|
|
87
87
|
"api/monitors": {
|
|
88
88
|
"title": "Monitors",
|
|
@@ -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"
|
|
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`"
|
|
96
96
|
},
|
|
97
97
|
"api/monitors/deletemonitor": {
|
|
98
98
|
"title": "Cancel monitor",
|
|
99
99
|
"section": "API Reference",
|
|
100
|
-
"body": "# Cancel monitor"
|
|
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`"
|
|
101
101
|
},
|
|
102
102
|
"api/monitors/getmonitor": {
|
|
103
103
|
"title": "Get monitor",
|
|
104
104
|
"section": "API Reference",
|
|
105
|
-
"body": "# Get monitor"
|
|
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`"
|
|
106
106
|
},
|
|
107
107
|
"api/monitors/listmonitorcaptures": {
|
|
108
108
|
"title": "List monitor captures",
|
|
109
109
|
"section": "API Reference",
|
|
110
|
-
"body": "# List monitor captures"
|
|
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`"
|
|
111
111
|
},
|
|
112
112
|
"api/monitors/listmonitors": {
|
|
113
113
|
"title": "List monitors",
|
|
114
114
|
"section": "API Reference",
|
|
115
|
-
"body": "# List monitors"
|
|
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`"
|
|
116
116
|
},
|
|
117
117
|
"api/monitors/updatemonitor": {
|
|
118
118
|
"title": "Update monitor",
|
|
119
119
|
"section": "API Reference",
|
|
120
|
-
"body": "# Update monitor"
|
|
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`"
|
|
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"
|
|
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`"
|
|
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_url`.\n\nDual-axis billing: a fixed per-request credit charge **plus** the\nunderlying page's bandwidth, billed exactly like `/v1/scrape`. 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"
|
|
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_url`.\n\nDual-axis billing: a fixed per-request credit charge **plus** the\nunderlying page's bandwidth, billed exactly like `/v1/scrape`. 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 slow-path URL (`unsupported_url`).\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 is\n exhausted. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth; `/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### 502 — Underlying scrape failed (`scrape_failed`) or upstream provider error (`provider_error`).\n- `status`\n- `error`\n\n### 503 — Extraction provider unconfigured (`provider_unavailable`).\n- `status`\n- `error`\n\n### 504 — Upstream provider timed out (`provider_timeout`).\n- `status`\n- `error`"
|
|
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.\
|
|
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- `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 is\n exhausted. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth; `/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`"
|
|
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"
|
|
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- `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- `estimated_credits`\n- `webhook_url`\n- `next_cursor`\n- `has_more`\n- `items`\n\n### 404 — Resource not found.\n- `status`\n- `error`"
|
|
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.
|
|
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 happens before any job row exists, so its envelope carries `id: 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- `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 ends before any job row exists, so its envelope carries `id: null` and there is nothing to poll; `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 is\n exhausted. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth; `/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`"
|
|
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
|
|
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`"
|
|
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"
|
|
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 is\n exhausted. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth; `/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`"
|
|
181
181
|
},
|
|
182
182
|
"api/screenshots/getscreenshot": {
|
|
183
183
|
"title": "Get screenshot status",
|
|
184
184
|
"section": "API Reference",
|
|
185
|
-
"body": "# Get screenshot status"
|
|
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`"
|
|
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"
|
|
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 is\n exhausted. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth; `/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### 502 — Upstream search provider error. 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"
|
|
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 is\n exhausted. Capture endpoints (`/v1/scrape`, `/v1/fetch`,\n `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter\n bandwidth; `/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`"
|
|
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"
|
|
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`"
|
|
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"
|
|
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_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`"
|
|
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"
|
|
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`"
|
|
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."
|
|
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`"
|
|
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"
|
|
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`"
|
|
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"
|
|
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`"
|
|
246
246
|
},
|
|
247
247
|
"billing": {
|
|
248
248
|
"title": "Billing",
|
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
"changelog": {
|
|
278
278
|
"title": "Changelog",
|
|
279
279
|
"section": "General",
|
|
280
|
-
"body": "# Changelog\n\nRelease history for the ByteKit SDKs, CLI, and MCP server\n\nEach section below is the `CHANGELOG.md` kept alongside that client’s source in the ByteKit\nrepository. Entries record what a release changed, including names and options it retired.\n\n## @hunt-labs/bytekit-sdk\n\nTypeScript SDK, published on npm.\n\n### [Unreleased]\n\n### [0.9.3] - 2026-09-04\n\n#### Changed\n\n- Regenerated `src/generated/api.d.ts` against the corrected queued-scrape `status_url`\n documentation (#3925). `status_url` is a root-relative path, never an absolute URI: join it\n onto the API base URL you called (`https://api.bytekit.com`, no trailing slash) to get the URL\n to poll. The spec had declared it `format: uri` with an absolute example, which no server has\n ever emitted; the emitted value is unchanged, so no client behaviour moves.\n- Regenerated `src/generated/api.d.ts` against the documented proxy-tier response headers\n (#3926). `X-Scrape-Proxy-Tier-Label` now documents that it reports the tier that ACTUALLY\n served a scrape — after any escalation, never the tier first attempted — that it is\n diagnostic only, and that it is omitted on a cache hit, which replayed stored bytes and ran\n no tier. The deprecated numeric `X-Scrape-Proxy-Tier` documents the legacy `1` datacenter /\n `2` residential / `3` mobile vocabulary and its omission for the lean-browser tier. Types are\n unchanged; only the documentation on them moved.\n\n### [0.9.2] - 2026-09-03\n\n#### Changed\n\n- **Breaking (API):** the scrape `formats` vocabulary is now `raw | markdown | links | images`\n (#3775). The unprocessed-source format is called `raw` — it has returned JSON, XML and plain\n text alongside HTML since #1853, so the old raw-HTML name misdescribed it — and the\n cleaned-article-HTML format is gone. The server accepts no alias for either retired value, so\n a request naming one now comes back `422` with the new set in the message. Update `formats`\n and read the content back from `formats.raw`:\n\n ```ts\n const result = await client.scrape.create({ url, formats: ['raw', 'markdown'] });\n console.log(result.formats.raw);\n ```\n\n- Regenerated `src/generated/api.d.ts` against the documented `402` contract (#3784). Every\n quota-enforced operation now declares `402` through one shared `PaymentRequired` response, and\n the `X-Quota-*` headers are referenced by the operations that actually emit them. Types only —\n no runtime behavior changed.\n\n- The generated `events` field description on the scrape request type now documents the\n widened server default (`queued`, `completed`, `failed`) and that a caller may send an\n explicit subset to receive fewer deliveries (#3777). Types/docs only — this regeneration\n followed a server-side default change; the SDK carried no logic tied to the old default.\n\n### [0.9.1] - 2026-08-25\n\n#### Fixed\n\n- The generated `paths` type for the `200` of `GET /v1/scrape/bulk/{id}` now declares `items`\n (#3632). The route builds one body and varies only the status code, so the terminal `200`\n has always carried the per-URL scrape envelopes — but only the `202` documented them, so\n `scrape.bulk.get()` typed the results away at exactly the poll that has them. Types only:\n the field was already on the wire, and server behavior is unchanged.\n\n- The generated `paths` types now describe the `202` that `GET /v1/scrape/bulk/{id}`,\n `GET /v1/fetch/bulk/{id}` and `GET /v1/bulk/{id}` already serve while a bulk job is\n non-terminal (#3533). Each of the three returns 202 with the job envelope until the job is\n terminal and 200 afterwards, but only the 200 was declared, so anything typed off the spec\n had no shape for the response the very first poll receives. Types only: `scrape.bulk.get()`,\n `fetch.bulk.get()` and `bulk.get()` already resolved the body on any 2xx, and server behavior\n is unchanged.\n\n#### Changed\n\n- The generated `topup_balance_bytes` description on `GET /v1/usage` now states that the value is\n the remaining purchased top-up bytes, already net of any overage consumed against them (#3459).\n Types only: the field's name, type and wire format are unchanged. The server previously\n subtracted the consumed overage a second time when computing this value, so the number a client\n reads is larger than before for accounts that ran past their included allowance.\n\n### [0.9.0] - 2026-08-20\n\n#### Removed\n\n- **BREAKING: the `cookies` and `headers` request-body fields are gone from every capture\n endpoint** (#3242) — `/v1/scrape`, `/v1/scrape/bulk`, `/v1/screenshots`, `/v1/recordings` and\n `/v1/schema`. A request that carries either field is rejected with `400 validation_error`; it\n is not ignored, and there is no deprecation window, feature flag, or compatibility header.\n `ScrapeOpts.cookies`, `ScrapeOpts.headers` and the exported `ScrapeCookie` type are removed\n from the SDK surface, so a call that still passes them no longer compiles.\n\n ```ts\n // before — compiled, and the values were forwarded to the target site\n await client.scrape.create({ url, cookies: [{ name: 'session', value: 'abc' }] });\n // after — does not compile; the same body over raw HTTP is a 400 validation_error\n await client.scrape.create({ url });\n ```\n\n ByteKit continues to manage its own cookie jar and request headers internally; what was removed\n is the caller's ability to inject or override them.\n\n#### Changed\n\n- **The generated types now declare the `503` response of `GET`/`POST /v1/fetch`** (#3372).\n `/v1/fetch` answers `503` on two conditions and both carry the ordinary `Error` envelope, so\n a typed consumer reading `operations['getFetch']['responses']` / `['postFetch']` can handle it\n instead of meeting an undeclared status at runtime. Read `error.code` to tell the two apart,\n because they disagree about `error.http_status`:\n - `upstream_error` — the target returned HTTP `502`, relayed at `503` because Cloudflare\n replaces a clean origin 502 with its own error page. `error.http_status` stays `502`, the\n **true upstream status**, and is the only surviving record of what the target answered.\n - `internal_error` (`Fetch service unavailable.`) — the fetch service was unreachable. There\n is no upstream, so `error.http_status` reports `503`, matching what was served.\n\n No runtime behaviour changes, and every other documented `/v1/fetch` status is unaffected.\n\n### [0.8.0] - 2026-08-19\n\n#### Removed\n\n- **BREAKING: `billing_multiplier` and `billed_bytes` are gone from the scrape success\n envelope** (#3143). Read `billing` instead — a `BillingNode` that names every factor\n applied to the charge, the multiplier they compose to, and the resulting billed bytes:\n\n ```ts\n // before\n const spend = res.billed_bytes; // flat, base-endpoint only\n // after\n const spend = res.billing?.billed_bytes;\n const why = res.billing?.factors; // [{ name: 'endpoint', value: 1.5, reason: 'scrape_md' }, …]\n ```\n\n This is a correction, not a rename: the two surfaces reported **different numbers for the\n same charge**. The flat pair carried the BASE-endpoint composition, so a markdown cache hit\n read `0.5` / `400` while the real charge — and the `X-Billing-Multiplier` header — was\n `0.75` / `600`; an html-only miss read the per-format credits estimate `1.5` / `150` against\n an endpoint factor of `1.0` / `100`. The flat pair also never carried the `clean_markdown`\n ×3 surcharge, so on a successful clean it under-reported the amount billed by two thirds.\n `billing.multiplier` composes every applied factor behind exactly one rounding, so it is the\n number that predicts your invoice.\n\n `billing` is optional and is **absent** on resources that completed before the billing node\n existed. A pre-node row omits the field rather than reporting a zero node, because a zero\n node would assert that a real past charge was zero. Test the node for presence\n (`res.billing !== undefined`, or equivalently a plain truthiness check — `billing` is an\n object or `undefined`, and an object is always truthy, so the two are the same test here).\n The hazard is a condition that reaches _into_ the node: `if (res.billing?.billed_bytes)`\n silently skips a genuine zero-byte charge, because `0` is falsy. Check that the node is\n present, then read `billed_bytes` from it.\n\n ```ts\n // wrong — a real 0-byte charge is falsy and disappears\n if (res.billing?.billed_bytes) record(res.billing.billed_bytes);\n // right — presence first, value second\n if (res.billing) record(res.billing.billed_bytes); // 0 is a charge, not an absence\n ```\n\n Two endpoints deliberately carry no node: `/v1/search` is billed per credit and reports\n `credits_used`, and a single `/v1/fetch` reports its charge through response headers only.\n The `/v1/logs` row field named `billing_multiplier` is a **different field** and is not the\n envelope field this release removed. It carries the BASE settled `credits_charged` factor,\n not the composed real-endpoint value the `X-Billing-Multiplier` header reports — a markdown\n cache hit reads `0.5` on the logs row and `0.75` on the header.\n\n#### Changed\n\n- Generated `ScrapeErrorEnvelope` types now describe terminal asynchronous `scrape.failed`\n webhook delivery (#1856). No runtime SDK behavior or API shape changed.\n\n#### Fixed\n\n- **`GET /v1/logs` entries now carry `billing_multiplier`, as a JSON number** (#3022). The\n gateway had been serializing that value under an undeclared key `credits`, and as the raw\n Postgres `NUMERIC(10,2)` string (`\"1.50\"`), while the OpenAPI spec — and therefore the\n generated types in `src/generated/api.d.ts` — declared `billing_multiplier?: number | null`.\n Anything typed against this package read `undefined` for the field.\n\n **Breaking at the wire level:** the undeclared `credits` key is gone from every `/v1/logs`\n entry. Code that reached past the generated types to read `credits` must read\n `billing_multiplier`. No SDK method exposes this endpoint, so the only change inside this\n package is the regenerated type description.\n\n- **`change_threshold` (on `monitors.create`/`monitors.list`/`monitors.get`/\n `monitors.update` responses) and `change_pct` (on `monitors.captures.list` entries)\n now serialize as JSON numbers, not strings** (#3021). Both are Postgres `NUMERIC(5,2)`\n columns; the gateway passed the raw driver string through unconverted (`\"5.00\"` /\n `\"7.25\"`) while the OpenAPI spec's _request_ schemas already declared `number` — only\n the _response_ schemas had been (incorrectly) edited to match the buggy string output.\n This release fixes the gateway serializer and corrects the two response schemas to\n `number` / `number | null`, so spec and runtime now agree.\n\n **Breaking at the wire level:** `client.monitors.create()`, `client.monitors.list()`,\n `client.monitors.get()`, and `client.monitors.update()` now return a JS number for\n `change_threshold` instead of a string (screenshot-type monitors only); the create\n response's `MonitorCreateResponse` and every other monitor route serialize through the\n same `MonitorResponse` schema, so all four are affected identically.\n `client.monitors.captures.list()` now returns a JS number for `change_pct` instead of a\n string. Code doing `parseFloat(monitor.change_threshold)` or template-literal\n interpolation keeps working; strict `typeof x === 'string'` checks or string methods\n (`.trim()`, `.padStart()`) will now throw. `change_pct` is `null` (not `0`) when there is\n no prior capture to diff against, unchanged from before. No SDK method-level shape\n changed otherwise — the only change inside this package is the regenerated type\n description.\n\n### [0.7.4] - 2026-08-19\n\n#### Changed\n\n- **`gen:version` no longer runs as part of `build`** (#3144). `scripts/gen-version.ts` writes\n `src/version.ts`, a _tracked_ source file, and it was chained into the `build` script. That made\n a build silently rewrite committed source whenever the file disagreed with the manifest: local\n runs went green on a tree CI could fail, the resulting ` M src/version.ts` was indistinguishable\n from routine build noise, and in CI the outcome depended on whether Turbo's build cache hit\n (restoring `dist/**` without re-running the generator) or missed. `build` now starts at\n `rm -rf dist ...`, so building this package touches nothing tracked. This changes `prepack` /\n `prepublishOnly` behavior too: both call `build`, so the publish path now reads the committed\n `src/version.ts` rather than regenerating it, and the committed value is what ships.\n- **New `gen:version-check` script**, `pnpm gen:version && git diff --exit-code src/version.ts`,\n mirroring the existing `gen:types-check` in the same manifest. It runs in `.woodpecker/ci.yaml`'s\n `types-drift` step, so a manifest bump without the matching `src/version.ts` regeneration now\n fails a named PR check instead of reaching `staging`. `src/__tests__/version-parity.test.ts`\n stays in place as the in-suite assertion; the gate is what makes its failure reachable before\n merge rather than after.\n\nNo runtime or type changes. `SDK_VERSION` and the `X-ByteKit-Client: sdk_ts/<version>` affix\nbehave exactly as before.\n\n### [0.7.3] - 2026-08-18\n\n#### Changed\n\n- **`XFetchContentLength`'s description no longer calls the header a wire-byte count** (#3133).\n `X-Fetch-Content-Length` is the byte length of the response body actually served: on a\n passthrough `/v1/fetch` (no `format`) that is the relayed upstream payload, so it does equal\n the upstream wire bytes — but with `format=html` or `format=markdown` the gateway overwrites\n it with the transformed document's length, which is typically far smaller than what is billed.\n The old description therefore read as a billing discrepancy on every transform request. Billing\n is unchanged and has always used the upstream compressed wire bytes reported by `X-Raw-Bytes` /\n `X-Billable-Bytes`. Generated-type comments only; no type or runtime behavior changes.\n\n### [0.7.2] - 2026-08-17\n\n#### Changed\n\n- **`ScrapeResponses.202`'s headers no longer advertise `X-Raw-Bytes`, `X-Billable-Bytes`, or\n `X-Billing-Multiplier`** (#3068). The gateway's async `/v1/scrape` path only ever emitted\n `X-Scrape-ID` and `X-Scrape-Status: queued` on a 202 — a queued scrape has no finalized byte\n charge yet — but `docs/api/openapi.yaml` documented the billing-transparency trio there too,\n so `src/generated/api.d.ts` typed three response headers the runtime never sends. This corrects\n the generated type to match the gateway's actual behavior; it does not change any runtime\n behavior. The synchronous `200` response, and `/v1/screenshots`' `202` (which does finalize a\n charge before responding), are unaffected.\n\n### [0.7.1] - 2026-08-11\n\n#### Changed\n\n- **Generated types follow the spec's corrected error and format vocabularies** (#2959). Two\n vocabulary corrections in `docs/api/openapi.yaml` flow through `src/generated/api.d.ts`:\n - `ScrapeErrorEnvelope.error.code` no longer lists `quota_exhausted`. The API has emitted\n `quota_exceeded` since #1539 and there is no throw site for `quota_exhausted` anywhere in\n the gateway, so this removes a code that has never been sent — not one that stops being\n sent. A consumer switching on it was matching a branch that could not be reached; the\n live code for an exceeded quota is `quota_exceeded`. `invalid_url`, which the API does\n emit, is unchanged and still listed.\n - `createBulk`'s `formats` now spells the raw-HTML value `raw_html`, matching `ScrapeRequest`\n and `createScrapeBulk`. `/v1/bulk` previously accepted only the internal `rawHtml`\n spelling and the spec documented that; it now accepts both, so the one endpoint that\n disagreed with the rest of the surface no longer does. `rawHtml` keeps working.\n\n#### Added\n\n- **`ByteKitError.headers` — the failing response's headers, so you can write your own backoff**\n (#2957). This SDK performs exactly one `fetch` per call and never retries, deliberately, so that\n retry policy stays the caller's. But the policy was unwritable: `ByteKitError` carried no\n headers and `re\n\n---\n[Truncated to the 16384-byte per-page limit — this page is 159714 bytes in full. The text cut here is not searchable either: search_docs matches only the part kept above. Read all of it at https://bytekit.com/docs/changelog]"
|
|
280
|
+
"body": "# Changelog\n\nRelease history for the ByteKit SDKs, CLI, and MCP server\n\nEach section below is the `CHANGELOG.md` kept alongside that client’s source in the ByteKit\nrepository. Entries record what a release changed, including names and options it retired.\n\n## @hunt-labs/bytekit-sdk\n\nTypeScript SDK, published on npm.\n\n### [Unreleased]\n\n### [0.10.0] - 2026-09-11\n\n#### Changed\n\n- **A terminal `POST /v1/scrape` failure now throws instead of resolving (#1870).** The\n gateway used to report an upstream fetch failure — unreachable host, refused connection,\n or bot protection that defeated every proxy tier — as HTTP 503; it now answers **HTTP 200**\n with the canonical `failed` envelope (`id: null`), because a definitive upstream outcome is\n a result, not a transport error. `!response.ok` was this SDK's only failure seam, so without\n this change that body would resolve like a success and silence every caller's `catch`.\n `scrape.create` (and any `request` / `requestWithResponse` call to `POST /v1/scrape`) now\n raises `ByteKitError` carrying the envelope's `code` and `message`, the **actual** status\n `200`, the response headers, and `error.details` when one is supplied. A legacy 503 from a\n not-yet-upgraded gateway still throws through the unchanged non-2xx decoder, so the SDK\n works against both. **Upgrade note:** if you inspected `result.status === 'failed'` after\n `scrape.create`, move that handling into a `catch`.\n- Everything else is untouched: `scrape.get(id)`, bulk item results, and every other endpoint\n still deliver `failed` as data; `requestRaw` (`/v1/fetch`) never parses JSON and is\n unaffected; 204 and empty-body handling are unchanged. `request()` now delegates to\n `requestWithResponse()` so the guard has a single application site — identical in every\n observable respect but the return value, as both were already documented.\n\n### [0.9.4] - 2026-09-06 [NEVER PUBLISHED]\n\n**This version was cut but NEVER PUBLISHED — npm `latest` goes from 0.9.3 straight to 0.10.0.**\nPublication is triggered by CI on `main` from the version the manifest declares, and 0.10.0\n(#1870) superseded 0.9.4 in the tree before any release reached `main`. Everything below\nreaches consumers in the **0.10.0** artifact, which contains all of it; nothing is installable\nat 0.9.4: `npm i @hunt-labs/bytekit-sdk@0.9.4` fails.\n\n#### Added\n\n- Bulk fetch, scrape, and mixed-result reads now accept optional cursor, limit, and status\n page parameters while preserving the existing `(id, requestOptions?)` call shape (#3717).\n Generated response types publish stable item identities, page cursors and completeness,\n whole-job counters, exact mixed artifact keys, artifact warnings, bounded webhook recovery\n metadata, and the `artifact_unavailable` error contract.\n\n#### Fixed\n\n- Corrected the artifact-URL fallback documentation on `GET /v1/bulk/{id}/screenshots`\n (`image_url`, `content_url`, `markdown_url`) and `GET /v1/logs` (`artifact_url`) (#3717).\n Those fields were documented as null-plus-`artifact_unavailable` when no signature can be\n minted; the servers have always returned the row's stored value unchanged instead — `null`\n while nothing is stored, and otherwise the private unsigned storage URL, which answers `401`\n — and raise no warning. `GET /v1/fetch/bulk/{id}` does null the field and report\n `artifact_unavailable`, and its documentation is unchanged. No server behaviour changed and\n no type moved; the descriptions now match what the endpoints return.\n\n#### Changed\n\n- Regenerated `src/generated/api.d.ts` against the corrected `topup_balance_bytes` description\n on `GET /v1/usage` (#4251). The description read \"Remaining purchased top-up bytes\", which\n contradicted its own \"Equal to `topup_bytes`\" clause: the value covers purchased top-up lots\n and the one-time starter grant, which is what the endpoint has always returned. The clause\n recording that the figure is already net of consumed overage, and the \"Present only in\n dual/bytes billing mode\" clause, are both unchanged and still true. Types are unchanged and\n no server value changed; only the documentation on them moved.\n- Regenerated `src/generated/api.d.ts` against the clarified `cache_age_s` description on\n `ScrapeSuccessEnvelope` (#4237). The description now records that `GET /v1/scrape/{id}`\n reports `cache: hit` without `cache_age_s`: the age is a property of the replay that happened\n at completion time, is not persisted on the row, and cannot be derived honestly afterwards.\n The one-directional \"Present only on `cache: hit`\" clause is unchanged and still true. Types\n are unchanged; only the documentation on them moved.\n- Regenerated `src/generated/api.d.ts` against the completed `cache` presence list on\n `ScrapeSuccessEnvelope` (#4203). The field's description now names `GET /v1/scrape/{id}` as a\n third delivery path, alongside the synchronous response and webhook delivery: a polled scrape\n now reports the cache disposition its row recorded, and omits the field — rather than\n defaulting it to `miss` — for a row that recorded none. Types are unchanged; only the\n documentation on them moved.\n- Regenerated `src/generated/api.d.ts` against the corrected `PUT /v1/billing/auto-topup`\n request body (#3984). `monthly_cap_cents` is now typed `number | null`: an explicit `null` is\n the wire representation of \"no monthly cap\", and it is what the endpoint has always accepted —\n the request schema simply never documented it, while the 200 response schema already did.\n Omitting the key while `enabled` is `true` is still rejected with `422`, so send `null`\n rather than dropping the field. No server behaviour changes; the type widens to match what\n the API already accepted.\n- Regenerated `src/generated/api.d.ts` against the corrected monitor `scrape_options`\n documentation (#4024). The description no longer lists `headers` among the accepted\n fields — `POST /v1/monitors` never honoured a caller-supplied `headers` option and now\n rejects it with the same 400 every other capture endpoint returns for the field. Types are\n unchanged; only the documentation on them moved.\n- Regenerated `src/generated/api.d.ts` against the completed `X-Scrape-Proxy-Tier-Label`\n omission list (#4030). The header's description now names a third case in which no tier is\n reported: a response replayed from stored bytes after this request's own cache lookup missed,\n which arrives as `X-Scrape-Cache: miss` and likewise ran no proxy tier. The two cases already\n documented — a cache hit, and responses the fast path did not serve — are unchanged. Types are\n unchanged; only the documentation on them moved.\n- Regenerated `src/generated/api.d.ts` against the qualified `X-Scrape-Proxy-Tier-Label`\n omission list (#4132). The third case that list records — a response replayed from stored bytes\n after this request's own cache lookup missed — is not reachable through this API: every caller\n of the internal fetch path closes the handler branch that produces it, and the branch survives\n only as a deploy-skew safeguard. The description now says so rather than presenting the case as\n ordinary behaviour. The two reachable cases — a cache hit, and responses the fast path did not\n serve — are unchanged. Types are unchanged; only the documentation on them moved.\n\n### [0.9.3] - 2026-09-04\n\n#### Changed\n\n- Regenerated `src/generated/api.d.ts` against the corrected queued-scrape `status_url`\n documentation (#3925). `status_url` is a root-relative path, never an absolute URI: join it\n onto the API base URL you called (`https://api.bytekit.com`, no trailing slash) to get the URL\n to poll. The spec had declared it `format: uri` with an absolute example, which no server has\n ever emitted; the emitted value is unchanged, so no client behaviour moves.\n- Regenerated `src/generated/api.d.ts` against the documented proxy-tier response headers\n (#3926). `X-Scrape-Proxy-Tier-Label` now documents that it reports the tier that ACTUALLY\n served a scrape — after any escalation, never the tier first attempted — that it is\n diagnostic only, and that it is omitted on a cache hit, which replayed stored bytes and ran\n no tier. The deprecated numeric `X-Scrape-Proxy-Tier` documents the legacy `1` datacenter /\n `2` residential / `3` mobile vocabulary and its omission for the lean-browser tier. Types are\n unchanged; only the documentation on them moved.\n\n### [0.9.2] - 2026-09-03\n\n#### Changed\n\n- **Breaking (API):** the scrape `formats` vocabulary is now `raw | markdown | links | images`\n (#3775). The unprocessed-source format is called `raw` — it has returned JSON, XML and plain\n text alongside HTML since #1853, so the old raw-HTML name misdescribed it — and the\n cleaned-article-HTML format is gone. The server accepts no alias for either retired value, so\n a request naming one now comes back `422` with the new set in the message. Update `formats`\n and read the content back from `formats.raw`:\n\n ```ts\n const result = await client.scrape.create({ url, formats: ['raw', 'markdown'] });\n console.log(result.formats.raw);\n ```\n\n- Regenerated `src/generated/api.d.ts` against the documented `402` contract (#3784). Every\n quota-enforced operation now declares `402` through one shared `PaymentRequired` response, and\n the `X-Quota-*` headers are referenced by the operations that actually emit them. Types only —\n no runtime behavior changed.\n\n- The generated `events` field description on the scrape request type now documents the\n widened server default (`queued`, `completed`, `failed`) and that a caller may send an\n explicit subset to receive fewer deliveries (#3777). Types/docs only — this regeneration\n followed a server-side default change; the SDK carried no logic tied to the old default.\n\n### [0.9.1] - 2026-08-25\n\n#### Fixed\n\n- The generated `paths` type for the `200` of `GET /v1/scrape/bulk/{id}` now declares `items`\n (#3632). The route builds one body and varies only the status code, so the terminal `200`\n has always carried the per-URL scrape envelopes — but only the `202` documented them, so\n `scrape.bulk.get()` typed the results away at exactly the poll that has them. Types only:\n the field was already on the wire, and server behavior is unchanged.\n\n- The generated `paths` types now describe the `202` that `GET /v1/scrape/bulk/{id}`,\n `GET /v1/fetch/bulk/{id}` and `GET /v1/bulk/{id}` already serve while a bulk job is\n non-terminal (#3533). Each of the three returns 202 with the job envelope until the job is\n terminal and 200 afterwards, but only the 200 was declared, so anything typed off the spec\n had no shape for the response the very first poll receives. Types only: `scrape.bulk.get()`,\n `fetch.bulk.get()` and `bulk.get()` already resolved the body on any 2xx, and server behavior\n is unchanged.\n\n#### Changed\n\n- The generated `topup_balance_bytes` description on `GET /v1/usage` now states that the value is\n the remaining purchased top-up bytes, already net of any overage consumed against them (#3459).\n Types only: the field's name, type and wire format are unchanged. The server previously\n subtracted the consumed overage a second time when computing this value, so the number a client\n reads is larger than before for accounts that ran past their included allowance.\n\n### [0.9.0] - 2026-08-20\n\n#### Removed\n\n- **BREAKING: the `cookies` and `headers` request-body fields are gone from every capture\n endpoint** (#3242) — `/v1/scrape`, `/v1/scrape/bulk`, `/v1/screenshots`, `/v1/recordings` and\n `/v1/schema`. A request that carries either field is rejected with `400 validation_error`; it\n is not ignored, and there is no deprecation window, feature flag, or compatibility header.\n `ScrapeOpts.cookies`, `ScrapeOpts.headers` and the exported `ScrapeCookie` type are removed\n from the SDK surface, so a call that still passes them no longer compiles.\n\n ```ts\n // before — compiled, and the values were forwarded to the target site\n await client.scrape.create({ url, cookies: [{ name: 'session', value: 'abc' }] });\n // after — does not compile; the same body over raw HTTP is a 400 validation_error\n await client.scrape.create({ url });\n ```\n\n ByteKit continues to manage its own cookie jar and request headers internally; what was removed\n is the caller's ability to inject or override them.\n\n#### Changed\n\n- **The generated types now declare the `503` response of `GET`/`POST /v1/fetch`** (#3372).\n `/v1/fetch` answers `503` on two conditions and both carry the ordinary `Error` envelope, so\n a typed consumer reading `operations['getFetch']['responses']` / `['postFetch']` can handle it\n instead of meeting an undeclared status at runtime. Read `error.code` to tell the two apart,\n because they disagree about `error.http_status`:\n - `upstream_error` — the target returned HTTP `502`, relayed at `503` because Cloudflare\n replaces a clean origin 502 with its own error page. `error.http_status` stays `502`, the\n **true upstream status**, and is the only surviving record of what the target answered.\n - `internal_error` (`Fetch service unavailable.`) — the fetch service was unreachable. There\n is no upstream, so `error.http_status` reports `503`, matching what was served.\n\n No runtime behaviour changes, and every other documented `/v1/fetch` status is unaffected.\n\n### [0.8.0] - 2026-08-19\n\n#### Removed\n\n- **BREAKING: `billing_multiplier` and `billed_bytes` are gone from the scrape success\n envelope** (#3143). Read `billing` instead — a `BillingNode` that names every factor\n applied to the charge, the multiplier they compose to, and the resulting billed bytes:\n\n ```ts\n // before\n const spend = res.billed_bytes; // flat, base-endpoint only\n // after\n const spend = res.billing?.billed_bytes;\n const why = res.billing?.factors; // [{ name: 'endpoint', value: 1.5, reason: 'scrape_md' }, …]\n ```\n\n This is a correction, not a rename: the two surfaces reported **different numbers for the\n same charge**. The flat pair carried the BASE-endpoint composition, so a markdown cache hit\n read `0.5` / `400` while the real charge — and the `X-Billing-Multiplier` header — was\n `0.75` / `600`; an html-only miss read the per-format credits estimate `1.5` / `150` against\n an endpoint factor of `1.0` / `100`. The flat pair also never carried the `clean_markdown`\n ×3 surcharge, so on a successful clean it under-reported the amount billed by two thirds.\n `billing.multiplier` composes every applied factor behind exactly one rounding, so it is the\n number that predicts your invoice.\n\n `billing` is optional and is **absent** on resources that completed before the billing node\n existed. A pre-node row omits the field rather than reporting a zero node, because a zero\n node would assert that a real past charge was zero. Test the node for presence\n (`res.billing !== undefined`, or equivalently a plain truthiness check — `billing` is an\n object or `undefined`, and an object is always truthy, so the two are the same test here).\n The hazard is a condition that reaches _into_ the node: `if (res.billing?.billed_bytes)`\n silently skips a genuine zero-byte charge, because `0` is falsy. Check that the node is\n present, then read `billed_bytes` from it.\n\n ```ts\n // wrong — a real 0-byte charge is falsy and disappears\n if (res.billing?.billed_bytes) record(res.billing.billed_bytes);\n // right — presence first, value second\n if (res.billing) record(res.billing.billed_bytes); // 0 is a charge, not an absence\n ```\n\n Two endpoints deliberately carry no node: `/v1/search` is billed per credit and reports\n `credits_used`, and a single `/v1/fetch` reports its charge through response headers only.\n The `/v1/logs` row field named `billing_multiplier` is a **different field** and is not the\n envelope field this release removed. It carries the BASE settled `credits_charged` factor,\n not the composed real-endpoint value the `X-Billing-Multiplier` header reports — a markdown\n cache hit reads `0.5` on the logs row and `0.75` on the header.\n\n#### Changed\n\n- Generate\n\n---\n[Truncated to the 16384-byte per-page limit — this page is 175796 bytes in full. The text cut here is not searchable either: search_docs matches only the part kept above. Read all of it at https://bytekit.com/docs/changelog]"
|
|
281
281
|
},
|
|
282
282
|
"cli": {
|
|
283
283
|
"title": "Install & Authenticate",
|
|
@@ -292,12 +292,12 @@
|
|
|
292
292
|
"cli/bulk": {
|
|
293
293
|
"title": "Bulk",
|
|
294
294
|
"section": "CLI Reference",
|
|
295
|
-
"body": "# Bulk\n\nBulk screenshot operations\n\nBulk screenshot operations\n\n### bulk › screenshots\n\nBulk screenshot sub-resources\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n#### bulk › screenshots › list\n\nList
|
|
295
|
+
"body": "# Bulk\n\nBulk screenshot operations\n\nBulk screenshot operations\n\n### bulk › screenshots\n\nBulk screenshot sub-resources\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n#### bulk › screenshots › list\n\nList items in a mixed bulk job\n\n| Option | Description |\n| --- | --- |\n| `--cursor <cursor>` | Continue from a cursor returned by the preceding page |\n| `--limit <n>` | Maximum items per type to return (1-500) |\n| `--status <status>` | Filter items by status: pending, processing, completed, failed, cancelled |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit bulk screenshots list <id> --cursor <cursor> --limit <n> --status <status>\n```\n\n### bulk › create\n\nCreate a bulk screenshots job\n\n| Option | Description |\n| --- | --- |\n| `--file <path>` | Path to a newline-delimited file. Each line is a plain URL, or a JSON object carrying \"url\" plus per-item config. A line whose only key is \"url\" behaves exactly as before (sent as a bare URL string); any line with additional keys switches the payload to the per-item shape. |\n| `--webhook-url <url>` | HTTPS webhook URL notified when the job completes |\n| `--webhook-secret <secret>` | HMAC secret used to sign the completion webhook (omitted → unsigned) |\n| `--defaults <json>` | Defaults applied to every entry, as a JSON object (omitted → none). Unknown keys are rejected by /v1/bulk (422) and ignored by scrape bulk / fetch bulk; fetch bulk additionally rejects browser-only keys (cookies, wait_until, wait_for_selector, delay_ms) with a 400. |\n| `--metadata <json>` | Arbitrary metadata echoed on the job envelope, as a JSON object, e.g. '\\{\"run\":\"7\"\\}' (omitted → none) |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit bulk create --file <path> --webhook-url <url> --webhook-secret <secret> --defaults <json> --metadata <json>\n```\n\n### bulk › get\n\nGet a bulk job status\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit bulk get <id>\n```\n\n### bulk › cancel\n\nCancel an in-flight bulk job\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit bulk cancel <id>\n```"
|
|
296
296
|
},
|
|
297
297
|
"cli/fetch": {
|
|
298
298
|
"title": "Fetch",
|
|
299
299
|
"section": "CLI Reference",
|
|
300
|
-
"body": "# Fetch\n\nFetch URL content operations\n\nFetch URL content operations\n\n### fetch › bulk\n\nBulk fetch operations\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n#### fetch › bulk › create\n\nCreate a bulk fetch job\n\n| Option | Description |\n| --- | --- |\n| `--file <path>` | Path to a newline-delimited file. Each line is a plain URL, or a JSON object carrying \"url\" plus per-item config. A line whose only key is \"url\" behaves exactly as before (sent as a bare URL string); any line with additional keys switches the payload to the per-item shape. |\n| `--webhook-url <url>` | HTTPS webhook URL notified when the job completes |\n| `--webhook-secret <secret>` | HMAC secret used to sign the completion webhook (omitted → unsigned) |\n| `--defaults <json>` | Defaults applied to every entry, as a JSON object (omitted → none). Unknown keys are rejected by /v1/bulk (422) and ignored by scrape bulk / fetch bulk; fetch bulk additionally rejects browser-only keys (cookies, wait_until, wait_for_selector, delay_ms) with a 400. |\n| `--metadata <json>` | Arbitrary metadata echoed on the job envelope, as a JSON object, e.g. '\\{\"run\":\"7\"\\}' (omitted → none) |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit fetch bulk create --file <path> --webhook-url <url> --webhook-secret <secret> --defaults <json> --metadata <json>\n```\n\n#### fetch › bulk › get\n\nGet a bulk fetch job\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit fetch bulk get <id>\n```\n\n### fetch › create\n\nFetch URL content (POST)\n\n| Option | Description |\n| --- | --- |\n| `--url <url>` | URL to fetch |\n| `--country <cc>` | Two-letter country code to route the request through (e.g. us, de) |\n| `--timeout-ms <n>` | Per-request timeout in milliseconds |\n| `--cache-ttl <ttl>` | Cache freshness: 0, Nh (hours), or Nd (days), e.g. 48h, 2d, 0 (omitted → server default) |\n| `--custom <json>` | User payload echoed on the envelope as a JSON object, e.g. '\\{\"job\":\"1\"\\}' (omitted → none) |\n| `-o, --output <file>` | Write the fetched body bytes to the given file path |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit fetch create --url <url> --country <cc> --timeout-ms <n> --cache-ttl <ttl> --custom <json>\n```\n\n### fetch › get\n\nFetch URL content (GET via query params)\n\n| Option | Description |\n| --- | --- |\n| `--url <url>` | URL to fetch |\n| `--country <cc>` | Two-letter country code to route the request through (e.g. us, de) |\n| `--timeout-ms <n>` | Per-request timeout in milliseconds |\n| `--cache-ttl <ttl>` | Cache freshness: 0, Nh (hours), or Nd (days), e.g. 48h, 2d, 0 (omitted → server default) |\n| `-o, --output <file>` | Write the fetched body bytes to the given file path |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit fetch get --url <url> --country <cc> --timeout-ms <n> --cache-ttl <ttl>\n```"
|
|
300
|
+
"body": "# Fetch\n\nFetch URL content operations\n\nFetch URL content operations\n\n### fetch › bulk\n\nBulk fetch operations\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n#### fetch › bulk › create\n\nCreate a bulk fetch job\n\n| Option | Description |\n| --- | --- |\n| `--file <path>` | Path to a newline-delimited file. Each line is a plain URL, or a JSON object carrying \"url\" plus per-item config. A line whose only key is \"url\" behaves exactly as before (sent as a bare URL string); any line with additional keys switches the payload to the per-item shape. |\n| `--webhook-url <url>` | HTTPS webhook URL notified when the job completes |\n| `--webhook-secret <secret>` | HMAC secret used to sign the completion webhook (omitted → unsigned) |\n| `--defaults <json>` | Defaults applied to every entry, as a JSON object (omitted → none). Unknown keys are rejected by /v1/bulk (422) and ignored by scrape bulk / fetch bulk; fetch bulk additionally rejects browser-only keys (cookies, wait_until, wait_for_selector, delay_ms) with a 400. |\n| `--metadata <json>` | Arbitrary metadata echoed on the job envelope, as a JSON object, e.g. '\\{\"run\":\"7\"\\}' (omitted → none) |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit fetch bulk create --file <path> --webhook-url <url> --webhook-secret <secret> --defaults <json> --metadata <json>\n```\n\n#### fetch › bulk › get\n\nGet a bulk fetch job\n\n| Option | Description |\n| --- | --- |\n| `--cursor <cursor>` | Continue from a cursor returned by the preceding page |\n| `--limit <n>` | Maximum items to return (1-500) |\n| `--status <status>` | Filter items by status: pending, processing, completed, failed, cancelled |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit fetch bulk get <id> --cursor <cursor> --limit <n> --status <status>\n```\n\n### fetch › create\n\nFetch URL content (POST)\n\n| Option | Description |\n| --- | --- |\n| `--url <url>` | URL to fetch |\n| `--country <cc>` | Two-letter country code to route the request through (e.g. us, de) |\n| `--timeout-ms <n>` | Per-request timeout in milliseconds |\n| `--cache-ttl <ttl>` | Cache freshness: 0, Nh (hours), or Nd (days), e.g. 48h, 2d, 0 (omitted → server default) |\n| `--custom <json>` | User payload echoed on the envelope as a JSON object, e.g. '\\{\"job\":\"1\"\\}' (omitted → none) |\n| `-o, --output <file>` | Write the fetched body bytes to the given file path |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit fetch create --url <url> --country <cc> --timeout-ms <n> --cache-ttl <ttl> --custom <json>\n```\n\n### fetch › get\n\nFetch URL content (GET via query params)\n\n| Option | Description |\n| --- | --- |\n| `--url <url>` | URL to fetch |\n| `--country <cc>` | Two-letter country code to route the request through (e.g. us, de) |\n| `--timeout-ms <n>` | Per-request timeout in milliseconds |\n| `--cache-ttl <ttl>` | Cache freshness: 0, Nh (hours), or Nd (days), e.g. 48h, 2d, 0 (omitted → server default) |\n| `-o, --output <file>` | Write the fetched body bytes to the given file path |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit fetch get --url <url> --country <cc> --timeout-ms <n> --cache-ttl <ttl>\n```"
|
|
301
301
|
},
|
|
302
302
|
"cli/monitors": {
|
|
303
303
|
"title": "Monitors",
|
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
"cli/scrape": {
|
|
308
308
|
"title": "Scrape",
|
|
309
309
|
"section": "CLI Reference",
|
|
310
|
-
"body": "# Scrape\n\nScrape URL content\n\nScrape URL content\n\n### scrape › bulk\n\nBulk scrape operations\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n#### scrape › bulk › create\n\nCreate a bulk scrape job\n\n| Option | Description |\n| --- | --- |\n| `--file <path>` | Path to a newline-delimited file. Each line is a plain URL, or a JSON object carrying \"url\" plus per-item config. A line whose only key is \"url\" behaves exactly as before (sent as a bare URL string); any line with additional keys switches the payload to the per-item shape. |\n| `--webhook-url <url>` | HTTPS webhook URL notified when the job completes |\n| `--webhook-secret <secret>` | HMAC secret used to sign the completion webhook (omitted → unsigned) |\n| `--defaults <json>` | Defaults applied to every entry, as a JSON object (omitted → none). Unknown keys are rejected by /v1/bulk (422) and ignored by scrape bulk / fetch bulk; fetch bulk additionally rejects browser-only keys (wait_until, wait_for_selector, delay_ms) with a 400. `cookies` and `headers` are no longer accepted by any capture endpoint and 400 (#3242). |\n| `--metadata <json>` | Arbitrary metadata echoed on the job envelope, as a JSON object, e.g. '\\{\"run\":\"7\"\\}' (omitted → none) |\n| `--custom <json>` | User payload echoed on every scrape entry, as a JSON object, e.g. '\\{\"job\":\"1\"\\}' (omitted → none; a per-entry value in --file wins) |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape bulk create --file <path> --webhook-url <url> --webhook-secret <secret> --defaults <json> --metadata <json> --custom <json>\n```\n\n#### scrape › bulk › get\n\nGet a bulk scrape job\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape bulk get <id>\n```\n\n### scrape › create\n\nCreate a scrape job\n\n| Option | Description |\n| --- | --- |\n| `--url <url>` | URL to scrape |\n| `--format <format>` | Output format; repeat or comma-separate for multiple (e.g. --format raw --format markdown, or --format raw,markdown). Sent as the formats array; omitted → server default. |\n| `--country <cc>` | Two-letter country code to route the request through (e.g. us, de) |\n| `--timeout-ms <n>` | Per-request timeout in milliseconds |\n| `--markdown-mode <mode>` | Markdown extraction mode: article, raw, llm |\n| `--markdown-query <q>` | BM25 query string for relevance-ranked markdown filtering (omitted → disabled) |\n| `--cache-ttl <ttl>` | Cache freshness: 0, Nh (hours), or Nd (days), e.g. 48h, 2d, 0 (omitted → server default) |\n| `--delay-ms <n>` | Post-load delay in milliseconds before capture |\n| `--events <csv>` | Webhook events (comma-separated): queued, completed, failed (omitted → server default) |\n| `--token-encoding <enc>` | Tokenizer for --token-budget: cl100k_base, o200k_base (omitted → server default) |\n| `--custom <json>` | User payload echoed on the envelope as a JSON object, e.g. '\\{\"job\":\"1\"\\}' (omitted → none) |\n| `--remove-base64-images` | Strip base64 data: images before conversion (server default) |\n| `--no-remove-base64-images` | Preserve base64 data: images in the pipeline output |\n| `--markdown-links <mode>` | Link rendering: inline, references, none, text |\n| `--markdown-images <mode>` | Image retention: inline, references, none, text |\n| `--with-links-summary` | Append a Links footer to the markdown output |\n| `--with-images-summary` | Append an Images footer to the markdown output |\n| `--markdown-compact` | Collapse excessive whitespace in the markdown output |\n| `--markdown-filter-images` | Filter low-signal images from the markdown output |\n| `--markdown-include-media` | Return rich link/image objects and a tables array |\n| `--markdown-include-warnings` | Include markdown-pipeline and tag-filter warnings |\n| `--markdown-include-stats` | Include a top-level stats object (chars, tokens, blocks) |\n| `--async` | Queue the scrape and return a job envelope immediately (no wait) |\n| `--webhook-url <url>` | HTTPS webhook URL notified when an async scrape completes |\n| `--token-budget <n>` | Maximum tokens of markdown to return |\n| `--clean-markdown` | Post-process markdown with the LLM cleaner (billed 3x) |\n| `--include-tags <csv>` | Comma-separated HTML tags to keep (e.g. article,main) |\n| `--exclude-tags <csv>` | Comma-separated HTML tags to drop (e.g. nav,footer) |\n| `--mobile` | Render with a mobile viewport/user-agent |\n| `--raw` | Print the requested format body raw, with no JSON wrapper |\n| `-o, --output <file>` | Write the output to the given file path (implies --raw unless --json is set) |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape create --url <url> --format <format> --country <cc> --timeout-ms <n> --markdown-mode <mode> --markdown-query <q> --cache-ttl <ttl> --delay-ms <n> --events <csv> --token-encoding <enc> --custom <json> --remove-base64-images --no-remove-base64-images --markdown-links <mode> --markdown-images <mode> --with-links-summary --with-images-summary --markdown-compact --markdown-filter-images --markdown-include-media --markdown-include-warnings --markdown-include-stats --async --webhook-url <url> --token-budget <n> --clean-markdown --include-tags <csv> --exclude-tags <csv> --mobile --raw\n```\n\n### scrape › get\n\nGet a scrape job by ID (use --raw/-o/--format to retrieve a completed body)\n\n| Option | Description |\n| --- | --- |\n| `--raw` | Print the requested format body raw, with no JSON wrapper |\n| `-o, --output <file>` | Write the output to the given file path (implies --raw unless --json is set) |\n| `--format <format>` | Which persisted format to emit — only takes effect with --raw/-o; ignored otherwise |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape get <id> --raw --format <format>\n```"
|
|
310
|
+
"body": "# Scrape\n\nScrape URL content\n\nScrape URL content\n\n### scrape › bulk\n\nBulk scrape operations\n\n| Option | Description |\n| --- | --- |\n| `-h, --help` | display help for command |\n\n#### scrape › bulk › create\n\nCreate a bulk scrape job\n\n| Option | Description |\n| --- | --- |\n| `--file <path>` | Path to a newline-delimited file. Each line is a plain URL, or a JSON object carrying \"url\" plus per-item config. A line whose only key is \"url\" behaves exactly as before (sent as a bare URL string); any line with additional keys switches the payload to the per-item shape. |\n| `--webhook-url <url>` | HTTPS webhook URL notified when the job completes |\n| `--webhook-secret <secret>` | HMAC secret used to sign the completion webhook (omitted → unsigned) |\n| `--defaults <json>` | Defaults applied to every entry, as a JSON object (omitted → none). Unknown keys are rejected by /v1/bulk (422) and ignored by scrape bulk / fetch bulk; fetch bulk additionally rejects browser-only keys (wait_until, wait_for_selector, delay_ms) with a 400. `cookies` and `headers` are no longer accepted by any capture endpoint and 400 (#3242). |\n| `--metadata <json>` | Arbitrary metadata echoed on the job envelope, as a JSON object, e.g. '\\{\"run\":\"7\"\\}' (omitted → none) |\n| `--custom <json>` | User payload echoed on every scrape entry, as a JSON object, e.g. '\\{\"job\":\"1\"\\}' (omitted → none; a per-entry value in --file wins) |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape bulk create --file <path> --webhook-url <url> --webhook-secret <secret> --defaults <json> --metadata <json> --custom <json>\n```\n\n#### scrape › bulk › get\n\nGet a bulk scrape job\n\n| Option | Description |\n| --- | --- |\n| `--cursor <cursor>` | Continue from a cursor returned by the preceding page |\n| `--limit <n>` | Maximum items to return (1-500) |\n| `--status <status>` | Filter items by status: pending, processing, completed, failed, cancelled |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape bulk get <id> --cursor <cursor> --limit <n> --status <status>\n```\n\n### scrape › create\n\nCreate a scrape job\n\n| Option | Description |\n| --- | --- |\n| `--url <url>` | URL to scrape |\n| `--format <format>` | Output format; repeat or comma-separate for multiple (e.g. --format raw --format markdown, or --format raw,markdown). Sent as the formats array; omitted → server default. |\n| `--country <cc>` | Two-letter country code to route the request through (e.g. us, de) |\n| `--timeout-ms <n>` | Per-request timeout in milliseconds |\n| `--markdown-mode <mode>` | Markdown extraction mode: article, raw, llm |\n| `--markdown-query <q>` | BM25 query string for relevance-ranked markdown filtering (omitted → disabled) |\n| `--cache-ttl <ttl>` | Cache freshness: 0, Nh (hours), or Nd (days), e.g. 48h, 2d, 0 (omitted → server default) |\n| `--delay-ms <n>` | Post-load delay in milliseconds before capture |\n| `--events <csv>` | Webhook events (comma-separated): queued, completed, failed (omitted → server default) |\n| `--token-encoding <enc>` | Tokenizer for --token-budget: cl100k_base, o200k_base (omitted → server default) |\n| `--custom <json>` | User payload echoed on the envelope as a JSON object, e.g. '\\{\"job\":\"1\"\\}' (omitted → none) |\n| `--remove-base64-images` | Strip base64 data: images before conversion (server default) |\n| `--no-remove-base64-images` | Preserve base64 data: images in the pipeline output |\n| `--markdown-links <mode>` | Link rendering: inline, references, none, text |\n| `--markdown-images <mode>` | Image retention: inline, references, none, text |\n| `--with-links-summary` | Append a Links footer to the markdown output |\n| `--with-images-summary` | Append an Images footer to the markdown output |\n| `--markdown-compact` | Collapse excessive whitespace in the markdown output |\n| `--markdown-filter-images` | Filter low-signal images from the markdown output |\n| `--markdown-include-media` | Return rich link/image objects and a tables array |\n| `--markdown-include-warnings` | Include markdown-pipeline and tag-filter warnings |\n| `--markdown-include-stats` | Include a top-level stats object (chars, tokens, blocks) |\n| `--async` | Queue the scrape and return a job envelope immediately (no wait) |\n| `--webhook-url <url>` | HTTPS webhook URL notified when an async scrape completes |\n| `--token-budget <n>` | Maximum tokens of markdown to return |\n| `--clean-markdown` | Post-process markdown with the LLM cleaner (billed 3x) |\n| `--include-tags <csv>` | Comma-separated HTML tags to keep (e.g. article,main) |\n| `--exclude-tags <csv>` | Comma-separated HTML tags to drop (e.g. nav,footer) |\n| `--mobile` | Render with a mobile viewport/user-agent |\n| `--raw` | Print the requested format body raw, with no JSON wrapper |\n| `-o, --output <file>` | Write the output to the given file path (implies --raw unless --json is set) |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape create --url <url> --format <format> --country <cc> --timeout-ms <n> --markdown-mode <mode> --markdown-query <q> --cache-ttl <ttl> --delay-ms <n> --events <csv> --token-encoding <enc> --custom <json> --remove-base64-images --no-remove-base64-images --markdown-links <mode> --markdown-images <mode> --with-links-summary --with-images-summary --markdown-compact --markdown-filter-images --markdown-include-media --markdown-include-warnings --markdown-include-stats --async --webhook-url <url> --token-budget <n> --clean-markdown --include-tags <csv> --exclude-tags <csv> --mobile --raw\n```\n\n### scrape › get\n\nGet a scrape job by ID (use --raw/-o/--format to retrieve a completed body)\n\n| Option | Description |\n| --- | --- |\n| `--raw` | Print the requested format body raw, with no JSON wrapper |\n| `-o, --output <file>` | Write the output to the given file path (implies --raw unless --json is set) |\n| `--format <format>` | Which persisted format to emit — only takes effect with --raw/-o; ignored otherwise |\n| `-h, --help` | display help for command |\n\n```bash\n$ bytekit scrape get <id> --raw --format <format>\n```"
|
|
311
311
|
},
|
|
312
312
|
"cli/screenshots": {
|
|
313
313
|
"title": "Screenshots",
|
|
@@ -357,7 +357,7 @@
|
|
|
357
357
|
"guides/rate-limits": {
|
|
358
358
|
"title": "Rate Limits",
|
|
359
359
|
"section": "Guides",
|
|
360
|
-
"body": "# Rate Limits\n\nHow ByteKit enforces quotas, concurrency slots, and rate limits.\n\nByteKit enforces three independent limits: **rate limits** (requests per second),\n**concurrency slots** (simultaneous in-flight requests), and **quota** (monthly usage caps).\nAll three are enforced before any capture work begins.\n\n## Quota model\n\nQuota is pre-incremented on every request and corrected after the request completes:\n\n1. **Pre-increment** — your usage counter is incremented by an estimate before the capture\n starts. This prevents over-committing capacity even for concurrent requests.\n2. **Adjust** — once the response returns, the actual `content_length` (compressed wire bytes)\n replaces the estimate for bandwidth accounting.\n3. **Compensating decrement** — if the request fails with a terminal error, the pre-incremented\n amount is rolled back, so a capture that returns no bytes costs nothing.\n\nTwo charges survive a failure. A `/v1/fetch` request answered from the cache with a non-2xx\nupstream status is
|
|
360
|
+
"body": "# Rate Limits\n\nHow ByteKit enforces quotas, concurrency slots, and rate limits.\n\nByteKit enforces three independent limits: **rate limits** (requests per second),\n**concurrency slots** (simultaneous in-flight requests), and **quota** (monthly usage caps).\nAll three are enforced before any capture work begins.\n\n## Quota model\n\nQuota is pre-incremented on every request and corrected after the request completes:\n\n1. **Pre-increment** — your usage counter is incremented by an estimate before the capture\n starts. This prevents over-committing capacity even for concurrent requests.\n2. **Adjust** — once the response returns, the actual `content_length` (compressed wire bytes)\n replaces the estimate for bandwidth accounting.\n3. **Compensating decrement** — if the request fails with a terminal error, the pre-incremented\n amount is rolled back, so a capture that returns no bytes costs nothing.\n\nTwo charges survive a failure. A `/v1/fetch` request answered from the cache with a non-2xx\nupstream status is billed at the cache-hit rate, and a failed schema extraction refunds the credits\nit pre-charged but keeps the source page's bandwidth. That cached non-2xx hit returns the\n`upstream_error` envelope — the same JSON a cache miss with the same upstream status returns,\nwhatever `format` asked for — not the cached body, which stays the billing basis even though it is\nnot served.\n\nThis means your dashboard usage counter may briefly read higher than actual consumption during\na burst of requests, then settle to the true value.\n\n## Concurrency slots\n\nEach account has a concurrency limit — the maximum number of in-flight requests at one time.\nSlots are released automatically a few minutes after a client disconnects, so a crashed client\ncannot permanently hold them.\n\nWhen you exceed your concurrency limit, you receive `429 concurrency_limit` (not\n`rate_limited` — a distinct error code) with a `Retry-After` header indicating how long to\nwait before retrying.\n\n## Rate limit headers\n\nEvery response includes headers that show your current position:\n\n| Header | Description |\n|--------|-------------|\n| `X-RateLimit-Limit` | Your account's request-per-second limit |\n| `X-RateLimit-Remaining` | Requests remaining in the current window |\n| `X-RateLimit-Reset` | Unix timestamp when the window resets |\n| `Retry-After` | Seconds to wait before retrying (present on `429` only) |\n\n## Bandwidth metering\n\nBandwidth usage is measured as `content_length` — the compressed wire bytes returned by the\norigin server. If the origin sends gzip or Brotli-encoded content, the compressed size is what\ncounts, not the decompressed size. This matches what your client actually receives over the\nnetwork.\n\nThat measurement is the basis, not the charge. Your balance is deducted by the wire bytes times\nthe endpoint factor, so a Markdown scrape deducts 1.5× its `content_length` — and so does a\nMarkdown fetch. See [Bandwidth billing](https://bytekit.com/docs/billing/bandwidth) for the full composition.\n\n## Handling 429 responses\n\nWhen you receive `429 rate_limited` or `429 concurrency_limit`:\n\n1. Read the `Retry-After` header value (in seconds).\n2. Wait at least that long before retrying.\n3. If no `Retry-After` is present, use exponential backoff starting at 1 second.\n\n```bash\n# Check rate limit headers\ncurl -I -X POST https://api.bytekit.com/v1/scrape \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"url\": \"https://example.com\"}'\n```\n\n## Next steps\n\n- [Errors](https://bytekit.com/docs/guides/errors) — full error code reference and retry guidance\n- [Scraping](https://bytekit.com/docs/guides/scraping) — formats, options, latency, and async polling"
|
|
361
361
|
},
|
|
362
362
|
"guides/scraping": {
|
|
363
363
|
"title": "Scraping",
|
|
@@ -417,7 +417,7 @@
|
|
|
417
417
|
"sdk/python/bulk": {
|
|
418
418
|
"title": "Bulk",
|
|
419
419
|
"section": "SDK Reference",
|
|
420
|
-
"body": "# Bulk\n\nFunctions for interacting with the `bulk` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Bulk\n\nCreate 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.\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**Parameters**\n\n- `body (CreateBulkBody): Provide `urls` (simple list) OR `items` (per-item config), not`\n- `both. `type` selects the capture kind per entry — only`\n- ``screenshot` and `scrape` are accepted (`recording` is`\n- `deactivated). Behaviour fields may be set per item or via`\n- ``defaults`; a per-item value overrides the matching default.`\n- `This includes `type`: an entry with no `type` of its own`\n- `inherits `defaults.type`, falling back to `screenshot` only`\n- `when neither is set.`\n- `The top-level object, each `items[]` entry, and `defaults``\n- `each reject unrecognized keys with a 422 `validation_error``\n- `(the offending key name appears in the error's `details``\n- `message text) rather than silently discarding them.`\n- ``items[]` and `defaults` do not share one field set`\n- ``device_scale_factor` is accepted only under `defaults` (a`\n- `per-item value 422s), and `duration`/`scenario` are accepted`\n- `only per item (a `defaults` value 422s). `metadata` is`\n- `different from those three: it is valid both at the top`\n- `level of the body and per item, but rejected with a 422 if`\n- `placed under `defaults`. See the `422` response below.`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[CreateBulkResponse202, Error]]\nsync(client=client, body=body) -> Optional[Union[CreateBulkResponse202, Error]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[CreateBulkResponse202, Error]]\nawait asyncio(client=client, body=body) -> Optional[Union[CreateBulkResponse202, Error]]\n```\n\n## Delete Bulk\n\nCancel a bulk job\n\nCancels an in-flight bulk job: drains its still-queued (pending) child jobs and refunds the quota\nheld for exactly those drained children. Children already completed, failed, or in progress are\nuntouched and keep their charge. Idempotent — cancelling an already-terminal job (completed, failed,\nor cancelled) is a no-op that returns 200 with the job's real, unchanged status and refunds nothing.\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[DeleteBulkResponse200, Error]]\nsync(id=id, client=client) -> Optional[Union[DeleteBulkResponse200, Error]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[DeleteBulkResponse200, Error]]\nawait asyncio(id=id, client=client) -> Optional[Union[DeleteBulkResponse200, Error]]\n```\n\n## Get Bulk\n\nGet bulk job status\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[Error, GetBulkResponse200, GetBulkResponse202]]\nsync(id=id, client=client) -> Optional[Union[Error, GetBulkResponse200, GetBulkResponse202]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[Error, GetBulkResponse200, GetBulkResponse202]]\nawait asyncio(id=id, client=client) -> Optional[Union[Error, GetBulkResponse200, GetBulkResponse202]]\n```\n\n## List Bulk Screenshots\n\nList bulk job items\n\nReturns the bulk job's items, discriminated by `type`.\n\n**Downloading item artifacts.** `image_url` (`type: screenshot`) and both
|
|
420
|
+
"body": "# Bulk\n\nFunctions for interacting with the `bulk` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Bulk\n\nCreate 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**Parameters**\n\n- `body (CreateBulkBody): Provide `urls` (simple list) OR `items` (per-item config), not`\n- `both. `type` selects the capture kind per entry — only`\n- ``screenshot` and `scrape` are accepted (`recording` is`\n- `deactivated). Behaviour fields may be set per item or via`\n- ``defaults`; a per-item value overrides the matching default.`\n- `This includes `type`: an entry with no `type` of its own`\n- `inherits `defaults.type`, falling back to `screenshot` only`\n- `when neither is set.`\n- `The top-level object, each `items[]` entry, and `defaults``\n- `each reject unrecognized keys with a 422 `validation_error``\n- `(the offending key name appears in the error's `details``\n- `message text) rather than silently discarding them.`\n- ``items[]` and `defaults` do not share one field set`\n- ``device_scale_factor` is accepted only under `defaults` (a`\n- `per-item value 422s), and `duration`/`scenario` are accepted`\n- `only per item (a `defaults` value 422s). `metadata` is`\n- `different from those three: it is valid both at the top`\n- `level of the body and per item, but rejected with a 422 if`\n- `placed under `defaults`. See the `422` response below.`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[CreateBulkResponse202, Error]]\nsync(client=client, body=body) -> Optional[Union[CreateBulkResponse202, Error]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[CreateBulkResponse202, Error]]\nawait asyncio(client=client, body=body) -> Optional[Union[CreateBulkResponse202, Error]]\n```\n\n## Delete Bulk\n\nCancel a bulk job\n\nCancels an in-flight bulk job: drains its still-queued (pending) child jobs and refunds the quota\nheld for exactly those drained children. Children already completed, failed, or in progress are\nuntouched and keep their charge. Idempotent — cancelling an already-terminal job (completed, failed,\nor cancelled) is a no-op that returns 200 with the job's real, unchanged status and refunds nothing.\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[DeleteBulkResponse200, Error]]\nsync(id=id, client=client) -> Optional[Union[DeleteBulkResponse200, Error]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[DeleteBulkResponse200, Error]]\nawait asyncio(id=id, client=client) -> Optional[Union[DeleteBulkResponse200, Error]]\n```\n\n## Get Bulk\n\nGet bulk job status\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[Error, GetBulkResponse200, GetBulkResponse202]]\nsync(id=id, client=client) -> Optional[Union[Error, GetBulkResponse200, GetBulkResponse202]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[Error, GetBulkResponse200, GetBulkResponse202]]\nawait asyncio(id=id, client=client) -> Optional[Union[Error, GetBulkResponse200, GetBulkResponse202]]\n```\n\n## List Bulk Screenshots\n\nList 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**Parameters**\n\n- `id (str)`\n- `cursor (Union[Unset, str])`\n- `limit (Union[Unset, int])`\n- `status (Union[Unset, ListBulkScreenshotsStatus])`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Response[ListBulkScreenshotsResponse200]\nsync(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Optional[ListBulkScreenshotsResponse200]\nawait asyncio_detailed(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Response[ListBulkScreenshotsResponse200]\nawait asyncio(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Optional[ListBulkScreenshotsResponse200]\n```"
|
|
421
421
|
},
|
|
422
422
|
"sdk/python/client": {
|
|
423
423
|
"title": "Client",
|
|
@@ -432,7 +432,7 @@
|
|
|
432
432
|
"sdk/python/fetch-bulk": {
|
|
433
433
|
"title": "Fetch Bulk",
|
|
434
434
|
"section": "SDK Reference",
|
|
435
|
-
"body": "# Fetch Bulk\n\nFunctions for interacting with the `fetch_bulk` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Fetch Bulk\n\nBulk 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.).\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**Parameters**\n\n- `body (CreateFetchBulkBody)`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[CreateFetchBulkResponse202, Error]]\nsync(client=client, body=body) -> Optional[Union[CreateFetchBulkResponse202, Error]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[CreateFetchBulkResponse202, Error]]\nawait asyncio(client=client, body=body) -> Optional[Union[CreateFetchBulkResponse202, Error]]\n```\n\n## Get Fetch Bulk\n\nGet 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, carry
|
|
435
|
+
"body": "# Fetch Bulk\n\nFunctions for interacting with the `fetch_bulk` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Fetch Bulk\n\nBulk 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**Parameters**\n\n- `body (CreateFetchBulkBody)`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[CreateFetchBulkResponse202, Error]]\nsync(client=client, body=body) -> Optional[Union[CreateFetchBulkResponse202, Error]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[CreateFetchBulkResponse202, Error]]\nawait asyncio(client=client, body=body) -> Optional[Union[CreateFetchBulkResponse202, Error]]\n```\n\n## Get Fetch Bulk\n\nGet 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**Parameters**\n\n- `id (str)`\n- `cursor (Union[Unset, str])`\n- `limit (Union[Unset, int])`\n- `status (Union[Unset, GetFetchBulkStatus])`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Response[Union[Error, GetFetchBulkResponse200, GetFetchBulkResponse202]]\nsync(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Optional[Union[Error, GetFetchBulkResponse200, GetFetchBulkResponse202]]\nawait asyncio_detailed(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Response[Union[Error, GetFetchBulkResponse200, GetFetchBulkResponse202]]\nawait asyncio(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Optional[Union[Error, GetFetchBulkResponse200, GetFetchBulkResponse202]]\n```"
|
|
436
436
|
},
|
|
437
437
|
"sdk/python/monitors": {
|
|
438
438
|
"title": "Monitors",
|
|
@@ -442,12 +442,12 @@
|
|
|
442
442
|
"sdk/python/scrape": {
|
|
443
443
|
"title": "Scrape",
|
|
444
444
|
"section": "SDK Reference",
|
|
445
|
-
"body": "# Scrape\n\nFunctions for interacting with the `scrape` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Scrape\n\nScrape a URL\n\nFetches and processes a URL, returning content in one or more formats wrapped in a ScrapeEnvelope.\
|
|
445
|
+
"body": "# Scrape\n\nFunctions for interacting with the `scrape` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Scrape\n\nScrape 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\n/v1/scrape/\\{id\\}` for the result.\n2. Otherwise, a request that needs a full page render — today that is `delay_ms > 0` — is **held\nopen** until the render reaches a terminal state, then returns **200** with the content envelope\n(`success` or `failed`). If the render is still running when the hold window expires (28 seconds by\ndefault), 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\nenvelope, typically in under a second.\n\n**A failed fetch is a result, not a transport error.** An unreachable host, a refused connection, or\na target whose bot protection defeats every proxy tier all come back on the same **200** as a\n`failed` envelope — never a 5xx. Narrow on the envelope's `status` before reading the body. A\nfailure the fast path decides inline happens before any job row exists, so its envelope carries `id:\nnull` and there is nothing to poll; a failure a held render reaches carries that render's real `id`.\nEither 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\nexpired. `wait_for_selector` and `wait_until` are `ScreenshotRequest` options, not `ScrapeRequest`\noptions — sending either to this endpoint returns `422 validation_error`, so neither can produce a\n202 here.\n\n**Parameters**\n\n- `body (ScrapeRequest)`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[Error, ScrapeQueuedEnvelope, Union['ScrapeErrorEnvelope', 'ScrapeSuccessEnvelope']]]\nsync(client=client, body=body) -> Optional[Union[Error, ScrapeQueuedEnvelope, Union['ScrapeErrorEnvelope', 'ScrapeSuccessEnvelope']]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[Error, ScrapeQueuedEnvelope, Union['ScrapeErrorEnvelope', 'ScrapeSuccessEnvelope']]]\nawait asyncio(client=client, body=body) -> Optional[Union[Error, ScrapeQueuedEnvelope, Union['ScrapeErrorEnvelope', 'ScrapeSuccessEnvelope']]]\n```\n\n## Get Scrape\n\nGet scrape result\n\nAlways returns 200. Check the `status` discriminator for the scrape state.\n\n**Parameters**\n\n- `id (str)`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client) -> Response[Union[Error, Union['ScrapeErrorEnvelope', 'ScrapeQueuedEnvelope', 'ScrapeSuccessEnvelope']]]\nsync(id=id, client=client) -> Optional[Union[Error, Union['ScrapeErrorEnvelope', 'ScrapeQueuedEnvelope', 'ScrapeSuccessEnvelope']]]\nawait asyncio_detailed(id=id, client=client) -> Response[Union[Error, Union['ScrapeErrorEnvelope', 'ScrapeQueuedEnvelope', 'ScrapeSuccessEnvelope']]]\nawait asyncio(id=id, client=client) -> Optional[Union[Error, Union['ScrapeErrorEnvelope', 'ScrapeQueuedEnvelope', 'ScrapeSuccessEnvelope']]]\n```"
|
|
446
446
|
},
|
|
447
447
|
"sdk/python/scrape-bulk": {
|
|
448
448
|
"title": "Scrape Bulk",
|
|
449
449
|
"section": "SDK Reference",
|
|
450
|
-
"body": "# Scrape Bulk\n\nFunctions for interacting with the `scrape_bulk` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Scrape Bulk\n\nBulk scrape URLs\n\nEnqueues multiple URLs for scraping. Results delivered via webhook.\
|
|
450
|
+
"body": "# Scrape Bulk\n\nFunctions for interacting with the `scrape_bulk` API resource. Each operation ships in four forms — `sync` / `sync_detailed` and their `async` counterparts.\n\n## Create Scrape Bulk\n\nBulk 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**Parameters**\n\n- `body (CreateScrapeBulkBody)`\n\n**Call styles**\n\n```python\nsync_detailed(client=client, body=body) -> Response[Union[CreateScrapeBulkResponse202, Error]]\nsync(client=client, body=body) -> Optional[Union[CreateScrapeBulkResponse202, Error]]\nawait asyncio_detailed(client=client, body=body) -> Response[Union[CreateScrapeBulkResponse202, Error]]\nawait asyncio(client=client, body=body) -> Optional[Union[CreateScrapeBulkResponse202, Error]]\n```\n\n## Get Scrape Bulk\n\nGet 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**Parameters**\n\n- `id (str)`\n- `cursor (Union[Unset, str])`\n- `limit (Union[Unset, int])`\n- `status (Union[Unset, GetScrapeBulkStatus])`\n\n**Call styles**\n\n```python\nsync_detailed(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Response[Union[Error, GetScrapeBulkResponse200, GetScrapeBulkResponse202]]\nsync(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Optional[Union[Error, GetScrapeBulkResponse200, GetScrapeBulkResponse202]]\nawait asyncio_detailed(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Response[Union[Error, GetScrapeBulkResponse200, GetScrapeBulkResponse202]]\nawait asyncio(id=id, client=client, cursor=cursor, limit=limit, status=status) -> Optional[Union[Error, GetScrapeBulkResponse200, GetScrapeBulkResponse202]]\n```"
|
|
451
451
|
},
|
|
452
452
|
"sdk/python/screenshots": {
|
|
453
453
|
"title": "Screenshots",
|
|
@@ -482,7 +482,7 @@
|
|
|
482
482
|
"sdk/typescript/bulk": {
|
|
483
483
|
"title": "Bulk",
|
|
484
484
|
"section": "SDK Reference",
|
|
485
|
-
"body": "# Bulk\n\nFan out many URLs in parallel with per-item webhooks. Accessed via `client.bulk`.\n\n## create\n\n```ts\nclient.bulk.create(opts: BulkCreateRequest, requestOptions?: RequestOptions): Promise<BulkCreateResponse>\n```\n\nPOST /v1/bulk — create a bulk screenshots job.\n\n`requestOptions` carries the CLIENT-side abort budget (`requestTimeoutMs`) and an\noptional caller `signal`; both override the constructor's `timeoutMs` default.\n\n## get\n\n```ts\nclient.bulk.get(id: BulkId, requestOptions?: RequestOptions): Promise<BulkGetResponse>\n```\n\nGET /v1/bulk/\\{id\\} — get a bulk job status\n\n## cancel\n\n```ts\nclient.bulk.cancel(id: BulkId, requestOptions?: RequestOptions): Promise<BulkCancelResponse>\n```\n\nDELETE /v1/bulk/\\{id\\} — cancel an in-flight bulk job\n\n## screenshots\n\n### list\n\n```ts\nclient.bulk.screenshots.list(id: BulkId, requestOptions?: RequestOptions): Promise<ListBulkScreenshotsResponse>\n```\n\nGET /v1/bulk/\\{id\\}/screenshots — list
|
|
485
|
+
"body": "# Bulk\n\nFan out many URLs in parallel with per-item webhooks. Accessed via `client.bulk`.\n\n## create\n\n```ts\nclient.bulk.create(opts: BulkCreateRequest, requestOptions?: RequestOptions): Promise<BulkCreateResponse>\n```\n\nPOST /v1/bulk — create a bulk screenshots job.\n\n`requestOptions` carries the CLIENT-side abort budget (`requestTimeoutMs`) and an\noptional caller `signal`; both override the constructor's `timeoutMs` default.\n\n## get\n\n```ts\nclient.bulk.get(id: BulkId, requestOptions?: RequestOptions): Promise<BulkGetResponse>\n```\n\nGET /v1/bulk/\\{id\\} — get a bulk job status\n\n## cancel\n\n```ts\nclient.bulk.cancel(id: BulkId, requestOptions?: RequestOptions): Promise<BulkCancelResponse>\n```\n\nDELETE /v1/bulk/\\{id\\} — cancel an in-flight bulk job\n\n## screenshots\n\n### list\n\n```ts\nclient.bulk.screenshots.list(id: BulkId, requestOptions?: RequestOptions): Promise<ListBulkScreenshotsResponse>\n```\n\nGET /v1/bulk/\\{id\\}/screenshots — list items in a mixed bulk job\n\n### list\n\n```ts\nclient.bulk.screenshots.list(id: BulkId, pageParams: BulkPageParams, requestOptions?: RequestOptions): Promise<ListBulkScreenshotsResponse>\n```\n\n### list\n\n```ts\nclient.bulk.screenshots.list(id: BulkId, pageParamsOrRequestOptions: BulkPageParams | RequestOptions = {}, requestOptions?: RequestOptions): Promise<ListBulkScreenshotsResponse>\n```"
|
|
486
486
|
},
|
|
487
487
|
"sdk/typescript/client": {
|
|
488
488
|
"title": "Client",
|
|
@@ -497,7 +497,7 @@
|
|
|
497
497
|
"sdk/typescript/fetch-bulk": {
|
|
498
498
|
"title": "Fetch Bulk",
|
|
499
499
|
"section": "SDK Reference",
|
|
500
|
-
"body": "# Fetch Bulk\n\nCreate and poll bulk fetch jobs. Accessed via `client.fetch.bulk`.\n\n## create\n\n```ts\nclient.fetch.bulk.create(opts: FetchBulkCreateRequest, requestOptions?: RequestOptions): Promise<FetchBulkCreateResponse>\n```\n\nPOST /v1/fetch/bulk — create a bulk fetch job\n\n## get\n\n```ts\nclient.fetch.bulk.get(id: BulkId, requestOptions?: RequestOptions): Promise<FetchBulkGetResponse>\n```\n\nGET /v1/fetch/bulk/\\{id\\} — get a bulk fetch job"
|
|
500
|
+
"body": "# Fetch Bulk\n\nCreate and poll bulk fetch jobs. Accessed via `client.fetch.bulk`.\n\n## create\n\n```ts\nclient.fetch.bulk.create(opts: FetchBulkCreateRequest, requestOptions?: RequestOptions): Promise<FetchBulkCreateResponse>\n```\n\nPOST /v1/fetch/bulk — create a bulk fetch job\n\n## get\n\n```ts\nclient.fetch.bulk.get(id: BulkId, requestOptions?: RequestOptions): Promise<FetchBulkGetResponse>\n```\n\nGET /v1/fetch/bulk/\\{id\\} — get a bulk fetch job\n\n## get\n\n```ts\nclient.fetch.bulk.get(id: BulkId, pageParams: FetchBulkPageParams, requestOptions?: RequestOptions): Promise<FetchBulkGetResponse>\n```\n\n## get\n\n```ts\nclient.fetch.bulk.get(id: BulkId, pageParamsOrRequestOptions: FetchBulkPageParams | RequestOptions = {}, requestOptions?: RequestOptions): Promise<FetchBulkGetResponse>\n```"
|
|
501
501
|
},
|
|
502
502
|
"sdk/typescript/monitors": {
|
|
503
503
|
"title": "Monitors",
|
|
@@ -507,12 +507,12 @@
|
|
|
507
507
|
"sdk/typescript/scrape": {
|
|
508
508
|
"title": "Scrape",
|
|
509
509
|
"section": "SDK Reference",
|
|
510
|
-
"body": "# Scrape\n\nFetch a URL as raw HTML, clean markdown, or structured content. Accessed via `client.scrape`.\n\n## create\n\n```ts\nclient.scrape.create(opts: ScrapeOpts, requestOptions?: RequestOptions): Promise<ScrapeCreateResponse>\n```\n\nPOST /v1/scrape — create a scrape job.\n\nResolves to the 200 success envelope
|
|
510
|
+
"body": "# Scrape\n\nFetch a URL as raw HTML, clean markdown, or structured content. Accessed via `client.scrape`.\n\n## create\n\n```ts\nclient.scrape.create(opts: ScrapeOpts, requestOptions?: RequestOptions): Promise<ScrapeCreateResponse>\n```\n\nPOST /v1/scrape — create a scrape job.\n\nResolves to the 200 `success` content envelope or the 202 queued receipt;\nnarrow on `status` to tell them apart. A TERMINAL FAILURE THROWS: the server\ndelivers it as a `failed` envelope on HTTP 200 (a definitive upstream outcome\nis a result, not a transport error), and this method converts it into the\n`ByteKitError` you already catch — `err.code`, `err.message`, and `err.status`\n200 (#1870). `scrape.get(id)` is unchanged and still returns `failed` as data.\n\nSee `ScrapeCreateResponse` for the full precedence: `async: true` receipts\nimmediately, a browser-path request without it is held open until the render\nreaches a terminal state (200) or the server's hold window expires (202 — a\nreceipt you did not ask for), and everything else takes the fast path (200).\n\nA held request therefore occupies the connection for as long as the render\ntakes, up to the server's hold window (28 s by default) — well inside this\nSDK's 120 s default `timeoutMs`, but worth raising `requestTimeoutMs` if you\nlowered it.\n\n`requestOptions` carries the CLIENT-side abort budget (`requestTimeoutMs`) and an\noptional caller `signal`; both override the constructor's `timeoutMs` default. They\nare a different axis from `opts.timeout_ms`, which is the SERVER-side scrape budget.\n\n## get\n\n```ts\nclient.scrape.get(id: ScrapeId, requestOptions?: RequestOptions): Promise<ScrapeGetResponse>\n```\n\nGET /v1/scrape/\\{id\\} — poll a scrape by ID\n\n## Options (`ScrapeOpts`)\n\n- `url` (required) — `string`\n- `formats` — `Array<'raw' | 'markdown' | 'links' | 'images'>`\n- `country` — `string`\n- `delay_ms` — `number`\n- `timeout_ms` — `number` — SERVER-side scrape budget in ms — how long the gateway may spend on the scrape itself. For the CLIENT-side abort budget (when this SDK gives up on the wire), see `RequestOptions.requestTimeoutMs`.\n- `async` — `boolean`\n- `webhook_url` — `string`\n- `events` — `Array<'queued' | 'completed' | 'failed'>`\n- `markdown_mode` — `MarkdownMode` — Markdown processing mode. article=article extraction (default), raw=minimal cleanup, llm=compact LLM-optimised output.\n- `markdown_query` — `string` — BM25 query string for relevance-ranked content filtering. Omit or leave empty to disable.\n- `markdown_links` — `MarkdownLinks` — Link rendering style in the markdown output.\n- `markdown_images` — `MarkdownImages` — Image retention mode in the markdown output. Distinct from `markdown_filter_images` (which drops low-signal images before conversion).\n- `with_links_summary` — `boolean` — When true, appends a `Links:` footer to the markdown output. Automatically enabled when `markdown_links` is `'references'`.\n- `with_images_summary` — `boolean` — When true, appends an `Images:` footer to the markdown output.\n- `markdown_compact` — `boolean` — Collapse excessive whitespace for a more compact output.\n- `markdown_filter_images` — `boolean` — Filter low-signal images from the markdown output.\n- `markdown_include_media` — `boolean` — When true, `formats.links` and `formats.images` return `ScrapeScoredLink[]` / `ScrapeScoredImage[]` (rich objects) instead of `string[]`, and a top-level `tables` array is included. Only effective when `markdown` is in `formats`.\n- `markdown_include_warnings` — `boolean` — When true, the response includes markdown-pipeline and tag-filter warnings. `artifact_unavailable` may appear independently when a requested persisted format cannot be rehydrated.\n- `markdown_include_stats` — `boolean` — When true, the response includes a top-level `stats` object with `ScrapeStats` (chars, tokens, blocks). Only effective when `markdown` is in `formats`.\n- `token_budget` — `number` — Maximum token count for the markdown output. Truncates at the last paragraph → sentence → token boundary under the limit. Absent → no truncation.\n- `token_encoding` — `TokenEncoding` — Tokenizer encoding hint for `token_budget`. `cl100k_base` (default) matches GPT-4/4o; `o200k_base` matches GPT-4o-mini / o-series.\n- `mobile` — `boolean` — When true, emulate a mobile device (mobile UA + viewport). Default false (desktop). Part of the cache key, so mobile and desktop responses cache independently.\n- `remove_base64_images` — `boolean` — When true (default), base64-encoded `data:` image sources are stripped before markdown conversion. Set false to preserve them. Does not affect `raw`.\n- `include_tags` — `string[]` — HTML element names (not CSS selectors) to keep. When non-empty, only content within these elements is included in `markdown` output. Applied before `exclude_tags`. Does not affect `raw`.\n- `exclude_tags` — `string[]` — HTML element names (not CSS selectors) to strip from `markdown` output. Applied after `include_tags`. Does not affect `raw`.\n- `clean_markdown` — `boolean` — When true and `markdown` is in `formats`, the converted markdown is sent to Groq for cleaning before return. Graceful degradation on any Groq failure. Billing: 3× credits and bytes applied only when cleaning succeeds.\n- `cache_ttl` — `string | 0` — How long a freshly fetched URL may be served from cache. `'0'`/`0` skips the\ncache read (the result is still written), `'Nh'`/`'Nd'` set a TTL (capped at\n168h / 7d). Default `'48h'`. Honoured on both the synchronous and asynchronous\npaths; the async success envelope reports the outcome via the `cache` field.\n- `custom` — `Record<string, unknown>` — User-supplied JSON payload, echoed back on the success envelope so callers\ncan correlate the response to caller-side state (job IDs, batch metadata).\nCapped at 4096 UTF-8 bytes after JSON serialization. Does NOT affect\ncache-key inputs — two requests differing only in `custom` share the same\ncache slot."
|
|
511
511
|
},
|
|
512
512
|
"sdk/typescript/scrape-bulk": {
|
|
513
513
|
"title": "Scrape Bulk",
|
|
514
514
|
"section": "SDK Reference",
|
|
515
|
-
"body": "# Scrape Bulk\n\nCreate and poll bulk scrape jobs. Accessed via `client.scrape.bulk`.\n\n## create\n\n```ts\nclient.scrape.bulk.create(opts: ScrapeBulkCreateRequest, requestOptions?: RequestOptions): Promise<ScrapeBulkCreateResponse>\n```\n\nPOST /v1/scrape/bulk — create a bulk scrape job.\n\n`requestOptions` carries the CLIENT-side abort budget (`requestTimeoutMs`) and an\noptional caller `signal`; both override the constructor's `timeoutMs` default.\n\n## get\n\n```ts\nclient.scrape.bulk.get(id: BulkId, requestOptions?: RequestOptions): Promise<ScrapeBulkGetResponse>\n```\n\nGET /v1/scrape/bulk/\\{id\\} — get a bulk scrape job"
|
|
515
|
+
"body": "# Scrape Bulk\n\nCreate and poll bulk scrape jobs. Accessed via `client.scrape.bulk`.\n\n## create\n\n```ts\nclient.scrape.bulk.create(opts: ScrapeBulkCreateRequest, requestOptions?: RequestOptions): Promise<ScrapeBulkCreateResponse>\n```\n\nPOST /v1/scrape/bulk — create a bulk scrape job.\n\n`requestOptions` carries the CLIENT-side abort budget (`requestTimeoutMs`) and an\noptional caller `signal`; both override the constructor's `timeoutMs` default.\n\n## get\n\n```ts\nclient.scrape.bulk.get(id: BulkId, requestOptions?: RequestOptions): Promise<ScrapeBulkGetResponse>\n```\n\nGET /v1/scrape/bulk/\\{id\\} — get a bulk scrape job\n\n## get\n\n```ts\nclient.scrape.bulk.get(id: BulkId, pageParams: ScrapeBulkPageParams, requestOptions?: RequestOptions): Promise<ScrapeBulkGetResponse>\n```\n\n## get\n\n```ts\nclient.scrape.bulk.get(id: BulkId, pageParamsOrRequestOptions: ScrapeBulkPageParams | RequestOptions = {}, requestOptions?: RequestOptions): Promise<ScrapeBulkGetResponse>\n```"
|
|
516
516
|
},
|
|
517
517
|
"sdk/typescript/screenshots": {
|
|
518
518
|
"title": "Screenshots",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hunt-labs/bytekit-mcp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
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",
|