@hunt-labs/bytekit-mcp 0.3.5 → 0.3.6
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 +21 -0
- package/dist/docs-bundle/docs-bundle.json +17 -17
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,27 @@ today, see [README.md](./README.md), which remains the authoritative usage guide
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
## [0.3.6] - 2026-09-12
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- Refreshed the bundled documentation snapshot after the Python SDK changelog entry for #4340,
|
|
18
|
+
which records the split bulk list-item models and the new `BulkCompletedWebhook` model. The
|
|
19
|
+
`changelog` page concatenates four package changelogs and is cut at the 16,384-byte per-page
|
|
20
|
+
bound; the Python SDK entry is past the cut, so the only bundled bytes that move are in the
|
|
21
|
+
truncation notice, which reports the FULL size of the page it truncates. Bundled content only:
|
|
22
|
+
no tool, schema or transport change.
|
|
23
|
+
- Refreshed the bundled documentation snapshot after the audience-boundary audit of the
|
|
24
|
+
published docs corpus (#4381). The audit rewrote passages on the billing, scraping,
|
|
25
|
+
monitors, MCP-tool and command-line pages, and on the generated TypeScript client
|
|
26
|
+
reference, that described how ByteKit is implemented — internal storage tables and how
|
|
27
|
+
stored values are written, internal service ownership, operator-only webhook-ingress
|
|
28
|
+
routes, ByteKit's own staging host, repository provenance and private issue-tracker
|
|
29
|
+
numbers — rather than what a reader should do or expect. Every public rule, value, API
|
|
30
|
+
name and error code in those passages is retained, response fields named in the OpenAPI
|
|
31
|
+
spec included; only the implementation detail is gone. No tool, schema or runtime
|
|
32
|
+
behavior in this package changed.
|
|
33
|
+
|
|
13
34
|
## [0.3.5] - 2026-09-06
|
|
14
35
|
|
|
15
36
|
### Changed
|
|
@@ -252,12 +252,12 @@
|
|
|
252
252
|
"billing/balance": {
|
|
253
253
|
"title": "Balance and exhausted quota",
|
|
254
254
|
"section": "General",
|
|
255
|
-
"body": "# Balance and exhausted quota\n\nWhat happens when a ByteKit bandwidth or credit balance reaches zero.\n\nByteKit checks the relevant balance before admitting billable work. Capture endpoints use the bandwidth balance; search uses the credit balance; schema extraction requires both.\n\nWhen a request would exceed an enforced balance, ByteKit returns **HTTP 402** with the error code `quota_exceeded`. The request does not continue as unpriced usage.\n\nThere is no automatic overage: availability is an explicit plan setting, and
|
|
255
|
+
"body": "# Balance and exhausted quota\n\nWhat happens when a ByteKit bandwidth or credit balance reaches zero.\n\nByteKit checks the relevant balance before admitting billable work. Capture endpoints use the bandwidth balance; search uses the credit balance; schema extraction requires both.\n\nWhen a request would exceed an enforced balance, ByteKit returns **HTTP 402** with the error code `quota_exceeded`. The request does not continue as unpriced usage.\n\nThere is no automatic overage: availability is an explicit plan setting, reported as the `has_overage` field on your plan (`GET /v1/account`, `GET /v1/plans`) and on `GET /v1/usage`. No standard plan enables it — Starter, Growth and Scale report `has_overage: false`, so a credit-metered request past the included allowance is refused with 402 `quota_exceeded` rather than admitted as billable overage. Only a custom plan arranged with ByteKit can enable overage; on such a plan a configured spending cap can permit or reject additional usage, returning 402 `spending_cap_reached` when the cap is crossed. Capture endpoints still enforce their bandwidth budget.\n\n## Starter grant\n\nA new pay-as-you-go account receives a one-time starter grant when it is first created: **50 MB of bandwidth and 100 credits**. It is issued once per account, is not a purchase, and does not expire. Granted value is spent last — after your plan's included allowance and after any purchased top-up — so a top-up you paid for is never consumed while free grant remains.\n\n`GET /v1/billing/balance` reports the grant separately from purchases: `granted_topup_bytes` and `granted_topup_credits` hold the grant, `purchased_topup_bytes` and `purchased_topup_credits` hold what you bought, and `topup_bytes` / `topup_credits` are the two added together.\n\nTo continue after a hard balance stop, purchase a top-up or move to a plan with more included usage. Auto-top-up can purchase bandwidth before the configured threshold is crossed, but it must be enabled and configured in advance; reaching zero does not silently enable it.\n\nSee **Dashboard → Settings → Billing** for included usage, purchased and rollover balances, and auto-top-up status."
|
|
256
256
|
},
|
|
257
257
|
"billing/bandwidth": {
|
|
258
258
|
"title": "Bandwidth billing",
|
|
259
259
|
"section": "General",
|
|
260
|
-
"body": "# Bandwidth billing\n\nHow ByteKit measures billed bandwidth for capture and sitemap endpoints.\n\nByteKit bills most capture endpoints from bytes transferred over the upstream wire, not from the size of the final JSON, Markdown, image, or recording artifact. Sitemap jobs use the generated results artifact instead, as described below.\n\n## Upstream wire-byte endpoints\n\nFor scrape, fetch, crawl, and monitor requests, the amount taken from your balance is calculated once, at settlement, and rounded once:\n\n```\nbalance deduction = round(upstream wire bytes × endpoint factor × cache factor × clean-Markdown factor)\n```\n\nA cache hit contributes a **0.5×** factor. Successful clean-Markdown processing contributes a separate **3×** factor. The endpoint factor is listed below. All three compose; they are not alternative rates.\n\n### Endpoint factors\n\nEach endpoint carries a factor reflecting the work it performs:\n\n| Endpoint | Factor |\n| --- | ---: |\n| Scrape | 1× |\n| Scrape with Markdown output | 1.5× |\n| Fetch | 1× |\n| Fetch with Markdown output | 1.5× |\n| Crawl | 1.5× |\n| Crawl links | 1× |\n| Monitor run | 1× |\n\nRequesting Markdown output raises a scrape **or a fetch** from 1× to 1.5×, so a Markdown scrape and a Markdown fetch each deduct one and a half times their upstream wire bytes. The surcharge is not scrape-only.\n\nThis factor is part of what you are charged. `GET /v1/usage/by-endpoint`, the per-endpoint table under **Dashboard → Usage**, the `billing` object on each response and the `X-Billable-Bytes` header all report the same amount your balance lost — there is no separate reporting weight to reconcile.\n\nScreenshot and recording captures bill on a different basis, described under [Other capture artifacts](#other-capture-artifacts).\n\n## Sitemap\n\nSitemap billing uses the byte length of the **gzip-compressed generated results CSV**.
|
|
260
|
+
"body": "# Bandwidth billing\n\nHow ByteKit measures billed bandwidth for capture and sitemap endpoints.\n\nByteKit bills most capture endpoints from bytes transferred over the upstream wire, not from the size of the final JSON, Markdown, image, or recording artifact. Sitemap jobs use the generated results artifact instead, as described below.\n\n## Upstream wire-byte endpoints\n\nFor scrape, fetch, crawl, and monitor requests, the amount taken from your balance is calculated once, at settlement, and rounded once:\n\n```\nbalance deduction = round(upstream wire bytes × endpoint factor × cache factor × clean-Markdown factor)\n```\n\nA cache hit contributes a **0.5×** factor. Successful clean-Markdown processing contributes a separate **3×** factor. The endpoint factor is listed below. All three compose; they are not alternative rates.\n\n### Endpoint factors\n\nEach endpoint carries a factor reflecting the work it performs:\n\n| Endpoint | Factor |\n| --- | ---: |\n| Scrape | 1× |\n| Scrape with Markdown output | 1.5× |\n| Fetch | 1× |\n| Fetch with Markdown output | 1.5× |\n| Crawl | 1.5× |\n| Crawl links | 1× |\n| Monitor run | 1× |\n\nRequesting Markdown output raises a scrape **or a fetch** from 1× to 1.5×, so a Markdown scrape and a Markdown fetch each deduct one and a half times their upstream wire bytes. The surcharge is not scrape-only.\n\nThis factor is part of what you are charged. `GET /v1/usage/by-endpoint`, the per-endpoint table under **Dashboard → Usage**, the `billing` object on each response and the `X-Billable-Bytes` header all report the same amount your balance lost — there is no separate reporting weight to reconcile.\n\nScreenshot and recording captures bill on a different basis, described under [Other capture artifacts](#other-capture-artifacts).\n\n## Bulk\n\nA bulk job has **no endpoint factor of its own**. Each item settles independently, on exactly the basis the same request would use on its own: a scrape item as a scrape and a fetch item as a fetch, at that endpoint's factor from the table above, and a screenshot item — the type `/v1/bulk` assumes when you do not name one — on the separate capture basis under [Other capture artifacts](#other-capture-artifacts), which the table above does not cover.\n\nWhatever factors an item would carry alone, it carries in bulk: a cache hit still contributes **0.5×**, and successful clean-Markdown processing still contributes **3×** on the `/v1/scrape/bulk` items that can request it. A job's billed total is the sum of its items, with no per-job fee, no bulk surcharge and no bulk discount.\n\nSo a bulk job of Markdown scrapes bills at **1.5× per item, not 1×**: the Markdown surcharge is an endpoint factor, and bulk does not suppress it. Sending URLs in bulk saves you round trips, not bytes — the charge for each item is the same as it would be on its own request.\n\n## Sitemap\n\nSitemap billing uses the byte length of the **gzip-compressed generated results CSV**. ByteKit builds the results CSV for the job, compresses it, and bills that compressed length — the same figure your sitemap usage reports.\n\nDiscovery fetch bytes are not accumulated into the sitemap charge. The charged byte count is the compressed results artifact, not the upstream bytes transferred while discovering URLs.\n\n## Other capture artifacts\n\nScreenshots and recordings use a separate capture basis: `phase1WireBytes × 1.5`, rounded to whole bytes. The 1.5× combines the upstream Phase 1 fetch with rendering overhead. If Phase 1 has no positive wire-byte measurement, that capture contributes zero billable bytes.\n\nYour current allowance, purchased bandwidth, rollover bandwidth, and remaining balance are shown under **Dashboard → Settings → Billing**."
|
|
261
261
|
},
|
|
262
262
|
"billing/credits": {
|
|
263
263
|
"title": "Credit billing",
|
|
@@ -267,22 +267,22 @@
|
|
|
267
267
|
"billing/spending": {
|
|
268
268
|
"title": "Spending controls",
|
|
269
269
|
"section": "General",
|
|
270
|
-
"body": "# Spending controls\n\nHow spending caps and automatic bandwidth top-ups behave.\n\nByteKit has two distinct spending controls: a credit-overage cap and automatic bandwidth top-ups.\n\n## Credit-overage spending cap\n\nNo standard plan is overage-enabled: Starter, Growth and Scale stop at the included credit allowance with 402 `quota_exceeded`, so this cap never applies to them. It applies only to a custom plan arranged with ByteKit that carries an overage agreement.\n\nFor a credit-metered request on such a plan, ByteKit compares the calculated overage cost with the account's `max_overage_spend_cents`. When the request would cross that limit, the API returns **HTTP 402** with `spending_cap_reached`.\n\nThe current billing page does not expose a self-service control for this account-level overage cap. Contact support if it must be changed.\n\n## Automatic bandwidth top-ups\n\nThe billing page lets an account administrator enable or disable auto-top-up and configure:\n\n- the remaining-bandwidth threshold that triggers a purchase;\n- the amount of bandwidth to purchase; and\n- a monthly cap on automatic top-up spending, from $1 to $1,000.\n\nAll three are required when auto-top-up is enabled, and the account must have a Stripe customer. When remaining included bandwidth falls below the configured threshold, ByteKit queues a top-up — unless that purchase would take this month's automatic top-up spending past the cap, in which case it is skipped until the next month. An account that has never stored a cap is uncapped, and the API reports its cap as `null`.\n\nThese controls do not configure purchased-balance expiration. See [Top-ups](https://bytekit.com/docs/billing/top-ups) for the expiry and rollover rules
|
|
270
|
+
"body": "# Spending controls\n\nHow spending caps and automatic bandwidth top-ups behave.\n\nByteKit has two distinct spending controls: a credit-overage cap and automatic bandwidth top-ups.\n\n## Credit-overage spending cap\n\nNo standard plan is overage-enabled: Starter, Growth and Scale stop at the included credit allowance with 402 `quota_exceeded`, so this cap never applies to them. It applies only to a custom plan arranged with ByteKit that carries an overage agreement.\n\nFor a credit-metered request on such a plan, ByteKit compares the calculated overage cost with the account's `max_overage_spend_cents`. When the request would cross that limit, the API returns **HTTP 402** with `spending_cap_reached`.\n\nThe current billing page does not expose a self-service control for this account-level overage cap. Contact support if it must be changed.\n\n## Automatic bandwidth top-ups\n\nThe billing page lets an account administrator enable or disable auto-top-up and configure:\n\n- the remaining-bandwidth threshold that triggers a purchase;\n- the amount of bandwidth to purchase; and\n- a monthly cap on automatic top-up spending, from $1 to $1,000.\n\nAll three are required when auto-top-up is enabled, and the account must have a Stripe customer. When remaining included bandwidth falls below the configured threshold, ByteKit queues a top-up — unless that purchase would take this month's automatic top-up spending past the cap, in which case it is skipped until the next month. An account that has never stored a cap is uncapped, and the API reports its cap as `null`.\n\nThese controls do not configure purchased-balance expiration. See [Top-ups](https://bytekit.com/docs/billing/top-ups) for the expiry and rollover rules that apply instead."
|
|
271
271
|
},
|
|
272
272
|
"billing/top-ups": {
|
|
273
273
|
"title": "Top-ups and rollover",
|
|
274
274
|
"section": "General",
|
|
275
|
-
"body": "# Top-ups and rollover\n\nHow purchased bandwidth and credits expire, carry across periods, and are consumed.\n\nTop-ups add bandwidth or credits without changing your plan's included allowance.
|
|
275
|
+
"body": "# Top-ups and rollover\n\nHow purchased bandwidth and credits expire, carry across periods, and are consumed.\n\nTop-ups add bandwidth or credits without changing your plan's included allowance. Each purchase is recorded as its own lot, with its own expiry date. Value is spent in one order: your plan's included allowance, including any rollover from earlier periods, then purchased top-ups, then the one-time starter grant.\n\n## Expiration\n\nPurchased top-up lots expire **180 days after the payment provider object was created**. A cancellation or downgrade freezes the lot and **resets that deadline to 90 days from the freeze**. The reset runs in both directions: a lot with five months left loses that time, and a lot that was about to expire gains a little. The window is fixed; it is not configurable in the dashboard. Expired lots are removed from the active purchased balance and cannot fund new usage. If your subscription is cancelled or lapses, any purchased balance above the pay-as-you-go tier is held (not spent, not forfeited) until you resubscribe at the same tier or higher. Restoring the balance does not restore the original deadline — a released lot keeps the date the freeze assigned it. A second freeze restamps from that second freeze, because the rule is keyed to the event, not to the lot.\n\n## Billing-period rollover\n\nUnused bandwidth from your monthly plan allowance rolls over to the next billing period with no cap, for as long as the subscription stays on its plan or moves to a higher one. A downgrade or cancellation freezes it: the frozen balance stops being spendable, and resubscribing at the same tier or higher within 90 days restores it in full — after that it is permanently lost. Purchased value is held separately from the billing period you bought it in, so it is not reset when that period rolls over; the `topup_bytes` and `topup_credits` fields report the purchased balance that is still eligible and unexpired.\n\nCredits do not roll over — they reset every billing period. This does not affect top-up expiry, which follows the rule above and is not configurable.\n\nYour current purchased and rollover balances appear under **Dashboard → Settings → Billing**."
|
|
276
276
|
},
|
|
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.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]"
|
|
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 180123 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",
|
|
284
284
|
"section": "CLI Reference",
|
|
285
|
-
"body": "# Install & Authenticate\n\nInstall the ByteKit CLI, authenticate, and learn the global flags shared by every command.\n\nThe `bytekit` CLI wraps the ByteKit API as shell subcommands — scrape, screenshot,\nsearch, monitor, and more, straight from your terminal.\n\n## Install\n\nInstall globally from npm:\n\n```bash\nnpm install -g @hunt-labs/bytekit-cli\n```\n\nThis puts the `bytekit` binary on your `PATH`. Verify the install:\n\n```bash\nbytekit --version\n```\n\n## Authenticate\n\nEvery command needs an API key. You can provide it two ways:\n\n**1. Environment variable (recommended)**\n\nSet `BYTEKIT_API_KEY` once and every command picks it up automatically:\n\n```bash\nexport BYTEKIT_API_KEY=\"sk_live_your_api_key_here\"\nbytekit scrape create --url https://example.com\n```\n\n**2. The `--key` flag**\n\nPass the key inline for a single command (overrides the env var):\n\n```bash\nbytekit scrape create --url https://example.com --key sk_live_your_api_key_here\n```\n\nThe resolution order is: `--key` flag → `BYTEKIT_API_KEY` environment variable.\nIf neither is set, the command exits with `Error: API key required. Pass --key or set BYTEKIT_API_KEY.`\n\n## Global flags\n\nThese flags are available on every command:\n\n| Flag | Description |\n| --- | --- |\n| `--key <key>` | API key for this invocation. Overrides `BYTEKIT_API_KEY`. |\n| `--base-url <url>` | Override the API base URL (or set `BYTEKIT_BASE_URL`).
|
|
285
|
+
"body": "# Install & Authenticate\n\nInstall the ByteKit CLI, authenticate, and learn the global flags shared by every command.\n\nThe `bytekit` CLI wraps the ByteKit API as shell subcommands — scrape, screenshot,\nsearch, monitor, and more, straight from your terminal.\n\n## Install\n\nInstall globally from npm:\n\n```bash\nnpm install -g @hunt-labs/bytekit-cli\n```\n\nThis puts the `bytekit` binary on your `PATH`. Verify the install:\n\n```bash\nbytekit --version\n```\n\n## Authenticate\n\nEvery command needs an API key. You can provide it two ways:\n\n**1. Environment variable (recommended)**\n\nSet `BYTEKIT_API_KEY` once and every command picks it up automatically:\n\n```bash\nexport BYTEKIT_API_KEY=\"sk_live_your_api_key_here\"\nbytekit scrape create --url https://example.com\n```\n\n**2. The `--key` flag**\n\nPass the key inline for a single command (overrides the env var):\n\n```bash\nbytekit scrape create --url https://example.com --key sk_live_your_api_key_here\n```\n\nThe resolution order is: `--key` flag → `BYTEKIT_API_KEY` environment variable.\nIf neither is set, the command exits with `Error: API key required. Pass --key or set BYTEKIT_API_KEY.`\n\n## Global flags\n\nThese flags are available on every command:\n\n| Flag | Description |\n| --- | --- |\n| `--key <key>` | API key for this invocation. Overrides `BYTEKIT_API_KEY`. |\n| `--base-url <url>` | Override the API base URL (or set `BYTEKIT_BASE_URL`). |\n| `--json` | Print the raw JSON response instead of the formatted, human-readable output. |\n| `-V, --version` | Print the CLI version and exit. |\n| `-h, --help` | Show help for the program or a subcommand. |\n\nFor example, to get the raw JSON response instead of the formatted output:\n\n```bash\nbytekit scrape create --url https://example.com --json\n```\n\n## Next steps\n\n- [Scrape](https://bytekit.com/docs/cli/scrape) — capture URL content as markdown, HTML, or structured data.\n- [Screenshots](https://bytekit.com/docs/cli/screenshots) — render full-page or viewport screenshots.\n- [Monitors](https://bytekit.com/docs/cli/monitors) — track page changes on a schedule.\n- [API Reference](https://bytekit.com/docs/api) — the underlying REST endpoints."
|
|
286
286
|
},
|
|
287
287
|
"cli/account": {
|
|
288
288
|
"title": "Account",
|
|
@@ -352,7 +352,7 @@
|
|
|
352
352
|
"guides/monitors": {
|
|
353
353
|
"title": "Monitors",
|
|
354
354
|
"section": "Guides",
|
|
355
|
-
"body": "# Monitors\n\nDetect page changes on any URL — by screenshot or scrape — and receive webhook notifications.\n\nMonitors periodically capture a URL and notify you when the page changes. Each monitor uses one\nof two capture types: `screenshot` (perceptual/visual change detection) or `scrape` (content and\nmarkdown change detection). Use them for price tracking, content alerts, uptime monitoring, or\ncompetitor surveillance.\n\n## Create a monitor\n\n```bash\ncurl -X POST https://api.bytekit.com/v1/monitors \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"url\": \"https://example.com/pricing\",\n \"interval_type\": \"hourly\",\n \"webhook_url\": \"https://your-server.example.com/webhooks/bytekit\"\n }'\n```\n\n| Field | Description |\n|-------|-------------|\n| `url` | The page to monitor (required) |\n| `interval_type` | Check frequency — one of `hourly`, `daily`, `weekly`, or `cron` (required) |\n| `webhook_url` | HTTPS webhook endpoint to receive notifications. `http://` is rejected with a 400 `invalid_url` (reason `scheme_unsupported`) (required) |\n| `cron_expression` | 5-field cron expression. Required when `interval_type` is `cron` |\n| `type` | Capture mode — `screenshot` (default) or `scrape` |\n| `change_threshold` | Percentage of change required to trigger a notification (0–100, default `5`). Screenshot monitors only |\n| `notify_on` | `change` (default — notify only when content changed) or `every` (notify on every capture) |\n| `webhook_secret` | Optional secret used to sign webhook deliveries. Deliveries carry `X-Webhook-Signature` and `X-Webhook-Timestamp` — see [Webhooks](https://bytekit.com/docs/guides/webhooks) to verify them |\n| `webhook_headers` | Optional custom headers (max 20) to include on each webhook delivery |\n\nA successful response returns the monitor object with an `id` prefixed `mon_`:\n\n```json\n{\n \"id\": \"mon_...\",\n \"type\": \"screenshot\",\n \"url\": \"https://example.com/pricing\",\n \"status\": \"active\",\n \"interval_type\": \"hourly\",\n \"cron_expression\": null,\n \"next_capture_at\": \"2026-01-01T01:00:00Z\",\n \"notify_on\": \"change\",\n \"webhook_url\": \"https://your-server.example.com/webhooks/bytekit\",\n \"captures_count\": 0,\n \"changes_count\": 0,\n \"created_at\": \"2026-01-01T00:00:00Z\"\n}\n```\n\nTo monitor on a schedule, set `interval_type` to `cron` and supply a 5-field `cron_expression`:\n\n```bash\ncurl -X POST https://api.bytekit.com/v1/monitors \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"url\": \"https://example.com/pricing\",\n \"interval_type\": \"cron\",\n \"cron_expression\": \"0 9 * * 1-5\",\n \"webhook_url\": \"https://your-server.example.com/webhooks/bytekit\"\n }'\n```\n\n## List monitors\n\n```bash\ncurl https://api.bytekit.com/v1/monitors \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\"\n```\n\n## Get a monitor\n\n```bash\ncurl https://api.bytekit.com/v1/monitors/mon_... \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\"\n```\n\n## Update a monitor\n\n```bash\ncurl -X PATCH https://api.bytekit.com/v1/monitors/mon_... \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"interval_type\": \"daily\"}'\n```\n\nYou can update any subset of the monitor's mutable fields — for example `interval_type`,\n`cron_expression`, `webhook_url`, `notify_on`, `change_threshold`, or `status`\n(`active` / `paused`). Switching to a `cron` schedule requires a `cron_expression`:\n\n```bash\ncurl -X PATCH https://api.bytekit.com/v1/monitors/mon_... \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"interval_type\": \"cron\", \"cron_expression\": \"*/30 * * * *\"}'\n```\n\n## Delete a monitor\n\n```bash\ncurl -X DELETE https://api.bytekit.com/v1/monitors/mon_... \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\"\n```\n\n## Monitor captures\n\nEach time a monitor fires it records a capture event — on **every** run, whether or not the\ncontent changed. Each capture carries a `has_change` flag marking whether the content differed\nfrom the previous capture. Webhook delivery is separate: the capture is always recorded, but\nwhether a webhook is *sent* depends on `has_change` and the monitor's `notify_on` setting (see\n[Webhook payload](#webhook-payload) below). Retrieve the capture history with:\n\n```bash\ncurl https://api.bytekit.com/v1/monitors/mon_.../captures \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\"\n```\n\nEach capture in the list represents one capture event and includes change metadata — the\ntimestamp, whether the content changed (`has_change`), the percentage of content that changed\n(`change_pct`), and the perceptual hash distance from the previous capture. Captures record\n*that* the content changed and by how much; they do not include a line-by-line textual diff.\n\n### First-capture behavior (silent baseline for both types)\n\nThe very first capture of a monitor has **no previous capture to compare against**. Both monitor\ntypes treat that first run as a **silent baseline** — one universal \"first capture\" behavior,\nno per-type divergence:\n\n| Monitor type | First capture | `has_change` | `change_pct` | Webhook on first capture |\n|--------------|---------------|--------------|--------------|--------------------------|\n| `scrape` | Silent baseline | `false` | `null` | **No** `monitor.change_detected`-equivalent webhook (the baseline is just recorded) |\n| `screenshot` | Silent baseline | `false` | `null` | **No** `monitor.change_detected` webhook (the baseline is just recorded) |\n\nNeither a **scrape** nor a **screenshot** monitor alerts you on its first run — both only alert\nonce a *subsequent* capture differs (scrape by exact content-hash inequality, screenshot by at\nleast `change_threshold`). A monitor with `notify_on: \"every\"` still sends a `monitor.captured`\nwebhook on the first capture — that is the per-capture notification, not a change alert, and it\nfires for both monitor types. From the second capture onward both types behave the same way each\nnew capture is compared against the previous one — scrape by exact SHA-256 content equality,\nscreenshot by perceptual-hash distance against `change_threshold`.\n\n**Existing scrape monitors:** if you created a scrape monitor before this change shipped, its\nfirst post-deploy capture will no longer fire a `monitor.change_detected`-equivalent webhook —\nthe first capture after the change is now the silent baseline, matching screenshot monitors.\nSteady-state alerting (second capture onward) is unaffected.\n\n**Repointing a monitor's `url`:** `PATCH`-ing a monitor's `url` to a different address re-enters\nthis same silent-baseline behavior — the capture immediately after a repoint is treated as a\nfresh first capture (`has_change: false`, `change_pct: null`, no `monitor.change_detected`-equivalent\nwebhook for `scrape` monitors, no `monitor.change_detected` webhook for `screenshot` monitors),\nsince the stored comparison baseline for the old URL no longer applies to the new one.\nSteady-state alerting resumes from the *second* capture after the repoint.\n\nThis silence isn't guaranteed if a capture was already in flight against the old URL when the\n`PATCH` landed: that capture can still complete and write its result back as the new baseline,\nso the repoint's silent-baseline behavior is deferred to the *next* capture rather than applying\nto the in-flight one.\n\n## Webhook payload\n\nWhen a monitor fires, ByteKit sends a `POST` to your `webhook_url`. Every delivery carries an\n`X-ByteKit-Event` header naming the event type — dispatch on that header rather than inspecting\nthe body shape. The event type and payload depend on the monitor's `type`.\n\n### Screenshot monitors (`type: \"screenshot\"`, default)\n\nScreenshot captures send `monitor.change_detected` when the page changed (`X-ByteKit-Event:\nmonitor.change_detected`) and `monitor.captured` when there was no change but\n`notify_on: \"every\"` is set (`X-ByteKit-Event: monitor.captured`). The body carries the capture\nmetadata:\n\n```json\n{\n \"monitor_id\": \"mon_...\",\n \"screenshot_id\": \"ss_...\",\n \"has_change\": true,\n \"change_pct\": 42.0,\n \"hash_distance\": 18,\n \"url\": \"https://example.com/pricing\"\n}\n```\n\n| Field | Description |\n|-------|-------------|\n| `has_change` | `true` when the captured content differs from the previous capture |\n| `change_pct` | Percentage of content that changed (0–100) |\n| `hash_distance` | Perceptual-hash distance from the previous capture |\n| `screenshot_id` | The screenshot that triggered the notification |\n\n### Scrape monitors (`type: \"scrape\"`)\n\nScrape captures send `scrape.completed` (`X-ByteKit-Event: scrape.completed`) with the full\nscrape result envelope inline:\n\n```json\n{\n \"success\": true,\n \"type\": \"scrape.completed\",\n \"id\": \"mon_...\",\n \"scrape_id\": \"sc_...\",\n \"has_change\": true,\n \"change_pct\": 100.0,\n \"metadata\": {},\n \"scrape\": {\n \"status\": \"success\",\n \"id\": \"sc_...\",\n \"url\": \"https://example.com/pricing\",\n \"final_url\": \"https://example.com/pricing\",\n \"content_length\": 1256,\n \"status_code\": 200,\n \"formats\": {\n \"markdown\": \"...\"\n }\n }\n}\n```\n\n| Field | Description |\n|-------|-------------|\n| `has_change` | `true` when the captured content differs from the previous capture |\n| `change_pct` | Percentage of content that changed (0–100) |\n| `scrape` | Full scrape result envelope (same shape as `POST /v1/scrape` response) |\n\nYour endpoint must respond with `2xx` within 10 seconds. Failed deliveries are retried with\nexponential backoff.\n\n## Next steps\n\n- [Webhooks](https://bytekit.com/docs/guides/webhooks) — verify the `X-Webhook-Signature` on every delivery\n- [API Reference: Monitors](https://bytekit.com/docs/api/monitors/createmonitor) — full endpoint schema\n- [Errors](https://bytekit.com/docs/guides/errors) — error codes returned by monitor endpoints"
|
|
355
|
+
"body": "# Monitors\n\nDetect page changes on any URL — by screenshot or scrape — and receive webhook notifications.\n\nMonitors periodically capture a URL and notify you when the page changes. Each monitor uses one\nof two capture types: `screenshot` (perceptual/visual change detection) or `scrape` (content and\nmarkdown change detection). Use them for price tracking, content alerts, uptime monitoring, or\ncompetitor surveillance.\n\n## Create a monitor\n\n```bash\ncurl -X POST https://api.bytekit.com/v1/monitors \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"url\": \"https://example.com/pricing\",\n \"interval_type\": \"hourly\",\n \"webhook_url\": \"https://your-server.example.com/webhooks/bytekit\"\n }'\n```\n\n| Field | Description |\n|-------|-------------|\n| `url` | The page to monitor (required) |\n| `interval_type` | Check frequency — one of `hourly`, `daily`, `weekly`, or `cron` (required) |\n| `webhook_url` | HTTPS webhook endpoint to receive notifications. `http://` is rejected with a 400 `invalid_url` (reason `scheme_unsupported`) (required) |\n| `cron_expression` | 5-field cron expression. Required when `interval_type` is `cron` |\n| `type` | Capture mode — `screenshot` (default) or `scrape` |\n| `change_threshold` | Percentage of change required to trigger a notification (0–100, default `5`). Screenshot monitors only |\n| `notify_on` | `change` (default — notify only when content changed) or `every` (notify on every capture) |\n| `webhook_secret` | Optional secret used to sign webhook deliveries. Deliveries carry `X-Webhook-Signature` and `X-Webhook-Timestamp` — see [Webhooks](https://bytekit.com/docs/guides/webhooks) to verify them |\n| `webhook_headers` | Optional custom headers (max 20) to include on each webhook delivery |\n\nA successful response returns the monitor object with an `id` prefixed `mon_`:\n\n```json\n{\n \"id\": \"mon_...\",\n \"type\": \"screenshot\",\n \"url\": \"https://example.com/pricing\",\n \"status\": \"active\",\n \"interval_type\": \"hourly\",\n \"cron_expression\": null,\n \"next_capture_at\": \"2026-01-01T01:00:00Z\",\n \"notify_on\": \"change\",\n \"webhook_url\": \"https://your-server.example.com/webhooks/bytekit\",\n \"captures_count\": 0,\n \"changes_count\": 0,\n \"created_at\": \"2026-01-01T00:00:00Z\"\n}\n```\n\nTo monitor on a schedule, set `interval_type` to `cron` and supply a 5-field `cron_expression`:\n\n```bash\ncurl -X POST https://api.bytekit.com/v1/monitors \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"url\": \"https://example.com/pricing\",\n \"interval_type\": \"cron\",\n \"cron_expression\": \"0 9 * * 1-5\",\n \"webhook_url\": \"https://your-server.example.com/webhooks/bytekit\"\n }'\n```\n\n## List monitors\n\n```bash\ncurl https://api.bytekit.com/v1/monitors \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\"\n```\n\n## Get a monitor\n\n```bash\ncurl https://api.bytekit.com/v1/monitors/mon_... \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\"\n```\n\n## Update a monitor\n\n```bash\ncurl -X PATCH https://api.bytekit.com/v1/monitors/mon_... \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"interval_type\": \"daily\"}'\n```\n\nYou can update any subset of the monitor's mutable fields — for example `interval_type`,\n`cron_expression`, `webhook_url`, `notify_on`, `change_threshold`, or `status`\n(`active` / `paused`). Switching to a `cron` schedule requires a `cron_expression`:\n\n```bash\ncurl -X PATCH https://api.bytekit.com/v1/monitors/mon_... \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"interval_type\": \"cron\", \"cron_expression\": \"*/30 * * * *\"}'\n```\n\n## Delete a monitor\n\n```bash\ncurl -X DELETE https://api.bytekit.com/v1/monitors/mon_... \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\"\n```\n\n## Monitor captures\n\nEach time a monitor fires it records a capture event — on **every** run, whether or not the\ncontent changed. Each capture carries a `has_change` flag marking whether the content differed\nfrom the previous capture. Webhook delivery is separate: the capture is always recorded, but\nwhether a webhook is *sent* depends on `has_change` and the monitor's `notify_on` setting (see\n[Webhook payload](#webhook-payload) below). Retrieve the capture history with:\n\n```bash\ncurl https://api.bytekit.com/v1/monitors/mon_.../captures \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\"\n```\n\nEach capture in the list represents one capture event and includes change metadata — the\ntimestamp, whether the content changed (`has_change`), the percentage of content that changed\n(`change_pct`), and the perceptual hash distance from the previous capture. Captures record\n*that* the content changed and by how much; they do not include a line-by-line textual diff.\n\n### First-capture behavior (silent baseline for both types)\n\nThe very first capture of a monitor has **no previous capture to compare against**. Both monitor\ntypes treat that first run as a **silent baseline** — one universal \"first capture\" behavior,\nno per-type divergence:\n\n| Monitor type | First capture | `has_change` | `change_pct` | Webhook on first capture |\n|--------------|---------------|--------------|--------------|--------------------------|\n| `scrape` | Silent baseline | `false` | `null` | **No** `monitor.change_detected`-equivalent webhook (the baseline is just recorded) |\n| `screenshot` | Silent baseline | `false` | `null` | **No** `monitor.change_detected` webhook (the baseline is just recorded) |\n\nNeither a **scrape** nor a **screenshot** monitor alerts you on its first run — both only alert\nonce a *subsequent* capture differs (scrape by exact content-hash inequality, screenshot by at\nleast `change_threshold`). A monitor with `notify_on: \"every\"` still sends a `monitor.captured`\nwebhook on the first capture — that is the per-capture notification, not a change alert, and it\nfires for both monitor types. From the second capture onward both types behave the same way each\nnew capture is compared against the previous one — scrape by exact SHA-256 content equality,\nscreenshot by perceptual-hash distance against `change_threshold`.\n\n**Repointing a monitor's `url`:** `PATCH`-ing a monitor's `url` to a different address re-enters\nthis same silent-baseline behavior — the capture immediately after a repoint is treated as a\nfresh first capture (`has_change: false`, `change_pct: null`, no `monitor.change_detected`-equivalent\nwebhook for `scrape` monitors, no `monitor.change_detected` webhook for `screenshot` monitors),\nsince the stored comparison baseline for the old URL no longer applies to the new one.\nSteady-state alerting resumes from the *second* capture after the repoint.\n\nThis silence isn't guaranteed if a capture was already in flight against the old URL when the\n`PATCH` landed: that capture can still complete and write its result back as the new baseline,\nso the repoint's silent-baseline behavior is deferred to the *next* capture rather than applying\nto the in-flight one.\n\n## Webhook payload\n\nWhen a monitor fires, ByteKit sends a `POST` to your `webhook_url`. Every delivery carries an\n`X-ByteKit-Event` header naming the event type — dispatch on that header rather than inspecting\nthe body shape. The event type and payload depend on the monitor's `type`.\n\n### Screenshot monitors (`type: \"screenshot\"`, default)\n\nScreenshot captures send `monitor.change_detected` when the page changed (`X-ByteKit-Event:\nmonitor.change_detected`) and `monitor.captured` when there was no change but\n`notify_on: \"every\"` is set (`X-ByteKit-Event: monitor.captured`). The body carries the capture\nmetadata:\n\n```json\n{\n \"monitor_id\": \"mon_...\",\n \"screenshot_id\": \"ss_...\",\n \"has_change\": true,\n \"change_pct\": 42.0,\n \"hash_distance\": 18,\n \"url\": \"https://example.com/pricing\"\n}\n```\n\n| Field | Description |\n|-------|-------------|\n| `has_change` | `true` when the captured content differs from the previous capture |\n| `change_pct` | Percentage of content that changed (0–100) |\n| `hash_distance` | Perceptual-hash distance from the previous capture |\n| `screenshot_id` | The screenshot that triggered the notification |\n\n### Scrape monitors (`type: \"scrape\"`)\n\nScrape captures send `scrape.completed` (`X-ByteKit-Event: scrape.completed`) with the full\nscrape result envelope inline:\n\n```json\n{\n \"success\": true,\n \"type\": \"scrape.completed\",\n \"id\": \"mon_...\",\n \"scrape_id\": \"sc_...\",\n \"has_change\": true,\n \"change_pct\": 100.0,\n \"metadata\": {},\n \"scrape\": {\n \"status\": \"success\",\n \"id\": \"sc_...\",\n \"url\": \"https://example.com/pricing\",\n \"final_url\": \"https://example.com/pricing\",\n \"content_length\": 1256,\n \"status_code\": 200,\n \"formats\": {\n \"markdown\": \"...\"\n }\n }\n}\n```\n\n| Field | Description |\n|-------|-------------|\n| `has_change` | `true` when the captured content differs from the previous capture |\n| `change_pct` | Percentage of content that changed (0–100) |\n| `scrape` | Full scrape result envelope (same shape as `POST /v1/scrape` response) |\n\nYour endpoint must respond with `2xx` within 10 seconds. Failed deliveries are retried with\nexponential backoff.\n\n## Next steps\n\n- [Webhooks](https://bytekit.com/docs/guides/webhooks) — verify the `X-Webhook-Signature` on every delivery\n- [API Reference: Monitors](https://bytekit.com/docs/api/monitors/createmonitor) — full endpoint schema\n- [Errors](https://bytekit.com/docs/guides/errors) — error codes returned by monitor endpoints"
|
|
356
356
|
},
|
|
357
357
|
"guides/rate-limits": {
|
|
358
358
|
"title": "Rate Limits",
|
|
@@ -362,7 +362,7 @@
|
|
|
362
362
|
"guides/scraping": {
|
|
363
363
|
"title": "Scraping",
|
|
364
364
|
"section": "Guides",
|
|
365
|
-
"body": "# Scraping\n\nScrape any URL as HTML, markdown, or structured content — formats, options, latency, and async polling.\n\n`POST /v1/scrape` fetches a URL and returns its content in the format you ask for. The same\nrequest shape works for every site; the options you pass determine the output and how long the\ncall takes.\n\n## Rendering & latency\n\nMost scrapes return in well under a second. Some options require ByteKit to fully render the page\nbefore it can return content, which takes longer — typically a few seconds. Pass these only when\nyou need them:\n\n| Option | When it adds latency |\n|--------|----------------------|\n| `delay_ms` | Greater than `0` |\n| `async` | `true` (request is queued and processed
|
|
365
|
+
"body": "# Scraping\n\nScrape any URL as HTML, markdown, or structured content — formats, options, latency, and async polling.\n\n`POST /v1/scrape` fetches a URL and returns its content in the format you ask for. The same\nrequest shape works for every site; the options you pass determine the output and how long the\ncall takes.\n\n## Rendering & latency\n\nMost scrapes return in well under a second. Some options require ByteKit to fully render the page\nbefore it can return content, which takes longer — typically a few seconds. Pass these only when\nyou need them:\n\n| Option | When it adds latency |\n|--------|----------------------|\n| `delay_ms` | Greater than `0` |\n| `async` | `true` (the request is queued and processed in the background) |\n\nThe `country` option routes the request through a geo-located proxy. On its own it does not add\nrendering latency; it only does so when combined with one of the options above.\n\nLooking for `wait_for_selector` or `wait_until`? Those are not `ScrapeRequest` options — they\nbelong to the [Screenshot](https://bytekit.com/docs/api/screenshots/createscreenshot) endpoint. Sending them to\n`/v1/scrape` returns `422`.\n\n`cookies` and `headers` are no longer request options on any capture endpoint. Sending either\nreturns `400 validation_error`.\n\n```bash\n# A simple, low-latency scrape\ncurl -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```bash\n# Slower: delay_ms forces a full render and waits before returning\ncurl -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 '{\n \"url\": \"https://example.com\",\n \"delay_ms\": 2000\n }'\n```\n\n## Response fields\n\nThe default format is `raw` — pass `formats` to request others (`markdown`, `links`,\n`images`). The `formats` object in the response is keyed by the format you requested.\n\nEnvelope fields are `snake_case`; the keys inside `metadata` are the page's own metadata and\nstay `camelCase`.\n\n| Field | Description |\n|-------|-------------|\n| `schema_version` | Response envelope version (currently `1`) |\n| `formats.raw` | Page content in the requested format (`raw` is the default when `formats` is omitted) |\n| `final_url` | URL the fetch landed on after redirects |\n| `content_type` | `Content-Type` reported by the origin |\n| `content_length` | Compressed wire bytes — the *basis* for bandwidth billing, before the endpoint factor (see `billing`) |\n| `status_code` | HTTP status code of the origin page |\n| `retrieved_at` | ISO-8601 UTC timestamp of the fetch |\n| `cache` | `\"hit\"` or `\"miss\"` |\n| `cache_age_s` | Age of the cached entry in seconds — present only on a hit |\n| `billing` | What the request cost: `raw_bytes`, the `factors` applied, the resulting `multiplier`, and `billed_bytes` |\n| `metadata.title` | Page `<title>` element |\n\nThe `X-Scrape-*` response headers describe how each request was handled (cache status, timing,\nand the final URL) — useful for debugging.\n\n## Async scrapes\n\nFor long-running pages, pass `\"async\": true` to get a `202 Accepted` response with a scrape\n`id` prefixed `sc_`. Poll the result with `GET /v1/scrape/{id}`.\n\n```bash\n# Start async scrape\ncurl -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\", \"async\": true}'\n\n# Poll for result\ncurl https://api.bytekit.com/v1/scrape/sc_... \\\n -H \"Authorization: Bearer sk_live_YOUR_KEY_HERE\"\n```\n\n## Webhook event header\n\nEvery outbound webhook POST includes an `X-ByteKit-Event` header with the event type:\n\n| Event type | Trigger |\n|---|---|\n| `bulk.completed` | A bulk job finishes (all items processed) |\n| `scrape.completed` | An async scrape succeeds |\n| `scrape.failed` | An async scrape fails terminally |\n| `monitor.change_detected` | A monitor fires and detects a change (screenshot or content) |\n| `monitor.captured` | A monitor fires with no change detected (notify_on: every) |\n| `sitemap.completed` | A sitemap job finishes |\n| `sitemap.failed` | A sitemap job fails terminally |\n\nUse this header to dispatch events without inspecting the body shape:\n\n```python\nfrom flask import Flask, request\n\napp = Flask(__name__)\n\n@app.route(\"/webhooks/bytekit\", methods=[\"POST\"])\ndef handle():\n event = request.headers.get(\"X-ByteKit-Event\")\n if event == \"bulk.completed\":\n handle_bulk(request.json)\n elif event == \"scrape.completed\":\n handle_scrape(request.json)\n return \"\", 200\n```\n\n`X-ByteKit-Event` is a reserved header — you cannot supply it via `webhook_headers` in\nmonitor or bulk configuration. Attempts to do so will be rejected with a `422` at request\ntime.\n\n## Next steps\n\n- [Rate Limits](https://bytekit.com/docs/guides/rate-limits) — quota model and concurrency slots\n- [Errors](https://bytekit.com/docs/guides/errors) — how to interpret and retry error responses\n- [API Reference: Scrape](https://bytekit.com/docs/api/scrape/createscrape) — full request/response schema"
|
|
366
366
|
},
|
|
367
367
|
"guides/webhooks": {
|
|
368
368
|
"title": "Webhooks",
|
|
@@ -397,12 +397,12 @@
|
|
|
397
397
|
"mcp": {
|
|
398
398
|
"title": "MCP Server",
|
|
399
399
|
"section": "General",
|
|
400
|
-
"body": "# MCP Server\n\nCall ByteKit web capture as a native tool from Claude, Cursor, and any MCP-compatible agent — hosted over HTTP or run locally over stdio.\n\nThe ByteKit **MCP server** exposes scraping, search, screenshots, and account\nlookups as [Model Context Protocol](https://modelcontextprotocol.io) tools. Your\nagent calls `scrape_url` or `screenshot_url` the same way it calls any other\ntool — no wrapper to write, no headless browser to manage.\n\nThere are two ways to connect: a **hosted HTTP endpoint** (nothing to install)\nand a **local stdio server** (`npx @hunt-labs/bytekit-mcp`).\n\n## Authentication\n\nBoth paths authenticate with a ByteKit API key. Sign up at\n[app.bytekit.com](https://app.bytekit.com) and create a key (prefixed\n`sk_live_`). The local server reads it from the `BYTEKIT_API_KEY` environment\nvariable (or the `--api-key` flag); the hosted endpoint takes it as a bearer\ntoken.\n\n## Option 1 — Hosted HTTP (no install)\n\nPoint any MCP client that speaks the Streamable HTTP transport at:\n\n```\nhttps://api.bytekit.com/mcp\n```\n\nSend your API key as a bearer token. Example client config for a host that\nspeaks Streamable HTTP directly (Cursor and most hosts accept this shape):\n\n```json\n{\n \"mcpServers\": {\n \"bytekit\": {\n \"url\": \"https://api.bytekit.com/mcp\",\n \"headers\": {\n \"Authorization\": \"Bearer sk_live_xxx\"\n }\n }\n }\n}\n```\n\n**Paste your real key in place of `sk_live_xxx`.** A JSON config file is not a\nshell: most hosts read these values verbatim and do not substitute environment\nvariables inside `headers`, so writing `Bearer $BYTEKIT_API_KEY` here sends that\ntext to the API as the token, verbatim, and the API answers `401`.\n\n**Claude Desktop does not accept this shape.** `claude_desktop_config.json`\nonly launches local **stdio** subprocesses (`command`/`args`/`env`) — it has\nno native `url`-based remote-server entry, so pasting the config above into\nit will not connect. To reach the hosted endpoint from Claude Desktop, either:\n\n- add ByteKit as a [Connector](https://claude.com/connectors) (Settings →\n Connectors → Add custom connector), or\n- bridge it locally with [`mcp-remote`](https://www.npmjs.com/package/mcp-remote):\n\n```json\n{\n \"mcpServers\": {\n \"bytekit\": {\n \"command\": \"npx\",\n \"args\": [\n \"-y\",\n \"mcp-remote\",\n \"https://api.bytekit.com/mcp\",\n \"--header\",\n \"Authorization:${AUTH_HEADER}\"\n ],\n \"env\": {\n \"AUTH_HEADER\": \"Bearer sk_live_xxx\"\n }\n }\n }\n}\n```\n\nTwo details in that snippet are load-bearing, and both are documented by\n`mcp-remote` itself:\n\n- **`${AUTH_HEADER}`, not `$AUTH_HEADER`.** Claude Desktop launches\n `command`/`args` directly, with no shell in between, so it does not expand\n `$VAR` anywhere in the config. `mcp-remote` does its own substitution on\n `--header` values, but only of the braced `${VAR}` form, reading it from the\n process environment the `env` block supplies. A bare `$BYTEKIT_API_KEY` is\n passed through untouched and authenticates as that literal string — a\n guaranteed `401`.\n- **No space after the colon in `Authorization:${AUTH_HEADER}`.** The header\n value carries the space (`Bearer sk_live_xxx`) instead. `mcp-remote`'s README\n documents this as the workaround for a Cursor / Claude Desktop (Windows) bug\n where spaces inside `args` are not escaped when it invokes `npx`, mangling the\n value: `\"Authorization:${AUTH_HEADER}\" // note no spaces around ':'` with\n `\"AUTH_HEADER\": \"Bearer <auth-token>\" // spaces OK in env vars`.\n\nOr skip the hosted endpoint entirely and run the **local stdio server**\n(Option 2 below), which Claude Desktop supports natively.\n\n## Option 2 — Local stdio (`npx`)\n\nRun the server as a local subprocess over stdio. Nothing to install globally —\n`npx` fetches it on demand:\n\n```bash\nnpx @hunt-labs/bytekit-mcp --api-key $BYTEKIT_API_KEY\n```\n\nOr set the key in your environment and omit the flag:\n\n```bash\nexport BYTEKIT_API_KEY=sk_live_xxx\nnpx @hunt-labs/bytekit-mcp\n```\n\nClient config for a stdio server:\n\n```json\n{\n \"mcpServers\": {\n \"bytekit\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@hunt-labs/bytekit-mcp\"],\n \"env\": {\n \"BYTEKIT_API_KEY\": \"sk_live_xxx\"\n }\n }\n }\n}\n```\n\n### API-key resolution order\n\nThe local server resolves the key in this order:\n\n1. `--api-key <key>` flag\n2. `BYTEKIT_API_KEY` environment variable\n\n## Tool inventory\n\n| Tool | What it does |\n| --- | --- |\n| `scrape_url` | Fetch a URL and return HTML, clean markdown, links, or images. |\n| `web_search` | Run a web search and return ranked organic results. |\n| `screenshot_url` | Capture a screenshot of a page (desktop/mobile, PNG/JPEG). |\n| `get_result` | Fetch a previously created screenshot by id. |\n| `get_account` | Return account details, plan, and current usage/quota. |\n| `list_docs` | List every page in the bundled ByteKit documentation. |\n| `search_docs` | Search the bundled documentation. |\n| `get_doc` | Fetch the full markdown of one documentation page. |\n\nThe server also exposes **resources** (`bytekit://account`,\n`bytekit://screenshot/{id}`) and **prompts** (`summarize_webpage`,\n`extract_structured_data`, `research_topic`) that MCP hosts can surface directly.\n\n## Limits\n\nThe hosted `POST /mcp` endpoint caps request bodies at **1 MB**. MCP tool\narguments are small (a URL plus a few options), so this comfortably covers\nevery tool and prompt in the matrix above — including `research_topic`, the\nlargest legitimate call, which carries a list of URLs. An oversized request\ngets a `413` with a JSON-RPC-shaped error body rather than a dropped\nconnection.\n\nEvery route in the table below carries its own body-size limit, sized to\nthat route's shape rather than reused from `/mcp` (a bulk endpoint's\nrealistic payload is far larger than an MCP tool call)
|
|
400
|
+
"body": "# MCP Server\n\nCall ByteKit web capture as a native tool from Claude, Cursor, and any MCP-compatible agent — hosted over HTTP or run locally over stdio.\n\nThe ByteKit **MCP server** exposes scraping, search, screenshots, and account\nlookups as [Model Context Protocol](https://modelcontextprotocol.io) tools. Your\nagent calls `scrape_url` or `screenshot_url` the same way it calls any other\ntool — no wrapper to write, no headless browser to manage.\n\nThere are two ways to connect: a **hosted HTTP endpoint** (nothing to install)\nand a **local stdio server** (`npx @hunt-labs/bytekit-mcp`).\n\n## Authentication\n\nBoth paths authenticate with a ByteKit API key. Sign up at\n[app.bytekit.com](https://app.bytekit.com) and create a key (prefixed\n`sk_live_`). The local server reads it from the `BYTEKIT_API_KEY` environment\nvariable (or the `--api-key` flag); the hosted endpoint takes it as a bearer\ntoken.\n\n## Option 1 — Hosted HTTP (no install)\n\nPoint any MCP client that speaks the Streamable HTTP transport at:\n\n```\nhttps://api.bytekit.com/mcp\n```\n\nSend your API key as a bearer token. Example client config for a host that\nspeaks Streamable HTTP directly (Cursor and most hosts accept this shape):\n\n```json\n{\n \"mcpServers\": {\n \"bytekit\": {\n \"url\": \"https://api.bytekit.com/mcp\",\n \"headers\": {\n \"Authorization\": \"Bearer sk_live_xxx\"\n }\n }\n }\n}\n```\n\n**Paste your real key in place of `sk_live_xxx`.** A JSON config file is not a\nshell: most hosts read these values verbatim and do not substitute environment\nvariables inside `headers`, so writing `Bearer $BYTEKIT_API_KEY` here sends that\ntext to the API as the token, verbatim, and the API answers `401`.\n\n**Claude Desktop does not accept this shape.** `claude_desktop_config.json`\nonly launches local **stdio** subprocesses (`command`/`args`/`env`) — it has\nno native `url`-based remote-server entry, so pasting the config above into\nit will not connect. To reach the hosted endpoint from Claude Desktop, either:\n\n- add ByteKit as a [Connector](https://claude.com/connectors) (Settings →\n Connectors → Add custom connector), or\n- bridge it locally with [`mcp-remote`](https://www.npmjs.com/package/mcp-remote):\n\n```json\n{\n \"mcpServers\": {\n \"bytekit\": {\n \"command\": \"npx\",\n \"args\": [\n \"-y\",\n \"mcp-remote\",\n \"https://api.bytekit.com/mcp\",\n \"--header\",\n \"Authorization:${AUTH_HEADER}\"\n ],\n \"env\": {\n \"AUTH_HEADER\": \"Bearer sk_live_xxx\"\n }\n }\n }\n}\n```\n\nTwo details in that snippet are load-bearing, and both are documented by\n`mcp-remote` itself:\n\n- **`${AUTH_HEADER}`, not `$AUTH_HEADER`.** Claude Desktop launches\n `command`/`args` directly, with no shell in between, so it does not expand\n `$VAR` anywhere in the config. `mcp-remote` does its own substitution on\n `--header` values, but only of the braced `${VAR}` form, reading it from the\n process environment the `env` block supplies. A bare `$BYTEKIT_API_KEY` is\n passed through untouched and authenticates as that literal string — a\n guaranteed `401`.\n- **No space after the colon in `Authorization:${AUTH_HEADER}`.** The header\n value carries the space (`Bearer sk_live_xxx`) instead. `mcp-remote`'s README\n documents this as the workaround for a Cursor / Claude Desktop (Windows) bug\n where spaces inside `args` are not escaped when it invokes `npx`, mangling the\n value: `\"Authorization:${AUTH_HEADER}\" // note no spaces around ':'` with\n `\"AUTH_HEADER\": \"Bearer <auth-token>\" // spaces OK in env vars`.\n\nOr skip the hosted endpoint entirely and run the **local stdio server**\n(Option 2 below), which Claude Desktop supports natively.\n\n## Option 2 — Local stdio (`npx`)\n\nRun the server as a local subprocess over stdio. Nothing to install globally —\n`npx` fetches it on demand:\n\n```bash\nnpx @hunt-labs/bytekit-mcp --api-key $BYTEKIT_API_KEY\n```\n\nOr set the key in your environment and omit the flag:\n\n```bash\nexport BYTEKIT_API_KEY=sk_live_xxx\nnpx @hunt-labs/bytekit-mcp\n```\n\nClient config for a stdio server:\n\n```json\n{\n \"mcpServers\": {\n \"bytekit\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@hunt-labs/bytekit-mcp\"],\n \"env\": {\n \"BYTEKIT_API_KEY\": \"sk_live_xxx\"\n }\n }\n }\n}\n```\n\n### API-key resolution order\n\nThe local server resolves the key in this order:\n\n1. `--api-key <key>` flag\n2. `BYTEKIT_API_KEY` environment variable\n\n## Tool inventory\n\n| Tool | What it does |\n| --- | --- |\n| `scrape_url` | Fetch a URL and return HTML, clean markdown, links, or images. |\n| `web_search` | Run a web search and return ranked organic results. |\n| `screenshot_url` | Capture a screenshot of a page (desktop/mobile, PNG/JPEG). |\n| `get_result` | Fetch a previously created screenshot by id. |\n| `get_account` | Return account details, plan, and current usage/quota. |\n| `list_docs` | List every page in the bundled ByteKit documentation. |\n| `search_docs` | Search the bundled documentation. |\n| `get_doc` | Fetch the full markdown of one documentation page. |\n\nThe server also exposes **resources** (`bytekit://account`,\n`bytekit://screenshot/{id}`) and **prompts** (`summarize_webpage`,\n`extract_structured_data`, `research_topic`) that MCP hosts can surface directly.\n\n## Limits\n\nThe hosted `POST /mcp` endpoint caps request bodies at **1 MB**. MCP tool\narguments are small (a URL plus a few options), so this comfortably covers\nevery tool and prompt in the matrix above — including `research_topic`, the\nlargest legitimate call, which carries a list of URLs. An oversized request\ngets a `413` with a JSON-RPC-shaped error body rather than a dropped\nconnection.\n\nEvery route in the table below carries its own body-size limit, sized to\nthat route's shape rather than reused from `/mcp` (a bulk endpoint's\nrealistic payload is far larger than an MCP tool call):\n\n| Endpoint | Limit | Error |\n|---|---|---|\n| `POST /v1/scrape`, `/v1/search`, `/v1/scrape/bulk`, `/v1/schema` | 512 KB | `400 request_too_large` |\n| `POST /v1/fetch` | 512 KB | `400 request_too_large` |\n| `POST /v1/screenshots` | 512 KB | `400 request_too_large` |\n| `POST /v1/monitors` | 512 KB | `400 request_too_large` |\n| `POST /v1/sitemap` | 512 KB | `400 request_too_large` |\n| `POST /v1/bulk` | 4 MB pre-auth (chunked) / 32 MB fail-safe (declared length) / per-plan up to 28.7 MB | `400 request_too_large` |\n| `POST /v1/fetch/bulk` | 2 MB pre-auth (chunked) / 20 MB fail-safe (declared length) / per-plan up to 16.8 MB | `400 request_too_large` |\n| `POST /v1/webhook-deliveries/{id}/retry` | 64 KB | `400 request_too_large` |\n| `POST /mcp` | 1 MB | `413` (JSON-RPC error) |\n\nThe two bulk endpoints are guarded in a two-tier shape, not by a single\nceiling. A streamed body with no `Content-Length` header is capped at the\nsmall pre-auth limit (4 MB / 2 MB) before your API key is checked; a body\nthat declares `Content-Length` is instead bounded there by a larger fail-safe\n(32 MB / 20 MB) rather than the real limit, since that branch reads nothing\nuntil your key is verified. Once your key is verified, a second check\nre-gates the body against your account's own `max_bulk_size`, the number of\nURLs or per-item configs your plan allows in one call. A custom plan with a\n`max_bulk_size` of 50,000 reaches 28.7 MB / 16.8 MB at that second check. A\nstandard-plan account's effective ceiling is exactly the pre-auth limit;\neither tier's overrun returns `400 request_too_large`.\n\n## Next steps\n\n- [Quickstart](https://bytekit.com/docs/quickstart) — make your first ByteKit API call.\n- [Authentication](https://bytekit.com/docs/guides/authentication) — key formats and management."
|
|
401
401
|
},
|
|
402
402
|
"quickstart": {
|
|
403
403
|
"title": "Quickstart",
|
|
404
404
|
"section": "General",
|
|
405
|
-
"body": "# Quickstart\n\nMake your first ByteKit API call in under 5 minutes — no SDK required.\n\nNothing to install. You only need `curl` and an API key.\n\n## Get an API key\n\nSign up at [app.bytekit.com](https://app.bytekit.com) and create an API key from the\ndashboard. Keys are prefixed `sk_live_`.\n\nSee [Authentication](https://bytekit.com/docs/guides/authentication) for details on key formats and management.\n\n## Make your first scrape\n\nSet your API key and run this — no file to save, no `chmod`:\n\n```bash\ncurl -X POST https://api.bytekit.com/v1/scrape \\\n -H \"Authorization: Bearer $BYTEKIT_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"url\":\"https://example.com\"}'\n```\n\nWant a full-featured script with error handling and `jq` formatting? Use this instead:\n\n
|
|
405
|
+
"body": "# Quickstart\n\nMake your first ByteKit API call in under 5 minutes — no SDK required.\n\nNothing to install. You only need `curl` and an API key.\n\n## Get an API key\n\nSign up at [app.bytekit.com](https://app.bytekit.com) and create an API key from the\ndashboard. Keys are prefixed `sk_live_`.\n\nSee [Authentication](https://bytekit.com/docs/guides/authentication) for details on key formats and management.\n\n## Make your first scrape\n\nSet your API key and run this — no file to save, no `chmod`:\n\n```bash\ncurl -X POST https://api.bytekit.com/v1/scrape \\\n -H \"Authorization: Bearer $BYTEKIT_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"url\":\"https://example.com\"}'\n```\n\nWant a full-featured script with error handling and `jq` formatting? Use this instead:\n\n```bash\n#!/usr/bin/env bash\n# POST /v1/scrape — scrape a URL and return its content as markdown.\n# Usage: BYTEKIT_API_KEY=sk_... bash examples/curl/scrape.sh\n\nset -euo pipefail\n\n: \"${BYTEKIT_API_KEY:?BYTEKIT_API_KEY is required}\"\nBASE_URL=\"${BYTEKIT_BASE_URL:-https://api.bytekit.com}\"\n\ncurl -sf -X POST \"$BASE_URL/v1/scrape\" \\\n -H \"Authorization: Bearer $BYTEKIT_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"url\": \"https://example.com\", \"formats\": [\"markdown\"]}' \\\n | jq .\n```\n\nA successful response looks like this — every envelope field is `snake_case`:\n\n```json\n{\n \"schema_version\": 1,\n \"status\": \"success\",\n \"id\": \"sc_84c14b1058184045b97ae360ad74888b\",\n \"url\": \"https://example.com\",\n \"final_url\": \"https://example.com\",\n \"content_type\": \"text/html\",\n \"content_length\": 318,\n \"status_code\": 200,\n \"retrieved_at\": \"2026-08-27T12:16:01.872Z\",\n \"formats\": {\n \"raw\": \"<!doctype html><html lang=\\\"en\\\"><head><title>Example Domain</title>…</html>\\n\"\n },\n \"metadata\": {\n \"title\": \"Example Domain\",\n \"description\": null,\n \"language\": \"en\",\n \"canonicalUrl\": null,\n \"ogTitle\": null,\n \"ogDescription\": null,\n \"ogImage\": null,\n \"ogUrl\": null,\n \"ogSiteName\": null,\n \"robots\": null,\n \"byline\": null,\n \"publishedAt\": null\n },\n \"cache\": \"miss\",\n \"billing\": {\n \"raw_bytes\": 318,\n \"factors\": [{ \"name\": \"endpoint\", \"value\": 1, \"reason\": \"scrape\" }],\n \"multiplier\": 1,\n \"billed_bytes\": 318\n }\n}\n```\n\n`content_length` is the compressed wire size in bytes (used for bandwidth billing), and\n`billing` breaks down what the request actually cost. `cache` is `\"miss\"` or `\"hit\"`, and a\nhit adds a `cache_age_s` field. The `id` field uses the `sc_` prefix — you can poll\n`GET /v1/scrape/{id}` if the scrape was queued asynchronously.\n\nThe keys inside `metadata` stay `camelCase` (`canonicalUrl`, `ogTitle`, …): they are the\npage's own metadata, not envelope fields.\n\n## Ask for markdown\n\nThe default format is `raw` — that is why the response above carries no\n`formats.markdown`. Request markdown explicitly:\n\n```bash\ncurl -X POST https://api.bytekit.com/v1/scrape \\\n -H \"Authorization: Bearer $BYTEKIT_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"url\":\"https://example.com\",\"formats\":[\"markdown\"]}'\n```\n\nMarkdown output is billed at **1.5×** the request's upstream wire bytes — the `endpoint`\nfactor in the `billing` node below is the rate your balance is charged, not a display\nweighting. See [Bandwidth billing](https://bytekit.com/docs/billing/bandwidth) for how the factors compose.\n\nThe response's `formats` object is keyed by what you asked for:\n\n```json\n{\n \"schema_version\": 1,\n \"status\": \"success\",\n \"id\": \"sc_f659fa67dfb244159767132c2aa50917\",\n \"url\": \"https://example.com\",\n \"final_url\": \"https://example.com\",\n \"content_type\": \"text/html\",\n \"content_length\": 318,\n \"status_code\": 200,\n \"retrieved_at\": \"2026-08-27T12:16:11.337Z\",\n \"formats\": {\n \"markdown\": \"---\\ntitle: \\\"Example Domain\\\"\\nurl: \\\"https://example.com\\\"\\ncaptured_at: \\\"2026-08-27T12:16:11.416Z\\\"\\n---\\nThis domain is for use in documentation examples without needing permission. Avoid use in operations.\\n\\n[Learn more](https://iana.org/domains/example)\"\n },\n \"metadata\": {\n \"title\": \"Example Domain\",\n \"description\": null,\n \"language\": \"en\",\n \"canonicalUrl\": null,\n \"ogTitle\": null,\n \"ogDescription\": null,\n \"ogImage\": null,\n \"ogUrl\": null,\n \"ogSiteName\": null,\n \"robots\": null,\n \"byline\": null,\n \"publishedAt\": null\n },\n \"cache\": \"hit\",\n \"cache_age_s\": 8,\n \"billing\": {\n \"raw_bytes\": 318,\n \"factors\": [\n { \"name\": \"endpoint\", \"value\": 1.5, \"reason\": \"scrape_md\" },\n { \"name\": \"cache_hit\", \"value\": 0.5, \"reason\": \"hit, age 8s\" }\n ],\n \"multiplier\": 0.75,\n \"billed_bytes\": 239\n }\n}\n```\n\nSee [Scraping](https://bytekit.com/docs/guides/scraping) for the other formats (`markdown`, `links`, `images`).\n\n## Prefer an SDK?\n\nSkip the raw HTTP and use an official client:\n\n- [TypeScript SDK](https://bytekit.com/docs/libraries/typescript) — `npm install @hunt-labs/bytekit-sdk`\n- [Python SDK](https://bytekit.com/docs/libraries/python) — `pip install bytekit-sdk`\n\n## Next steps\n\n- [Authentication](https://bytekit.com/docs/guides/authentication) — key formats, Bearer header, self-serve key management\n- [Scraping](https://bytekit.com/docs/guides/scraping) — formats, options, latency, and async polling\n- [Errors](https://bytekit.com/docs/guides/errors) — error shape, common codes, retry guidance\n- [Rate Limits](https://bytekit.com/docs/guides/rate-limits) — quota model, concurrency slots, rate limit headers\n- [Monitors](https://bytekit.com/docs/guides/monitors) — page-change detection (screenshot or scrape) with webhook notifications\n- [API Reference](https://bytekit.com/docs/api) — full endpoint documentation"
|
|
406
406
|
},
|
|
407
407
|
"sdk": {
|
|
408
408
|
"title": "SDK Reference",
|
|
@@ -477,7 +477,7 @@
|
|
|
477
477
|
"sdk/typescript/account": {
|
|
478
478
|
"title": "Account",
|
|
479
479
|
"section": "SDK Reference",
|
|
480
|
-
"body": "# Account\n\nAccount info and API key management. Accessed via `client.account`.\n\n## get\n\n```ts\nclient.account.get(requestOptions?: RequestOptions): Promise<GetAccountResponse>\n```\n\nGET /v1/account — get the authenticated account.\n\n`requestOptions` carries the CLIENT-side abort budget (`requestTimeoutMs`) and an\noptional caller `signal`; both override the constructor's `timeoutMs` default.\n\n## apiKeys\n\n### create\n\n```ts\nclient.account.apiKeys.create(opts?: CreateApiKeyRequest, requestOptions?: RequestOptions): Promise<CreateApiKeyResponse>\n```\n\nPOST /v1/account/api-keys — create a new API key.\n\n`opts` is optional: the spec declares the request body itself as optional,\nso `create()` with no arguments is valid and sends no body.\n\n### list\n\n```ts\nclient.account.apiKeys.list(requestOptions?: RequestOptions): Promise<ListApiKeysResponse>\n```\n\nGET /v1/account/api-keys — list all API keys for the account\n\n### get\n\n```ts\nclient.account.apiKeys.get(id: ApiKeyId, requestOptions?: RequestOptions): Promise<GetApiKeyResponse>\n```\n\nGET /v1/account/api-keys/\\{id\\} — get an API key by ID\n\n### update\n\n```ts\nclient.account.apiKeys.update(id: ApiKeyId, opts: UpdateApiKeyRequest, requestOptions?: RequestOptions): Promise<UpdateApiKeyResponse>\n```\n\nPATCH /v1/account/api-keys/\\{id\\} — update an API key\n\n### revoke\n\n```ts\nclient.account.apiKeys.revoke(id: ApiKeyId, requestOptions?: RequestOptions): Promise<void>\n```\n\nDELETE /v1/account/api-keys/\\{id\\} — revoke an API key (idempotent).\n\nReturns 204 No Content: `operations['revokeApiKey']['responses'][204]`\ndeclares `content?: never`, so there is no JSON arm to derive a payload\nfrom — hence `Promise<void>`.\n\n`client.request()` short-circuits an empty body (204 or any empty response)\nto `undefined` before it would parse the body as JSON
|
|
480
|
+
"body": "# Account\n\nAccount info and API key management. Accessed via `client.account`.\n\n## get\n\n```ts\nclient.account.get(requestOptions?: RequestOptions): Promise<GetAccountResponse>\n```\n\nGET /v1/account — get the authenticated account.\n\n`requestOptions` carries the CLIENT-side abort budget (`requestTimeoutMs`) and an\noptional caller `signal`; both override the constructor's `timeoutMs` default.\n\n## apiKeys\n\n### create\n\n```ts\nclient.account.apiKeys.create(opts?: CreateApiKeyRequest, requestOptions?: RequestOptions): Promise<CreateApiKeyResponse>\n```\n\nPOST /v1/account/api-keys — create a new API key.\n\n`opts` is optional: the spec declares the request body itself as optional,\nso `create()` with no arguments is valid and sends no body.\n\n### list\n\n```ts\nclient.account.apiKeys.list(requestOptions?: RequestOptions): Promise<ListApiKeysResponse>\n```\n\nGET /v1/account/api-keys — list all API keys for the account\n\n### get\n\n```ts\nclient.account.apiKeys.get(id: ApiKeyId, requestOptions?: RequestOptions): Promise<GetApiKeyResponse>\n```\n\nGET /v1/account/api-keys/\\{id\\} — get an API key by ID\n\n### update\n\n```ts\nclient.account.apiKeys.update(id: ApiKeyId, opts: UpdateApiKeyRequest, requestOptions?: RequestOptions): Promise<UpdateApiKeyResponse>\n```\n\nPATCH /v1/account/api-keys/\\{id\\} — update an API key\n\n### revoke\n\n```ts\nclient.account.apiKeys.revoke(id: ApiKeyId, requestOptions?: RequestOptions): Promise<void>\n```\n\nDELETE /v1/account/api-keys/\\{id\\} — revoke an API key (idempotent).\n\nReturns 204 No Content: `operations['revokeApiKey']['responses'][204]`\ndeclares `content?: never`, so there is no JSON arm to derive a payload\nfrom — hence `Promise<void>`.\n\n`client.request()` short-circuits an empty body (204 or any empty response)\nto `undefined` before it would parse the body as JSON, so this\nmethod resolves cleanly on an empty 204 body.\n\n### reveal\n\n```ts\nclient.account.apiKeys.reveal(id: ApiKeyId, requestOptions?: RequestOptions): Promise<RevealApiKeyResponse>\n```\n\nPOST /v1/account/api-keys/\\{id\\}/reveal — reveal the plaintext API key value"
|
|
481
481
|
},
|
|
482
482
|
"sdk/typescript/bulk": {
|
|
483
483
|
"title": "Bulk",
|
|
@@ -487,12 +487,12 @@
|
|
|
487
487
|
"sdk/typescript/client": {
|
|
488
488
|
"title": "Client",
|
|
489
489
|
"section": "SDK Reference",
|
|
490
|
-
"body": "# Client\n\nThe ByteKit TypeScript SDK is a thin, type-safe wrapper over the REST API. Create a\n client with your API key, then call resource methods.\n\n```ts\nimport { ByteKit } from '@hunt-labs/bytekit-sdk';\n\nconst client = new ByteKit({\n apiKey: process.env.BYTEKIT_API_KEY!, // your sk_live_… key\n});\n```\n\n## Options (`ByteKitOptions`)\n\n- `apiKey` (required) — `string`\n- `baseUrl` — `string` Defaults to `https://api.bytekit.com`.\n- `timeoutMs` — `number` — Default CLIENT-SIDE request timeout in ms — the abort budget for the whole HTTP\nround-trip made by this SDK, covering time-to-headers **and** the response body\nread (so a large legitimate body counts against it too). `0` disables the SDK-side\ntimeout. Default 120000.\n\nNOT the same thing as `ScrapeOpts.timeout_ms`, which is the SERVER-side budget
|
|
490
|
+
"body": "# Client\n\nThe ByteKit TypeScript SDK is a thin, type-safe wrapper over the REST API. Create a\n client with your API key, then call resource methods.\n\n```ts\nimport { ByteKit } from '@hunt-labs/bytekit-sdk';\n\nconst client = new ByteKit({\n apiKey: process.env.BYTEKIT_API_KEY!, // your sk_live_… key\n});\n```\n\n## Options (`ByteKitOptions`)\n\n- `apiKey` (required) — `string`\n- `baseUrl` — `string` Defaults to `https://api.bytekit.com`.\n- `timeoutMs` — `number` — Default CLIENT-SIDE request timeout in ms — the abort budget for the whole HTTP\nround-trip made by this SDK, covering time-to-headers **and** the response body\nread (so a large legitimate body counts against it too). `0` disables the SDK-side\ntimeout. Default 120000.\n\nNOT the same thing as `ScrapeOpts.timeout_ms`, which is the SERVER-side budget\nByteKit applies to the scrape itself. Override per call with\n`RequestOptions.requestTimeoutMs`.\n\n## Resources\n\nThe client exposes one property per resource:\n\n- [`client.scrape`](https://bytekit.com/docs/sdk/typescript/scrape) — Fetch a URL as raw HTML, clean markdown, or structured content.\n- [`client.screenshots`](https://bytekit.com/docs/sdk/typescript/screenshots) — Capture full-page or viewport screenshots.\n- [`client.bulk`](https://bytekit.com/docs/sdk/typescript/bulk) — Fan out many URLs in parallel with per-item webhooks.\n- [`client.fetch`](https://bytekit.com/docs/sdk/typescript/fetch) — Low-latency raw HTTP fetch with byte-for-byte upstream responses.\n- [`client.monitors`](https://bytekit.com/docs/sdk/typescript/monitors) — Watch a URL on a schedule and webhook on change.\n- [`client.sitemap`](https://bytekit.com/docs/sdk/typescript/sitemap) — Discover URLs from a domain's sitemap or by crawling.\n- [`client.search`](https://bytekit.com/docs/sdk/typescript/search) — Run a web search and return ranked organic results.\n- [`client.account`](https://bytekit.com/docs/sdk/typescript/account) — Account info and API key management.\n- [`client.usage`](https://bytekit.com/docs/sdk/typescript/usage) — Billing-period and daily usage breakdowns.\n- [`client.webhooks`](https://bytekit.com/docs/sdk/typescript/webhooks) — List and retry webhook deliveries.\n\n## Errors\n\nAny non-2xx response throws a `ByteKitError` carrying the HTTP `status` and the API `code`.\n\n```ts\nimport { ByteKit, ByteKitError } from '@hunt-labs/bytekit-sdk';\n\ntry {\n await client.scrape.create({ url: 'https://example.com' });\n} catch (err) {\n if (err instanceof ByteKitError) {\n console.error(`${err.status} ${err.code}: ${err.message}`);\n }\n}\n```"
|
|
491
491
|
},
|
|
492
492
|
"sdk/typescript/fetch": {
|
|
493
493
|
"title": "Fetch",
|
|
494
494
|
"section": "SDK Reference",
|
|
495
|
-
"body": "# Fetch\n\nLow-latency raw HTTP fetch with byte-for-byte upstream responses. Accessed via `client.fetch`.\n\n## create\n\n```ts\nclient.fetch.create(opts: FetchOpts, requestOptions?: RequestOptions): Promise<FetchResult>\n```\n\nPOST /v1/fetch — fetch URL content via POST body.\n\nResolves a `FetchResult` — the raw content body plus `X-Fetch-*` metadata.\nThe body is returned verbatim — a JSON-serving upstream comes back as the\nraw JSON string, not a parsed object.\n\n`requestOptions` carries the CLIENT-side abort budget (`requestTimeoutMs`) and an\noptional caller `signal`. It matters most here:
|
|
495
|
+
"body": "# Fetch\n\nLow-latency raw HTTP fetch with byte-for-byte upstream responses. Accessed via `client.fetch`.\n\n## create\n\n```ts\nclient.fetch.create(opts: FetchOpts, requestOptions?: RequestOptions): Promise<FetchResult>\n```\n\nPOST /v1/fetch — fetch URL content via POST body.\n\nResolves a `FetchResult` — the raw content body plus `X-Fetch-*` metadata.\nThe body is returned verbatim — a JSON-serving upstream comes back as the\nraw JSON string, not a parsed object.\n\n`requestOptions` carries the CLIENT-side abort budget (`requestTimeoutMs`) and an\noptional caller `signal`. It matters most here: ByteKit's own ceiling for a\nfetch is 60 s, so without a per-call budget a slow upstream holds the caller for\nthe constructor default (2 minutes) rather than a duration the caller chose.\n\n## get\n\n```ts\nclient.fetch.get(opts: FetchGetOpts, requestOptions?: RequestOptions): Promise<FetchResult>\n```\n\nGET /v1/fetch — fetch URL content via query params.\n\nResolves a `FetchResult` — the raw content body plus `X-Fetch-*` metadata.\n\nAccepts only the four params the spec declares for this endpoint. `custom`\nis a POST-body option with no GET query param; use `create()` for custom metadata.\n\nThe query string is built by iterating `FETCH_GET_QUERY_KEYS`, the same list\n`FetchGetOpts` is derived from, so every accepted option is necessarily\nserialized.\n\n`requestOptions` carries the CLIENT-side abort budget (`requestTimeoutMs`) and an\noptional caller `signal`. As on `create`, ByteKit's own ceiling for a fetch is\n60 s, so a per-call budget is what keeps a slow upstream from holding the caller\nfor the constructor default.\n\n## Options (`FetchOpts`)\n\n- `url` (required) — `string`\n- `country` — `string`\n- `timeout_ms` — `number`\n- `cache_ttl` — `string | 0` — How long a freshly fetched URL may be served from cache. Matches the\nOpenAPI `FetchRequest.cache_ttl` schema: a duration string (`\"48h\"`,\n`\"2d\"`, up to `168h` / `7d`) or the integer `0` to disable caching.\nDefaults to `\"48h\"` server-side when omitted.\n- `custom` — `Record<string, unknown>` — User-supplied JSON payload, base64-encoded into the `X-Fetch-Custom`\nresponse header so callers can correlate the response to caller-side\nstate. Capped at 4096 UTF-8 bytes after JSON serialization. Does NOT\naffect cache-key inputs."
|
|
496
496
|
},
|
|
497
497
|
"sdk/typescript/fetch-bulk": {
|
|
498
498
|
"title": "Fetch Bulk",
|
|
@@ -502,12 +502,12 @@
|
|
|
502
502
|
"sdk/typescript/monitors": {
|
|
503
503
|
"title": "Monitors",
|
|
504
504
|
"section": "SDK Reference",
|
|
505
|
-
"body": "# Monitors\n\nWatch a URL on a schedule and webhook on change. Accessed via `client.monitors`.\n\n## create\n\n```ts\nclient.monitors.create(opts: MonitorCreateRequest, requestOptions?: RequestOptions): Promise<MonitorCreateResponse>\n```\n\nPOST /v1/monitors — create a page-change monitor (screenshot or scrape capture).\nFirst-capture behavior is the same for both types: the first capture is a silent baseline (has_change=false, change_pct=null) with no change_detected webhook, whether the monitor is `scrape` or `screenshot`. From the second capture onward both types diff against the previous capture.\n\n## list\n\n```ts\nclient.monitors.list(params?: ListMonitorsParams, requestOptions?: RequestOptions): Promise<ListMonitorsResponse>\n```\n\nGET /v1/monitors — list monitors for the account.\n\n`params` is optional and each key is omitted-when-absent, so `list()` with no argument\nserializes the bare `/v1/monitors` URL unchanged — existing zero-arg callers are unaffected.\n\n## get\n\n```ts\nclient.monitors.get(id: MonitorId, requestOptions?: RequestOptions): Promise<MonitorResponse>\n```\n\nGET /v1/monitors/\\{id\\} — get a monitor by ID\n\n## update\n\n```ts\nclient.monitors.update(id: MonitorId, opts: MonitorUpdateRequest, requestOptions?: RequestOptions): Promise<UpdateMonitorResponse>\n```\n\nPATCH /v1/monitors/\\{id\\} — update a monitor\n\n## delete\n\n```ts\nclient.monitors.delete(id: MonitorId, requestOptions?: RequestOptions): Promise<void>\n```\n\nDELETE /v1/monitors/\\{id\\} — delete a monitor.\n\nReturns 204 No Content (`operations['deleteMonitor']['responses'][204]`\ndeclares `content?: never`), so there is no JSON arm to derive a payload\nfrom — hence `Promise<void>`. `client.request()` short-circuits the empty\nbody to `undefined` before it would parse as JSON
|
|
505
|
+
"body": "# Monitors\n\nWatch a URL on a schedule and webhook on change. Accessed via `client.monitors`.\n\n## create\n\n```ts\nclient.monitors.create(opts: MonitorCreateRequest, requestOptions?: RequestOptions): Promise<MonitorCreateResponse>\n```\n\nPOST /v1/monitors — create a page-change monitor (screenshot or scrape capture).\nFirst-capture behavior is the same for both types: the first capture is a silent baseline (has_change=false, change_pct=null) with no change_detected webhook, whether the monitor is `scrape` or `screenshot`. From the second capture onward both types diff against the previous capture.\n\n## list\n\n```ts\nclient.monitors.list(params?: ListMonitorsParams, requestOptions?: RequestOptions): Promise<ListMonitorsResponse>\n```\n\nGET /v1/monitors — list monitors for the account.\n\n`params` is optional and each key is omitted-when-absent, so `list()` with no argument\nserializes the bare `/v1/monitors` URL unchanged — existing zero-arg callers are unaffected.\n\n## get\n\n```ts\nclient.monitors.get(id: MonitorId, requestOptions?: RequestOptions): Promise<MonitorResponse>\n```\n\nGET /v1/monitors/\\{id\\} — get a monitor by ID\n\n## update\n\n```ts\nclient.monitors.update(id: MonitorId, opts: MonitorUpdateRequest, requestOptions?: RequestOptions): Promise<UpdateMonitorResponse>\n```\n\nPATCH /v1/monitors/\\{id\\} — update a monitor\n\n## delete\n\n```ts\nclient.monitors.delete(id: MonitorId, requestOptions?: RequestOptions): Promise<void>\n```\n\nDELETE /v1/monitors/\\{id\\} — delete a monitor.\n\nReturns 204 No Content (`operations['deleteMonitor']['responses'][204]`\ndeclares `content?: never`), so there is no JSON arm to derive a payload\nfrom — hence `Promise<void>`. `client.request()` short-circuits the empty\nbody to `undefined` before it would parse as JSON.\n\n## captures\n\n### list\n\n```ts\nclient.monitors.captures.list(id: MonitorId, params?: ListMonitorCapturesParams, requestOptions?: RequestOptions): Promise<ListMonitorCapturesResponse>\n```\n\nGET /v1/monitors/\\{id\\}/captures — list captures for a monitor.\n\n`params` is optional and each key is omitted-when-absent, so `list(id)` with no\nsecond argument serializes the bare `/v1/monitors/\\{id\\}/captures` URL unchanged — existing\nzero-arg callers are unaffected (inverse case)."
|
|
506
506
|
},
|
|
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` 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
|
|
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. `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 server 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",
|
|
@@ -517,7 +517,7 @@
|
|
|
517
517
|
"sdk/typescript/screenshots": {
|
|
518
518
|
"title": "Screenshots",
|
|
519
519
|
"section": "SDK Reference",
|
|
520
|
-
"body": "# Screenshots\n\nCapture full-page or viewport screenshots. Accessed via `client.screenshots`.\n\n## create\n\n```ts\nclient.screenshots.create(opts: ScreenshotCreateRequest, params?: { async?: boolean }, requestOptions?: RequestOptions): Promise<ScreenshotCreateResponse>\n```\n\nPOST /v1/screenshots — capture a screenshot.\n\n`params.async` maps to the `?async=true` query param (queued 202 capture). It is a QUERY\nparam on `createScreenshot`, distinct from scrape where `async` is a body field. `params` is\noptional and `async` omitted-when-absent: `create(opts)` with no second argument posts to the\nbare `/v1/screenshots` URL unchanged — existing single-arg callers are unaffected.\n\n`requestOptions` is the THIRD positional parameter (after `params`) so both existing call\nshapes stay unaffected. It 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.screenshots.get(id: ScreenshotId, requestOptions?: RequestOptions): Promise<ScreenshotGetResponse>\n```\n\nGET /v1/screenshots/\\{id\\} — poll a screenshot by ID.\n\nA terminal-`failed` screenshot returns the `Error` envelope on a 200
|
|
520
|
+
"body": "# Screenshots\n\nCapture full-page or viewport screenshots. Accessed via `client.screenshots`.\n\n## create\n\n```ts\nclient.screenshots.create(opts: ScreenshotCreateRequest, params?: { async?: boolean }, requestOptions?: RequestOptions): Promise<ScreenshotCreateResponse>\n```\n\nPOST /v1/screenshots — capture a screenshot.\n\n`params.async` maps to the `?async=true` query param (queued 202 capture). It is a QUERY\nparam on `createScreenshot`, distinct from scrape where `async` is a body field. `params` is\noptional and `async` omitted-when-absent: `create(opts)` with no second argument posts to the\nbare `/v1/screenshots` URL unchanged — existing single-arg callers are unaffected.\n\n`requestOptions` is the THIRD positional parameter (after `params`) so both existing call\nshapes stay unaffected. It 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.screenshots.get(id: ScreenshotId, requestOptions?: RequestOptions): Promise<ScreenshotGetResponse>\n```\n\nGET /v1/screenshots/\\{id\\} — poll a screenshot by ID.\n\nA terminal-`failed` screenshot returns the `Error` envelope on a 200,\nso narrow the result before reading `image_url`.\n\n## createWithResponse\n\n```ts\nclient.screenshots.createWithResponse(opts: ScreenshotCreateRequest, params?: { async?: boolean }, requestOptions?: RequestOptions): Promise<ApiResponse<ScreenshotCreateResponse>>\n```\n\nPOST /v1/screenshots, returning the header set alongside the body.\n\nSame request as `screenshots.create` — same method, path, body and\n`RequestOptions` precedence — and `data` is exactly what `create()` resolves to.\n`create()`'s own return type is UNCHANGED; this is an additive sibling.\n\nThe spec documents the `X-Screenshot-*` family (`ID`, `Status`, `URL`,\n`Credits-Charged`, `Duration-Ms`, `Created-At`, `Completed-At`, `Expires-At`,\n`Status-Code`, `Cache`, `Cache-Age`) plus `X-Raw-Bytes` / `X-Billable-Bytes` /\n`X-Billing-Multiplier`; every one of them is on `headers`.\n\n## getWithResponse\n\n```ts\nclient.screenshots.getWithResponse(id: ScreenshotId, requestOptions?: RequestOptions): Promise<ApiResponse<ScreenshotGetResponse>>\n```\n\nGET /v1/screenshots/\\{id\\}, returning the header set alongside the body.\n\nSame request as `screenshots.get`, and `data` is exactly what `get()`\nresolves to (including the failed-envelope arm). `get()`'s own return type is\nUNCHANGED; this is an additive sibling.\n\nCall it for the typed body, NOT for header metadata: the spec declares\n`GET /v1/screenshots/\\{id\\}` with NO `X-*` response headers, and a live GET returns\nnone, so `headers` carries only the transport's own entries (`Content-Type`, …).\nThe `X-Screenshot-*` / `X-Raw-Bytes` / `X-Billable-Bytes` / `X-Billing-Multiplier`\nfamily is emitted by `POST /v1/screenshots` — use `screenshots.createWithResponse`\nto read it. This matches `ByteKit.requestWithResponse` and the README,\nwhich are the truth for what this endpoint emits."
|
|
521
521
|
},
|
|
522
522
|
"sdk/typescript/search": {
|
|
523
523
|
"title": "Search",
|
|
@@ -527,7 +527,7 @@
|
|
|
527
527
|
"sdk/typescript/sitemap": {
|
|
528
528
|
"title": "Sitemap",
|
|
529
529
|
"section": "SDK Reference",
|
|
530
|
-
"body": "# Sitemap\n\nDiscover URLs from a domain's sitemap or by crawling. Accessed via `client.sitemap`.\n\n## create\n\n```ts\nclient.sitemap.create(opts: SitemapCreateRequest, requestOptions?: RequestOptions): Promise<SitemapCreateResponse>\n```\n\nPOST /v1/sitemap — start a sitemap crawl.\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.sitemap.get(id: SitemapId, requestOptions?: RequestOptions): Promise<SitemapGetResponse>\n```\n\nGET /v1/sitemap/\\{id\\} — get a sitemap job by ID\n\n## getWithResponse\n\n```ts\nclient.sitemap.getWithResponse(id: SitemapId, requestOptions?: RequestOptions): Promise<ApiResponse<SitemapGetResponse>>\n```\n\nGET /v1/sitemap/\\{id\\}, returning the header set alongside the body
|
|
530
|
+
"body": "# Sitemap\n\nDiscover URLs from a domain's sitemap or by crawling. Accessed via `client.sitemap`.\n\n## create\n\n```ts\nclient.sitemap.create(opts: SitemapCreateRequest, requestOptions?: RequestOptions): Promise<SitemapCreateResponse>\n```\n\nPOST /v1/sitemap — start a sitemap crawl.\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.sitemap.get(id: SitemapId, requestOptions?: RequestOptions): Promise<SitemapGetResponse>\n```\n\nGET /v1/sitemap/\\{id\\} — get a sitemap job by ID\n\n## getWithResponse\n\n```ts\nclient.sitemap.getWithResponse(id: SitemapId, requestOptions?: RequestOptions): Promise<ApiResponse<SitemapGetResponse>>\n```\n\nGET /v1/sitemap/\\{id\\}, returning the header set alongside the body.\n\nSame request as `sitemap.get` — same method, path and `RequestOptions`\nprecedence — and `data` is exactly what `get()` resolves to. `get()`'s own return type\nis UNCHANGED; this is an additive sibling, not a replacement.\n\nThe spec documents `X-Sitemap-ID`, `X-Raw-Bytes`, `X-Billing-Multiplier` and\n`X-Billable-Bytes` on this endpoint's 200; every one of them is on `headers`."
|
|
531
531
|
},
|
|
532
532
|
"sdk/typescript/usage": {
|
|
533
533
|
"title": "Usage",
|
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.6",
|
|
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",
|