@hunt-labs/bytekit-sdk 0.9.0 → 0.9.2
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 +52 -0
- package/README.md +1 -1
- package/dist/generated/api.d.ts +274 -57
- package/dist/resources/scrape.d.ts +4 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,58 @@ today, see [README.md](./README.md), which remains the authoritative usage guide
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
## [0.9.2] - 2026-09-03
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- **Breaking (API):** the scrape `formats` vocabulary is now `raw | markdown | links | images`
|
|
18
|
+
(#3775). The unprocessed-source format is called `raw` — it has returned JSON, XML and plain
|
|
19
|
+
text alongside HTML since #1853, so the old raw-HTML name misdescribed it — and the
|
|
20
|
+
cleaned-article-HTML format is gone. The server accepts no alias for either retired value, so
|
|
21
|
+
a request naming one now comes back `422` with the new set in the message. Update `formats`
|
|
22
|
+
and read the content back from `formats.raw`:
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
const result = await client.scrape.create({ url, formats: ['raw', 'markdown'] });
|
|
26
|
+
console.log(result.formats.raw);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- Regenerated `src/generated/api.d.ts` against the documented `402` contract (#3784). Every
|
|
30
|
+
quota-enforced operation now declares `402` through one shared `PaymentRequired` response, and
|
|
31
|
+
the `X-Quota-*` headers are referenced by the operations that actually emit them. Types only —
|
|
32
|
+
no runtime behavior changed.
|
|
33
|
+
|
|
34
|
+
- The generated `events` field description on the scrape request type now documents the
|
|
35
|
+
widened server default (`queued`, `completed`, `failed`) and that a caller may send an
|
|
36
|
+
explicit subset to receive fewer deliveries (#3777). Types/docs only — this regeneration
|
|
37
|
+
followed a server-side default change; the SDK carried no logic tied to the old default.
|
|
38
|
+
|
|
39
|
+
## [0.9.1] - 2026-08-25
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
|
|
43
|
+
- The generated `paths` type for the `200` of `GET /v1/scrape/bulk/{id}` now declares `items`
|
|
44
|
+
(#3632). The route builds one body and varies only the status code, so the terminal `200`
|
|
45
|
+
has always carried the per-URL scrape envelopes — but only the `202` documented them, so
|
|
46
|
+
`scrape.bulk.get()` typed the results away at exactly the poll that has them. Types only:
|
|
47
|
+
the field was already on the wire, and server behavior is unchanged.
|
|
48
|
+
|
|
49
|
+
- The generated `paths` types now describe the `202` that `GET /v1/scrape/bulk/{id}`,
|
|
50
|
+
`GET /v1/fetch/bulk/{id}` and `GET /v1/bulk/{id}` already serve while a bulk job is
|
|
51
|
+
non-terminal (#3533). Each of the three returns 202 with the job envelope until the job is
|
|
52
|
+
terminal and 200 afterwards, but only the 200 was declared, so anything typed off the spec
|
|
53
|
+
had no shape for the response the very first poll receives. Types only: `scrape.bulk.get()`,
|
|
54
|
+
`fetch.bulk.get()` and `bulk.get()` already resolved the body on any 2xx, and server behavior
|
|
55
|
+
is unchanged.
|
|
56
|
+
|
|
57
|
+
### Changed
|
|
58
|
+
|
|
59
|
+
- The generated `topup_balance_bytes` description on `GET /v1/usage` now states that the value is
|
|
60
|
+
the remaining purchased top-up bytes, already net of any overage consumed against them (#3459).
|
|
61
|
+
Types only: the field's name, type and wire format are unchanged. The server previously
|
|
62
|
+
subtracted the consumed overage a second time when computing this value, so the number a client
|
|
63
|
+
reads is larger than before for accounts that ran past their included allowance.
|
|
64
|
+
|
|
13
65
|
## [0.9.0] - 2026-08-20
|
|
14
66
|
|
|
15
67
|
### Removed
|
package/README.md
CHANGED
package/dist/generated/api.d.ts
CHANGED
|
@@ -1521,10 +1521,10 @@ export interface components {
|
|
|
1521
1521
|
url: string;
|
|
1522
1522
|
/**
|
|
1523
1523
|
* @default [
|
|
1524
|
-
* "
|
|
1524
|
+
* "raw"
|
|
1525
1525
|
* ]
|
|
1526
1526
|
*/
|
|
1527
|
-
formats: ("
|
|
1527
|
+
formats: ("raw" | "markdown" | "links" | "images")[];
|
|
1528
1528
|
/** @default US */
|
|
1529
1529
|
country: string;
|
|
1530
1530
|
/** @default 0 */
|
|
@@ -1539,7 +1539,9 @@ export interface components {
|
|
|
1539
1539
|
*/
|
|
1540
1540
|
webhook_url?: string;
|
|
1541
1541
|
/**
|
|
1542
|
+
* @description Webhook event types to deliver when webhook_url is set. Defaults to all three (queued, completed, failed); send an explicit subset to receive fewer.
|
|
1542
1543
|
* @default [
|
|
1544
|
+
* "queued",
|
|
1543
1545
|
* "completed",
|
|
1544
1546
|
* "failed"
|
|
1545
1547
|
* ]
|
|
@@ -1572,7 +1574,7 @@ export interface components {
|
|
|
1572
1574
|
markdown_filter_images?: boolean;
|
|
1573
1575
|
/** @description 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`. */
|
|
1574
1576
|
markdown_include_media?: boolean;
|
|
1575
|
-
/** @description When true, enables markdown-pipeline and tag-filter warnings for
|
|
1577
|
+
/** @description When true, enables markdown-pipeline and tag-filter warnings for requests that include the `markdown` format. Artifact availability warnings such as `artifact_unavailable` may appear independently of this flag. */
|
|
1576
1578
|
markdown_include_warnings?: boolean;
|
|
1577
1579
|
/** @description When true, the response includes a top-level `stats` object with `ScrapeStats` (chars, tokens, blocks). Only effective when `markdown` is in `formats`. */
|
|
1578
1580
|
markdown_include_stats?: boolean;
|
|
@@ -1590,17 +1592,17 @@ export interface components {
|
|
|
1590
1592
|
*/
|
|
1591
1593
|
mobile: boolean;
|
|
1592
1594
|
/**
|
|
1593
|
-
* @description When true (default), base64-encoded `data:` image sources are stripped from the HTML before markdown conversion
|
|
1595
|
+
* @description When true (default), base64-encoded `data:` image sources are stripped from the HTML before markdown conversion. Set to false to preserve base64 images in the pipeline output. Does not affect `raw`, which always returns the original source unchanged.
|
|
1594
1596
|
* @default true
|
|
1595
1597
|
*/
|
|
1596
1598
|
remove_base64_images: boolean;
|
|
1597
1599
|
/**
|
|
1598
|
-
* @description HTML element names (not CSS selectors) to keep. When non-empty, only content within these elements is included in the `
|
|
1600
|
+
* @description HTML element names (not CSS selectors) to keep. When non-empty, only content within these elements is included in the `markdown` output. Applied before `exclude_tags`. Does not affect `raw`, which always returns the full page.
|
|
1599
1601
|
* @default []
|
|
1600
1602
|
*/
|
|
1601
1603
|
include_tags: string[];
|
|
1602
1604
|
/**
|
|
1603
|
-
* @description HTML element names (not CSS selectors) to strip from the `
|
|
1605
|
+
* @description HTML element names (not CSS selectors) to strip from the `markdown` output. Applied after `include_tags` when both are present. Does not affect `raw`, which always returns the full page.
|
|
1604
1606
|
* @default []
|
|
1605
1607
|
*/
|
|
1606
1608
|
exclude_tags: string[];
|
|
@@ -1670,8 +1672,8 @@ export interface components {
|
|
|
1670
1672
|
truncated: boolean;
|
|
1671
1673
|
};
|
|
1672
1674
|
ScrapeFormats: {
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
+
/** @description The untouched upstream source of whatever the URL served — HTML, JSON, XML or plain text. */
|
|
1676
|
+
raw?: string;
|
|
1675
1677
|
markdown?: string;
|
|
1676
1678
|
/** @description Plain URL strings by default. When markdownIncludeMedia=true, an array of ScrapeScoredLink objects. */
|
|
1677
1679
|
links?: string[] | components["schemas"]["ScrapeScoredLink"][];
|
|
@@ -1709,8 +1711,7 @@ export interface components {
|
|
|
1709
1711
|
* "status_code": 200,
|
|
1710
1712
|
* "retrieved_at": "2025-01-15T12:00:00Z",
|
|
1711
1713
|
* "formats": {
|
|
1712
|
-
* "
|
|
1713
|
-
* "html": "<html><body><h1>Hello World</h1><p>Example page with a <a href=\"/about\">link</a> and an image.</p></body></html>",
|
|
1714
|
+
* "raw": "<html><body><h1>Hello World</h1><p>Example page with a <a href=\"/about\">link</a> and an image.</p></body></html>",
|
|
1714
1715
|
* "markdown": "# Hello World\n\nExample page with a [link](/about) and an image.\n\n",
|
|
1715
1716
|
* "links": [
|
|
1716
1717
|
* {
|
|
@@ -2147,6 +2148,7 @@ export interface components {
|
|
|
2147
2148
|
* @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported)
|
|
2148
2149
|
*/
|
|
2149
2150
|
webhook_url: string;
|
|
2151
|
+
/** @description HMAC secret used to sign webhook deliveries. Each delivery carries `X-Webhook-Timestamp` and `X-Webhook-Signature` (`sha256=` + the hex HMAC-SHA256 of `timestamp.body`). See https://bytekit.com/docs/guides/webhooks for verification code. */
|
|
2150
2152
|
webhook_secret?: string;
|
|
2151
2153
|
/** @description Max 20 headers. Keys must match /^[A-Za-z0-9-]+$/ and not be reserved. */
|
|
2152
2154
|
webhook_headers?: {
|
|
@@ -2176,6 +2178,7 @@ export interface components {
|
|
|
2176
2178
|
* @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported)
|
|
2177
2179
|
*/
|
|
2178
2180
|
webhook_url?: string;
|
|
2181
|
+
/** @description HMAC secret used to sign webhook deliveries. Each delivery carries `X-Webhook-Timestamp` and `X-Webhook-Signature` (`sha256=` + the hex HMAC-SHA256 of `timestamp.body`). See https://bytekit.com/docs/guides/webhooks for verification code. */
|
|
2179
2182
|
webhook_secret?: string;
|
|
2180
2183
|
webhook_headers?: {
|
|
2181
2184
|
[key: string]: string;
|
|
@@ -2236,7 +2239,7 @@ export interface components {
|
|
|
2236
2239
|
};
|
|
2237
2240
|
MonitorCreateResponse: components["schemas"]["MonitorResponse"] & {
|
|
2238
2241
|
/**
|
|
2239
|
-
* @description The webhook signing secret — returned **once** at creation time only. Subsequent GET requests omit this field. Always present on a create response (`webhook_url` is required on create). Format: 64 lowercase hex characters (32 bytes of entropy).
|
|
2242
|
+
* @description The webhook signing secret — returned **once** at creation time only. Subsequent GET requests omit this field. Always present on a create response (`webhook_url` is required on create). Format: 64 lowercase hex characters (32 bytes of entropy). Use it to verify the `X-Webhook-Signature` header on each delivery — see https://bytekit.com/docs/guides/webhooks.
|
|
2240
2243
|
* @example a3f1b2c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2
|
|
2241
2244
|
*/
|
|
2242
2245
|
webhook_secret?: string;
|
|
@@ -2285,7 +2288,10 @@ export interface components {
|
|
|
2285
2288
|
* @description Optional webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported). When omitted, no `sitemap.completed`/`sitemap.failed` webhook is delivered and the job is poll-only via `GET /v1/sitemap/{id}`. When present, delivery is unchanged. `webhook_secret` is ignored when `webhook_url` is absent.
|
|
2286
2289
|
*/
|
|
2287
2290
|
webhook_url?: string;
|
|
2288
|
-
/**
|
|
2291
|
+
/**
|
|
2292
|
+
* @description HMAC secret used to sign webhook deliveries. Each delivery carries `X-Webhook-Timestamp` and `X-Webhook-Signature` (`sha256=` + the hex HMAC-SHA256 of `timestamp.body`). See https://bytekit.com/docs/guides/webhooks for verification code.
|
|
2293
|
+
* @default null
|
|
2294
|
+
*/
|
|
2289
2295
|
webhook_secret: string | null;
|
|
2290
2296
|
/**
|
|
2291
2297
|
* @description Max 90 days.
|
|
@@ -2522,7 +2528,10 @@ export interface components {
|
|
|
2522
2528
|
};
|
|
2523
2529
|
/** Format: date-time */
|
|
2524
2530
|
cancelled_at: string | null;
|
|
2525
|
-
/**
|
|
2531
|
+
/**
|
|
2532
|
+
* Format: date-time
|
|
2533
|
+
* @description Reserved, and always `null` today: it reflects the account's cancellation grace deadline, which no current code path sets. It is not the payment-failure grace period — that deadline is tracked per invoice (7 days from the failed payment) in `billing_dunning_graces` and is not exposed on this response.
|
|
2534
|
+
*/
|
|
2526
2535
|
grace_period_expires_at: string | null;
|
|
2527
2536
|
/** Format: date-time */
|
|
2528
2537
|
created_at: string;
|
|
@@ -2607,6 +2616,7 @@ export interface components {
|
|
|
2607
2616
|
purchased_topup_bytes: number;
|
|
2608
2617
|
/** @description Bytes remaining in starter-grant lots, after active refund reservations. Purchased top-up bytes are excluded. */
|
|
2609
2618
|
granted_topup_bytes: number;
|
|
2619
|
+
/** @description Unspent subscription allowance carried over from earlier billing periods: bytes remaining in allowance lots granted before the current period started, after active refund reservations. Carried value is spent before the current period's allowance, so this falls to `0` before `limit_bytes` reaches the current allowance alone. */
|
|
2610
2620
|
rollover_bytes: number;
|
|
2611
2621
|
};
|
|
2612
2622
|
CreditBalance: {
|
|
@@ -2619,10 +2629,52 @@ export interface components {
|
|
|
2619
2629
|
purchased_topup_credits: number;
|
|
2620
2630
|
/** @description Credits remaining in starter-grant lots, after active refund reservations. Purchased top-up credits are excluded. */
|
|
2621
2631
|
granted_topup_credits: number;
|
|
2632
|
+
/** @description Always `0`. Search credits do not carry over between billing periods; the field is retained for contract stability and will not become non-zero without an announced plan change. */
|
|
2622
2633
|
rollover_credits: number;
|
|
2623
2634
|
};
|
|
2624
2635
|
};
|
|
2625
|
-
responses:
|
|
2636
|
+
responses: {
|
|
2637
|
+
/**
|
|
2638
|
+
* @description Payment required. The account cannot fund this request, and no work was
|
|
2639
|
+
* performed. The unified `Error` envelope carries one of the billing codes
|
|
2640
|
+
* below in `error.code`; match on the code, never on the prose.
|
|
2641
|
+
*
|
|
2642
|
+
* - `quota_exceeded` — the enforced balance for this request's meter is
|
|
2643
|
+
* exhausted. Capture endpoints (`/v1/scrape`, `/v1/fetch`,
|
|
2644
|
+
* `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter
|
|
2645
|
+
* bandwidth; `/v1/search` meters credits.
|
|
2646
|
+
* - `spending_cap_reached` — the request would push overage spend past the
|
|
2647
|
+
* account's configured cap. Only reachable on a custom overage-enabled
|
|
2648
|
+
* plan; standard plans stop at `quota_exceeded`.
|
|
2649
|
+
* - `billing_entitlement_impaired` — the paid subscription is in a payment
|
|
2650
|
+
* impairment (e.g. `past_due`). `error.message` names the reason.
|
|
2651
|
+
* - `billing_entitlement_expired` — the paid subscription entitlement
|
|
2652
|
+
* period has ended, or its dunning grace period has run out.
|
|
2653
|
+
*
|
|
2654
|
+
* Not retryable as-is: settle the balance, raise the cap, or restore the
|
|
2655
|
+
* subscription first. This response carries no `X-Quota-*` headers — they
|
|
2656
|
+
* travel with the 2xx responses of the operations that emit them.
|
|
2657
|
+
*/
|
|
2658
|
+
PaymentRequired: {
|
|
2659
|
+
headers: {
|
|
2660
|
+
[name: string]: unknown;
|
|
2661
|
+
};
|
|
2662
|
+
content: {
|
|
2663
|
+
/**
|
|
2664
|
+
* @example {
|
|
2665
|
+
* "status": "failed",
|
|
2666
|
+
* "error": {
|
|
2667
|
+
* "code": "quota_exceeded",
|
|
2668
|
+
* "message": "Monthly bandwidth quota exhausted.",
|
|
2669
|
+
* "http_status": 402,
|
|
2670
|
+
* "failed_at": "2026-01-15T12:00:00Z"
|
|
2671
|
+
* }
|
|
2672
|
+
* }
|
|
2673
|
+
*/
|
|
2674
|
+
"application/json": components["schemas"]["Error"];
|
|
2675
|
+
};
|
|
2676
|
+
};
|
|
2677
|
+
};
|
|
2626
2678
|
parameters: {
|
|
2627
2679
|
/**
|
|
2628
2680
|
* @description Optional. Identifies which published ByteKit client sent the request, as
|
|
@@ -2663,8 +2715,8 @@ export interface components {
|
|
|
2663
2715
|
XQuotaUsed: number;
|
|
2664
2716
|
/** @description Remaining quota in the billing period. */
|
|
2665
2717
|
XQuotaRemaining: number;
|
|
2666
|
-
/** @description
|
|
2667
|
-
XQuotaReset:
|
|
2718
|
+
/** @description Unix epoch second at which the current billing period ends — the same unit as `X-RateLimit-Reset`, not an ISO 8601 timestamp (issue #1538). */
|
|
2719
|
+
XQuotaReset: number;
|
|
2668
2720
|
/** @description Maximum concurrent jobs allowed. */
|
|
2669
2721
|
XConcurrencyLimit: number;
|
|
2670
2722
|
/** @description Currently active concurrent jobs. */
|
|
@@ -3168,6 +3220,10 @@ export interface operations {
|
|
|
3168
3220
|
"X-Screenshot-Cache"?: "hit" | "miss" | "bypass";
|
|
3169
3221
|
/** @description Age of the cached screenshot in seconds. Present only on cache hits. */
|
|
3170
3222
|
"X-Screenshot-Cache-Age"?: number;
|
|
3223
|
+
"X-Quota-Limit": components["headers"]["XQuotaLimit"];
|
|
3224
|
+
"X-Quota-Used": components["headers"]["XQuotaUsed"];
|
|
3225
|
+
"X-Quota-Remaining": components["headers"]["XQuotaRemaining"];
|
|
3226
|
+
"X-Quota-Reset": components["headers"]["XQuotaReset"];
|
|
3171
3227
|
[name: string]: unknown;
|
|
3172
3228
|
};
|
|
3173
3229
|
content: {
|
|
@@ -3197,6 +3253,10 @@ export interface operations {
|
|
|
3197
3253
|
"X-Billable-Bytes"?: number;
|
|
3198
3254
|
/** @description Billing multiplier applied to raw bytes to compute billable bytes. A rendering of the response body's `billing` node, which is the authoritative surface: it names each factor that composed this value. Where the two disagree, the node is correct. */
|
|
3199
3255
|
"X-Billing-Multiplier"?: number;
|
|
3256
|
+
"X-Quota-Limit": components["headers"]["XQuotaLimit"];
|
|
3257
|
+
"X-Quota-Used": components["headers"]["XQuotaUsed"];
|
|
3258
|
+
"X-Quota-Remaining": components["headers"]["XQuotaRemaining"];
|
|
3259
|
+
"X-Quota-Reset": components["headers"]["XQuotaReset"];
|
|
3200
3260
|
[name: string]: unknown;
|
|
3201
3261
|
};
|
|
3202
3262
|
content: {
|
|
@@ -3222,15 +3282,7 @@ export interface operations {
|
|
|
3222
3282
|
"application/json": components["schemas"]["Error"];
|
|
3223
3283
|
};
|
|
3224
3284
|
};
|
|
3225
|
-
|
|
3226
|
-
402: {
|
|
3227
|
-
headers: {
|
|
3228
|
-
[name: string]: unknown;
|
|
3229
|
-
};
|
|
3230
|
-
content: {
|
|
3231
|
-
"application/json": components["schemas"]["Error"];
|
|
3232
|
-
};
|
|
3233
|
-
};
|
|
3285
|
+
402: components["responses"]["PaymentRequired"];
|
|
3234
3286
|
/**
|
|
3235
3287
|
* @description Validation error, or a screenshot that failed inside the sync hold.
|
|
3236
3288
|
* The two carry DIFFERENT bodies (issue #2679):
|
|
@@ -3262,6 +3314,10 @@ export interface operations {
|
|
|
3262
3314
|
headers: {
|
|
3263
3315
|
/** @description Stable screenshot identifier (matches `id` in the resource body). Emitted only on the failed-capture variant; absent on a request-validation failure. */
|
|
3264
3316
|
"X-Screenshot-ID"?: string;
|
|
3317
|
+
"X-Quota-Limit": components["headers"]["XQuotaLimit"];
|
|
3318
|
+
"X-Quota-Used": components["headers"]["XQuotaUsed"];
|
|
3319
|
+
"X-Quota-Remaining": components["headers"]["XQuotaRemaining"];
|
|
3320
|
+
"X-Quota-Reset": components["headers"]["XQuotaReset"];
|
|
3265
3321
|
[name: string]: unknown;
|
|
3266
3322
|
};
|
|
3267
3323
|
content: {
|
|
@@ -3339,7 +3395,7 @@ export interface operations {
|
|
|
3339
3395
|
* @example {
|
|
3340
3396
|
* "url": "https://example.com",
|
|
3341
3397
|
* "formats": [
|
|
3342
|
-
* "
|
|
3398
|
+
* "raw",
|
|
3343
3399
|
* "markdown"
|
|
3344
3400
|
* ],
|
|
3345
3401
|
* "markdown_mode": "article",
|
|
@@ -3386,7 +3442,7 @@ export interface operations {
|
|
|
3386
3442
|
"X-Raw-Bytes"?: number;
|
|
3387
3443
|
/** @description Chargeable bytes after applying the billing multiplier. Equals round(X-Raw-Bytes × X-Billing-Multiplier). */
|
|
3388
3444
|
"X-Billable-Bytes"?: number;
|
|
3389
|
-
/** @description Bandwidth cost multiplier (e.g. 1.0 for
|
|
3445
|
+
/** @description Bandwidth cost multiplier (e.g. 1.0 for a `raw`-only scrape, 1.5 when `markdown` is also requested). Cache hits compose the endpoint format factor, which is a separate number from this one: 0.5 for an unprocessed-source scrape, 0.75 with markdown. Excludes the `clean_markdown` surcharge: when `clean_markdown: true` and the clean succeeded, the settled usage is 3× this header's value, so this header does not predict the amount you are billed. The response body's `billing` node is the authoritative surface — it DOES carry the `clean_markdown` factor, so its `multiplier` and `billed_bytes` are what you are charged. Where the two disagree, the node is correct. */
|
|
3390
3446
|
"X-Billing-Multiplier"?: number;
|
|
3391
3447
|
/** @description Credits charged for this scrape (multiplier applied to base 1.0 per format). */
|
|
3392
3448
|
"X-Scrape-Credits-Charged"?: number;
|
|
@@ -3416,6 +3472,10 @@ export interface operations {
|
|
|
3416
3472
|
"X-Scrape-Proxy-Tier-Label"?: string;
|
|
3417
3473
|
/** @description WAF vendor detected on the target, if any (diagnostic). May be "suspected" when a low-confidence fail-open block marker was served. Omitted when no WAF is detected. */
|
|
3418
3474
|
"X-Scrape-Waf"?: string;
|
|
3475
|
+
"X-Quota-Limit": components["headers"]["XQuotaLimit"];
|
|
3476
|
+
"X-Quota-Used": components["headers"]["XQuotaUsed"];
|
|
3477
|
+
"X-Quota-Remaining": components["headers"]["XQuotaRemaining"];
|
|
3478
|
+
"X-Quota-Reset": components["headers"]["XQuotaReset"];
|
|
3419
3479
|
[name: string]: unknown;
|
|
3420
3480
|
};
|
|
3421
3481
|
content: {
|
|
@@ -3429,6 +3489,10 @@ export interface operations {
|
|
|
3429
3489
|
"X-Scrape-ID"?: string;
|
|
3430
3490
|
/** @description Always `queued` on a 202 response. */
|
|
3431
3491
|
"X-Scrape-Status"?: "queued";
|
|
3492
|
+
"X-Quota-Limit": components["headers"]["XQuotaLimit"];
|
|
3493
|
+
"X-Quota-Used": components["headers"]["XQuotaUsed"];
|
|
3494
|
+
"X-Quota-Remaining": components["headers"]["XQuotaRemaining"];
|
|
3495
|
+
"X-Quota-Reset": components["headers"]["XQuotaReset"];
|
|
3432
3496
|
[name: string]: unknown;
|
|
3433
3497
|
};
|
|
3434
3498
|
content: {
|
|
@@ -3454,6 +3518,7 @@ export interface operations {
|
|
|
3454
3518
|
"application/json": components["schemas"]["Error"];
|
|
3455
3519
|
};
|
|
3456
3520
|
};
|
|
3521
|
+
402: components["responses"]["PaymentRequired"];
|
|
3457
3522
|
/** @description Validation error. */
|
|
3458
3523
|
422: {
|
|
3459
3524
|
headers: {
|
|
@@ -3529,7 +3594,7 @@ export interface operations {
|
|
|
3529
3594
|
* {
|
|
3530
3595
|
* "url": "https://example.com",
|
|
3531
3596
|
* "formats": [
|
|
3532
|
-
* "
|
|
3597
|
+
* "raw",
|
|
3533
3598
|
* "markdown"
|
|
3534
3599
|
* ],
|
|
3535
3600
|
* "custom": {
|
|
@@ -3545,7 +3610,7 @@ export interface operations {
|
|
|
3545
3610
|
* ],
|
|
3546
3611
|
* "defaults": {
|
|
3547
3612
|
* "formats": [
|
|
3548
|
-
* "
|
|
3613
|
+
* "raw"
|
|
3549
3614
|
* ],
|
|
3550
3615
|
* "country": "US"
|
|
3551
3616
|
* },
|
|
@@ -3562,7 +3627,7 @@ export interface operations {
|
|
|
3562
3627
|
items?: {
|
|
3563
3628
|
/** Format: uri */
|
|
3564
3629
|
url: string;
|
|
3565
|
-
formats?: ("
|
|
3630
|
+
formats?: ("raw" | "markdown" | "links" | "images")[];
|
|
3566
3631
|
country?: string;
|
|
3567
3632
|
delay_ms?: number;
|
|
3568
3633
|
timeout_ms?: number;
|
|
@@ -3592,10 +3657,10 @@ export interface operations {
|
|
|
3592
3657
|
defaults?: {
|
|
3593
3658
|
/**
|
|
3594
3659
|
* @default [
|
|
3595
|
-
* "
|
|
3660
|
+
* "raw"
|
|
3596
3661
|
* ]
|
|
3597
3662
|
*/
|
|
3598
|
-
formats?: ("
|
|
3663
|
+
formats?: ("raw" | "markdown" | "links" | "images")[];
|
|
3599
3664
|
/** @default US */
|
|
3600
3665
|
country?: string;
|
|
3601
3666
|
/** @default 0 */
|
|
@@ -3619,6 +3684,7 @@ export interface operations {
|
|
|
3619
3684
|
* @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported)
|
|
3620
3685
|
*/
|
|
3621
3686
|
webhook_url: string;
|
|
3687
|
+
/** @description HMAC secret used to sign webhook deliveries. Each delivery carries `X-Webhook-Timestamp` and `X-Webhook-Signature` (`sha256=` + the hex HMAC-SHA256 of `timestamp.body`). See https://bytekit.com/docs/guides/webhooks for verification code. */
|
|
3622
3688
|
webhook_secret?: string;
|
|
3623
3689
|
metadata?: components["schemas"]["Metadata"];
|
|
3624
3690
|
/**
|
|
@@ -3640,6 +3706,10 @@ export interface operations {
|
|
|
3640
3706
|
/** @description Bulk scrape job accepted. */
|
|
3641
3707
|
202: {
|
|
3642
3708
|
headers: {
|
|
3709
|
+
"X-Quota-Limit": components["headers"]["XQuotaLimit"];
|
|
3710
|
+
"X-Quota-Used": components["headers"]["XQuotaUsed"];
|
|
3711
|
+
"X-Quota-Remaining": components["headers"]["XQuotaRemaining"];
|
|
3712
|
+
"X-Quota-Reset": components["headers"]["XQuotaReset"];
|
|
3643
3713
|
[name: string]: unknown;
|
|
3644
3714
|
};
|
|
3645
3715
|
content: {
|
|
@@ -3683,6 +3753,7 @@ export interface operations {
|
|
|
3683
3753
|
"application/json": components["schemas"]["Error"];
|
|
3684
3754
|
};
|
|
3685
3755
|
};
|
|
3756
|
+
402: components["responses"]["PaymentRequired"];
|
|
3686
3757
|
/**
|
|
3687
3758
|
* @description Validation error. `bulk_too_large` is returned when the item count
|
|
3688
3759
|
* exceeds the account plan's `max_bulk_size` cap (also surfaced as
|
|
@@ -3739,6 +3810,43 @@ export interface operations {
|
|
|
3739
3810
|
estimated_credits: number | null;
|
|
3740
3811
|
/** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
|
|
3741
3812
|
webhook_url: string;
|
|
3813
|
+
/** @description Rehydrated per-URL scrape envelopes — the terminal page of results (default 100 rows, `?limit=` up to 500). `routes/scrape-bulk.ts` spreads this key into the SAME body on both status branches, so it is present here exactly as it is on the 202; on the 200 the entries carry their final success or error envelopes (issue #3632). */
|
|
3814
|
+
items: components["schemas"]["ScrapeEnvelope"][];
|
|
3815
|
+
};
|
|
3816
|
+
};
|
|
3817
|
+
};
|
|
3818
|
+
/**
|
|
3819
|
+
* @description Bulk job still processing. `routes/scrape-bulk.ts` ends the poll handler
|
|
3820
|
+
* with `status: isTerminal ? 200 : 202` over an identical body, so this is
|
|
3821
|
+
* the SAME envelope the 200 documents — only the status code and the
|
|
3822
|
+
* reachable `status` values differ. Keep polling until you get a 200
|
|
3823
|
+
* (issue #3533).
|
|
3824
|
+
*/
|
|
3825
|
+
202: {
|
|
3826
|
+
headers: {
|
|
3827
|
+
[name: string]: unknown;
|
|
3828
|
+
};
|
|
3829
|
+
content: {
|
|
3830
|
+
"application/json": {
|
|
3831
|
+
/** @example bulk_01j9abc123 */
|
|
3832
|
+
id: string;
|
|
3833
|
+
/** @enum {string} */
|
|
3834
|
+
status: "processing";
|
|
3835
|
+
total: number;
|
|
3836
|
+
completed: number;
|
|
3837
|
+
failed: number;
|
|
3838
|
+
/** Format: date-time */
|
|
3839
|
+
created_at: string;
|
|
3840
|
+
/** Format: date-time */
|
|
3841
|
+
completed_at: string | null;
|
|
3842
|
+
/** @description Total credits billed for the job. Null until the job is billed. Fractional — credits are NUMERIC(10,2). */
|
|
3843
|
+
total_credits_charged: number | null;
|
|
3844
|
+
/** @description Null in GET responses (computed at submission time only). */
|
|
3845
|
+
estimated_credits: number | null;
|
|
3846
|
+
/** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
|
|
3847
|
+
webhook_url: string;
|
|
3848
|
+
/** @description Rehydrated per-URL scrape envelopes — the same page the 200 returns (default 100 rows, `?limit=` up to 500). While the job is non-terminal most entries carry the `queued` envelope. */
|
|
3849
|
+
items: components["schemas"]["ScrapeEnvelope"][];
|
|
3742
3850
|
};
|
|
3743
3851
|
};
|
|
3744
3852
|
};
|
|
@@ -3794,6 +3902,10 @@ export interface operations {
|
|
|
3794
3902
|
"X-Billing-Multiplier"?: number;
|
|
3795
3903
|
/** @description Back-compat duplicate of `X-Billing-Multiplier` — identical value on every path. Prefer `X-Billing-Multiplier`; this alias is retained for clients that read the `X-Fetch-*` header family. */
|
|
3796
3904
|
"X-Fetch-Billing-Multiplier"?: number;
|
|
3905
|
+
"X-Quota-Limit": components["headers"]["XQuotaLimit"];
|
|
3906
|
+
"X-Quota-Used": components["headers"]["XQuotaUsed"];
|
|
3907
|
+
"X-Quota-Remaining": components["headers"]["XQuotaRemaining"];
|
|
3908
|
+
"X-Quota-Reset": components["headers"]["XQuotaReset"];
|
|
3797
3909
|
[name: string]: unknown;
|
|
3798
3910
|
};
|
|
3799
3911
|
content: {
|
|
@@ -3809,6 +3921,7 @@ export interface operations {
|
|
|
3809
3921
|
"application/json": components["schemas"]["Error"];
|
|
3810
3922
|
};
|
|
3811
3923
|
};
|
|
3924
|
+
402: components["responses"]["PaymentRequired"];
|
|
3812
3925
|
/** @description Validation error (e.g. slow-path-only field). */
|
|
3813
3926
|
422: {
|
|
3814
3927
|
headers: {
|
|
@@ -3915,6 +4028,10 @@ export interface operations {
|
|
|
3915
4028
|
"X-Billing-Multiplier"?: number;
|
|
3916
4029
|
/** @description Back-compat duplicate of `X-Billing-Multiplier` — identical value on every path. Prefer `X-Billing-Multiplier`; this alias is retained for clients that read the `X-Fetch-*` header family. */
|
|
3917
4030
|
"X-Fetch-Billing-Multiplier"?: number;
|
|
4031
|
+
"X-Quota-Limit": components["headers"]["XQuotaLimit"];
|
|
4032
|
+
"X-Quota-Used": components["headers"]["XQuotaUsed"];
|
|
4033
|
+
"X-Quota-Remaining": components["headers"]["XQuotaRemaining"];
|
|
4034
|
+
"X-Quota-Reset": components["headers"]["XQuotaReset"];
|
|
3918
4035
|
[name: string]: unknown;
|
|
3919
4036
|
};
|
|
3920
4037
|
content: {
|
|
@@ -3930,6 +4047,7 @@ export interface operations {
|
|
|
3930
4047
|
"application/json": components["schemas"]["Error"];
|
|
3931
4048
|
};
|
|
3932
4049
|
};
|
|
4050
|
+
402: components["responses"]["PaymentRequired"];
|
|
3933
4051
|
/** @description Validation error (e.g. malformed JSON, unsupported fetch format, or slow-path-only field). */
|
|
3934
4052
|
422: {
|
|
3935
4053
|
headers: {
|
|
@@ -4019,6 +4137,7 @@ export interface operations {
|
|
|
4019
4137
|
* @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported)
|
|
4020
4138
|
*/
|
|
4021
4139
|
webhook_url: string;
|
|
4140
|
+
/** @description HMAC secret used to sign webhook deliveries. Each delivery carries `X-Webhook-Timestamp` and `X-Webhook-Signature` (`sha256=` + the hex HMAC-SHA256 of `timestamp.body`). See https://bytekit.com/docs/guides/webhooks for verification code. */
|
|
4022
4141
|
webhook_secret?: string;
|
|
4023
4142
|
metadata?: components["schemas"]["Metadata"];
|
|
4024
4143
|
};
|
|
@@ -4028,6 +4147,10 @@ export interface operations {
|
|
|
4028
4147
|
/** @description Fetch bulk job accepted. */
|
|
4029
4148
|
202: {
|
|
4030
4149
|
headers: {
|
|
4150
|
+
"X-Quota-Limit": components["headers"]["XQuotaLimit"];
|
|
4151
|
+
"X-Quota-Used": components["headers"]["XQuotaUsed"];
|
|
4152
|
+
"X-Quota-Remaining": components["headers"]["XQuotaRemaining"];
|
|
4153
|
+
"X-Quota-Reset": components["headers"]["XQuotaReset"];
|
|
4031
4154
|
[name: string]: unknown;
|
|
4032
4155
|
};
|
|
4033
4156
|
content: {
|
|
@@ -4071,6 +4194,7 @@ export interface operations {
|
|
|
4071
4194
|
"application/json": components["schemas"]["Error"];
|
|
4072
4195
|
};
|
|
4073
4196
|
};
|
|
4197
|
+
402: components["responses"]["PaymentRequired"];
|
|
4074
4198
|
/**
|
|
4075
4199
|
* @description Validation error. `bulk_too_large` is returned when the item count
|
|
4076
4200
|
* exceeds the account plan's `max_bulk_size` cap (also surfaced as
|
|
@@ -4154,6 +4278,72 @@ export interface operations {
|
|
|
4154
4278
|
};
|
|
4155
4279
|
};
|
|
4156
4280
|
};
|
|
4281
|
+
/**
|
|
4282
|
+
* @description Bulk job still processing. `routes/fetch-bulk.ts` ends the poll handler
|
|
4283
|
+
* with `status: isTerminal ? 200 : 202` over an identical body, so this is
|
|
4284
|
+
* the SAME envelope the 200 documents — only the status code and the
|
|
4285
|
+
* reachable `status` values differ. Keep polling until you get a 200; a
|
|
4286
|
+
* **cancelled** job stays on this branch forever (issue #3533).
|
|
4287
|
+
*
|
|
4288
|
+
* Item `content_url` values are pre-signed exactly as on the 200 — a fresh
|
|
4289
|
+
* 600-second signature on every poll.
|
|
4290
|
+
*/
|
|
4291
|
+
202: {
|
|
4292
|
+
headers: {
|
|
4293
|
+
[name: string]: unknown;
|
|
4294
|
+
};
|
|
4295
|
+
content: {
|
|
4296
|
+
"application/json": {
|
|
4297
|
+
/** @example bulk_01j9abc123 */
|
|
4298
|
+
id: string;
|
|
4299
|
+
/** @enum {string} */
|
|
4300
|
+
status: "processing" | "cancelled";
|
|
4301
|
+
total: number;
|
|
4302
|
+
completed: number;
|
|
4303
|
+
failed: number;
|
|
4304
|
+
/** Format: date-time */
|
|
4305
|
+
created_at: string;
|
|
4306
|
+
/** Format: date-time */
|
|
4307
|
+
completed_at: string | null;
|
|
4308
|
+
/** @description Total credits billed for the job. Null until the job is billed. Fractional — credits are NUMERIC(10,2). */
|
|
4309
|
+
total_credits_charged: number | null;
|
|
4310
|
+
/** @description Null in GET responses (computed at submission time only). */
|
|
4311
|
+
estimated_credits: number | null;
|
|
4312
|
+
/** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
|
|
4313
|
+
webhook_url: string;
|
|
4314
|
+
/** @description Per-URL fetch items, oldest first, capped at 500 (listBulkFetchItemsWithLatestAttempt). */
|
|
4315
|
+
items: {
|
|
4316
|
+
/**
|
|
4317
|
+
* @description Scrape-row id, `sc_`-prefixed. Fetch-bulk items are rows of the same resource sync `/v1/scrape` returns, so they share its prefix. Not to be confused with the `ft_`-prefixed `X-Fetch-ID` correlation header on sync `/v1/fetch`, which identifies a request rather than a stored item.
|
|
4318
|
+
* @example sc_01j9abc123
|
|
4319
|
+
*/
|
|
4320
|
+
id: string;
|
|
4321
|
+
/** Format: uri */
|
|
4322
|
+
url: string;
|
|
4323
|
+
/** @enum {string} */
|
|
4324
|
+
status: "pending" | "processing" | "completed" | "failed" | "cancelled";
|
|
4325
|
+
content_type: string | null;
|
|
4326
|
+
content_length: number | null;
|
|
4327
|
+
/** @description Pre-signed download URL for the fetched body, valid for 600 seconds (10 minutes) from the moment this response was generated — matching the signing TTL of `image_url` on `GET /v1/bulk/{id}/screenshots`. A new signature is minted on every poll. Null for items with no stored body; a completed item whose object cannot be signed falls back to the unsigned stored URL, which returns 401 on download. */
|
|
4328
|
+
content_url: string | null;
|
|
4329
|
+
waf_vendor: string | null;
|
|
4330
|
+
cache_hit: boolean;
|
|
4331
|
+
/**
|
|
4332
|
+
* @description Itemised account of this item's charge — the basis, the named factors
|
|
4333
|
+
* that composed the multiplier, and the resulting billed bytes. Omitted
|
|
4334
|
+
* for rows that completed before the billing node was persisted.
|
|
4335
|
+
*/
|
|
4336
|
+
billing?: components["schemas"]["BillingNode"];
|
|
4337
|
+
error_code: string | null;
|
|
4338
|
+
error_message: string | null;
|
|
4339
|
+
/** Format: date-time */
|
|
4340
|
+
created_at: string;
|
|
4341
|
+
/** Format: date-time */
|
|
4342
|
+
completed_at: string | null;
|
|
4343
|
+
}[];
|
|
4344
|
+
};
|
|
4345
|
+
};
|
|
4346
|
+
};
|
|
4157
4347
|
/** @description Resource not found. */
|
|
4158
4348
|
404: {
|
|
4159
4349
|
headers: {
|
|
@@ -4244,7 +4434,7 @@ export interface operations {
|
|
|
4244
4434
|
* "type": "scrape",
|
|
4245
4435
|
* "formats": [
|
|
4246
4436
|
* "markdown",
|
|
4247
|
-
* "
|
|
4437
|
+
* "raw"
|
|
4248
4438
|
* ],
|
|
4249
4439
|
* "include_html": true,
|
|
4250
4440
|
* "wait_until": "networkidle",
|
|
@@ -4260,7 +4450,7 @@ export interface operations {
|
|
|
4260
4450
|
* "device": "desktop",
|
|
4261
4451
|
* "country": "US",
|
|
4262
4452
|
* "formats": [
|
|
4263
|
-
* "
|
|
4453
|
+
* "raw"
|
|
4264
4454
|
* ],
|
|
4265
4455
|
* "device_scale_factor": 2
|
|
4266
4456
|
* },
|
|
@@ -4297,7 +4487,7 @@ export interface operations {
|
|
|
4297
4487
|
language?: string | null;
|
|
4298
4488
|
dark_mode?: boolean;
|
|
4299
4489
|
/** @description Scrape output formats (scrape entries). */
|
|
4300
|
-
formats?: ("
|
|
4490
|
+
formats?: ("raw" | "markdown" | "links" | "images")[];
|
|
4301
4491
|
/** @enum {string} */
|
|
4302
4492
|
wait_until?: "load" | "domcontentloaded" | "networkidle";
|
|
4303
4493
|
wait_for_selector?: string | null;
|
|
@@ -4350,7 +4540,7 @@ export interface operations {
|
|
|
4350
4540
|
language?: string | null;
|
|
4351
4541
|
/** @default false */
|
|
4352
4542
|
dark_mode?: boolean;
|
|
4353
|
-
formats?: ("
|
|
4543
|
+
formats?: ("raw" | "markdown" | "links" | "images")[];
|
|
4354
4544
|
/**
|
|
4355
4545
|
* @default load
|
|
4356
4546
|
* @enum {string}
|
|
@@ -4376,6 +4566,7 @@ export interface operations {
|
|
|
4376
4566
|
* @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported)
|
|
4377
4567
|
*/
|
|
4378
4568
|
webhook_url: string;
|
|
4569
|
+
/** @description HMAC secret used to sign webhook deliveries. Each delivery carries `X-Webhook-Timestamp` and `X-Webhook-Signature` (`sha256=` + the hex HMAC-SHA256 of `timestamp.body`). See https://bytekit.com/docs/guides/webhooks for verification code. */
|
|
4379
4570
|
webhook_secret?: string;
|
|
4380
4571
|
metadata?: components["schemas"]["Metadata"];
|
|
4381
4572
|
};
|
|
@@ -4385,6 +4576,10 @@ export interface operations {
|
|
|
4385
4576
|
/** @description Bulk job accepted. */
|
|
4386
4577
|
202: {
|
|
4387
4578
|
headers: {
|
|
4579
|
+
"X-Quota-Limit": components["headers"]["XQuotaLimit"];
|
|
4580
|
+
"X-Quota-Used": components["headers"]["XQuotaUsed"];
|
|
4581
|
+
"X-Quota-Remaining": components["headers"]["XQuotaRemaining"];
|
|
4582
|
+
"X-Quota-Reset": components["headers"]["XQuotaReset"];
|
|
4388
4583
|
[name: string]: unknown;
|
|
4389
4584
|
};
|
|
4390
4585
|
content: {
|
|
@@ -4428,6 +4623,7 @@ export interface operations {
|
|
|
4428
4623
|
"application/json": components["schemas"]["Error"];
|
|
4429
4624
|
};
|
|
4430
4625
|
};
|
|
4626
|
+
402: components["responses"]["PaymentRequired"];
|
|
4431
4627
|
/**
|
|
4432
4628
|
* @description Validation error. `bulk_too_large` is returned when the item count
|
|
4433
4629
|
* exceeds the account plan's `max_bulk_size` cap (also surfaced as
|
|
@@ -4491,6 +4687,38 @@ export interface operations {
|
|
|
4491
4687
|
};
|
|
4492
4688
|
};
|
|
4493
4689
|
};
|
|
4690
|
+
/**
|
|
4691
|
+
* @description Bulk job still processing. `routes/bulk.ts` ends the poll handler with
|
|
4692
|
+
* `status: isTerminal ? 200 : 202` over an identical body, so this is the
|
|
4693
|
+
* SAME envelope the 200 documents — only the status code and the reachable
|
|
4694
|
+
* `status` values differ. Keep polling until you get a 200 (issue #3533).
|
|
4695
|
+
*/
|
|
4696
|
+
202: {
|
|
4697
|
+
headers: {
|
|
4698
|
+
[name: string]: unknown;
|
|
4699
|
+
};
|
|
4700
|
+
content: {
|
|
4701
|
+
"application/json": {
|
|
4702
|
+
/** @example bulk_01j9abc123 */
|
|
4703
|
+
id: string;
|
|
4704
|
+
/** @enum {string} */
|
|
4705
|
+
status: "processing";
|
|
4706
|
+
total: number;
|
|
4707
|
+
completed: number;
|
|
4708
|
+
failed: number;
|
|
4709
|
+
/** Format: date-time */
|
|
4710
|
+
created_at: string;
|
|
4711
|
+
/** Format: date-time */
|
|
4712
|
+
completed_at: string | null;
|
|
4713
|
+
/** @description Total credits billed for the job. Null until the job is billed. Fractional — credits are NUMERIC(10,2). */
|
|
4714
|
+
total_credits_charged: number | null;
|
|
4715
|
+
/** @description Null in GET responses (computed at submission time only). */
|
|
4716
|
+
estimated_credits: number | null;
|
|
4717
|
+
/** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
|
|
4718
|
+
webhook_url: string;
|
|
4719
|
+
};
|
|
4720
|
+
};
|
|
4721
|
+
};
|
|
4494
4722
|
/** @description Resource not found. */
|
|
4495
4723
|
404: {
|
|
4496
4724
|
headers: {
|
|
@@ -4915,6 +5143,7 @@ export interface operations {
|
|
|
4915
5143
|
"application/json": components["schemas"]["Error"];
|
|
4916
5144
|
};
|
|
4917
5145
|
};
|
|
5146
|
+
402: components["responses"]["PaymentRequired"];
|
|
4918
5147
|
/** @description Validation error. */
|
|
4919
5148
|
422: {
|
|
4920
5149
|
headers: {
|
|
@@ -5119,15 +5348,7 @@ export interface operations {
|
|
|
5119
5348
|
"application/json": components["schemas"]["Error"];
|
|
5120
5349
|
};
|
|
5121
5350
|
};
|
|
5122
|
-
|
|
5123
|
-
402: {
|
|
5124
|
-
headers: {
|
|
5125
|
-
[name: string]: unknown;
|
|
5126
|
-
};
|
|
5127
|
-
content: {
|
|
5128
|
-
"application/json": components["schemas"]["Error"];
|
|
5129
|
-
};
|
|
5130
|
-
};
|
|
5351
|
+
402: components["responses"]["PaymentRequired"];
|
|
5131
5352
|
/** @description Rate limit exceeded (`rate_limited`). Carries the `X-RateLimit-Limit`/`X-RateLimit-Remaining`/`X-RateLimit-Reset` triplet and a `Retry-After` header. The window is per-second for a bearer API key, or the 60-request/60-second Clerk session window when authenticated via `resolveDualAuth` — `Retry-After` reflects whichever window applies to the request. */
|
|
5132
5353
|
429: {
|
|
5133
5354
|
headers: {
|
|
@@ -5289,15 +5510,7 @@ export interface operations {
|
|
|
5289
5510
|
"application/json": components["schemas"]["Error"];
|
|
5290
5511
|
};
|
|
5291
5512
|
};
|
|
5292
|
-
|
|
5293
|
-
402: {
|
|
5294
|
-
headers: {
|
|
5295
|
-
[name: string]: unknown;
|
|
5296
|
-
};
|
|
5297
|
-
content: {
|
|
5298
|
-
"application/json": components["schemas"]["Error"];
|
|
5299
|
-
};
|
|
5300
|
-
};
|
|
5513
|
+
402: components["responses"]["PaymentRequired"];
|
|
5301
5514
|
/** @description Endpoint not available (feature flag disabled). */
|
|
5302
5515
|
404: {
|
|
5303
5516
|
headers: {
|
|
@@ -5398,7 +5611,7 @@ export interface operations {
|
|
|
5398
5611
|
plan_type: "payg" | "subscription";
|
|
5399
5612
|
/** @description Total top-up spend in cents for this billing period. Present only in dual/bytes billing mode. */
|
|
5400
5613
|
topup_spent_cents?: number;
|
|
5401
|
-
/** @description Remaining top-up bytes
|
|
5614
|
+
/** @description Remaining purchased top-up bytes, already net of any overage consumed against them. Equal to topup_bytes. Present only in dual/bytes billing mode. */
|
|
5402
5615
|
topup_balance_bytes?: number;
|
|
5403
5616
|
/** @description Days elapsed since period_start. */
|
|
5404
5617
|
period_days_elapsed: number;
|
|
@@ -5408,9 +5621,13 @@ export interface operations {
|
|
|
5408
5621
|
bytes_bulk: number;
|
|
5409
5622
|
bytes_scrape: number;
|
|
5410
5623
|
bytes_monitor: number;
|
|
5624
|
+
/** @description The spendable byte budget for this period, summed over the account's value lots: the allowance granted for the current period, plus unspent allowance carried over from earlier periods, plus purchased top-up and starter-grant bytes. Carried-over value is spent first, so this figure falls as it is consumed. */
|
|
5411
5625
|
bytes_limit: number;
|
|
5626
|
+
/** @description Bytes still available across every active lot, after active refund reservations. */
|
|
5412
5627
|
bytes_remaining: number;
|
|
5628
|
+
/** @description Unspent allowance carried over from earlier billing periods. */
|
|
5413
5629
|
rollover_bytes: number;
|
|
5630
|
+
/** @description Bytes remaining in purchased top-up and starter-grant lots. Subscription allowance is excluded. */
|
|
5414
5631
|
topup_bytes: number;
|
|
5415
5632
|
/** @description Total API requests in the current billing period. */
|
|
5416
5633
|
request_count: number;
|
|
@@ -5524,7 +5741,7 @@ export interface operations {
|
|
|
5524
5741
|
endpoint: "screenshots" | "recordings" | "scrape" | "scrape_md" | "fetch" | "fetch_md" | "crawl" | "crawl_links" | "sitemap" | "monitors";
|
|
5525
5742
|
/** @description Raw upstream wire bytes for the endpoint. Screenshot and recording rows created before issue 2179 may reflect legacy billable Phase 1 bytes because exact raw totals cannot be recovered after per-job rounding. */
|
|
5526
5743
|
raw_bytes: number;
|
|
5527
|
-
/** @description Billing multiplier applied to raw bytes
|
|
5744
|
+
/** @description Billing multiplier applied to raw bytes, enumerated for every `endpoint` value above — there is no catch-all default: 1.5 for `screenshots`, `recordings`, `scrape_md`, `fetch_md` and `crawl`; 1.0 for `scrape`, `fetch`, `crawl_links`, `sitemap` and `monitors`. Requesting Markdown output moves a request from the plain endpoint key to its `_md` key, so a Markdown scrape AND a Markdown fetch both bill at 1.5× (#3779). Source of truth: `ENDPOINT_BILLING_MULTIPLIER` in packages/scrape-shared/src/billing-multipliers.ts. */
|
|
5528
5745
|
multiplier: number;
|
|
5529
5746
|
/** @description raw_bytes × multiplier, rounded. */
|
|
5530
5747
|
billable_bytes: number;
|
|
@@ -6028,7 +6245,7 @@ export interface operations {
|
|
|
6028
6245
|
/** @description Whether the authenticated account's plan supports bandwidth top-up purchases. False for free and PAYG plans. The frontend should disable or hide the Buy Bandwidth affordance when this is false. */
|
|
6029
6246
|
available: boolean;
|
|
6030
6247
|
};
|
|
6031
|
-
/** @description The
|
|
6248
|
+
/** @description The bandwidth allotment configured on the account's current plan (before any rollover or top-up bytes). Use this value instead of computing the plan allotment client-side from `limit_bytes - rollover_bytes - topup_bytes`: the allowance actually granted is the lot written when the period's invoice was paid, so the two can differ before the first paid invoice of a plan. */
|
|
6032
6249
|
included_bytes?: number;
|
|
6033
6250
|
/** @description Number of automatic top-up transactions (bandwidth and credit) that have been triggered in the current calendar month. Includes both pending and completed transactions. */
|
|
6034
6251
|
triggers_this_month?: number;
|
|
@@ -29,7 +29,7 @@ export type TokenEncoding = 'cl100k_base' | 'o200k_base';
|
|
|
29
29
|
/** Options for POST /v1/scrape. */
|
|
30
30
|
export interface ScrapeOpts {
|
|
31
31
|
url: string;
|
|
32
|
-
formats?: Array<'
|
|
32
|
+
formats?: Array<'raw' | 'markdown' | 'links' | 'images'>;
|
|
33
33
|
country?: string;
|
|
34
34
|
delay_ms?: number;
|
|
35
35
|
/** SERVER-side scrape budget in ms — how long the gateway may spend on the scrape itself. For the CLIENT-side abort budget (when this SDK gives up on the wire), see `RequestOptions.requestTimeoutMs`. */
|
|
@@ -65,11 +65,11 @@ export interface ScrapeOpts {
|
|
|
65
65
|
token_encoding?: TokenEncoding;
|
|
66
66
|
/** When true, emulate a mobile device (mobile UA + viewport). Default false (desktop). Part of the cache key, so mobile and desktop responses cache independently. */
|
|
67
67
|
mobile?: boolean;
|
|
68
|
-
/** When true (default), base64-encoded `data:` image sources are stripped before markdown conversion
|
|
68
|
+
/** When true (default), base64-encoded `data:` image sources are stripped before markdown conversion. Set false to preserve them. Does not affect `raw`. */
|
|
69
69
|
remove_base64_images?: boolean;
|
|
70
|
-
/** HTML element names (not CSS selectors) to keep. When non-empty, only content within these elements is included in `
|
|
70
|
+
/** 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`. */
|
|
71
71
|
include_tags?: string[];
|
|
72
|
-
/** HTML element names (not CSS selectors) to strip from `
|
|
72
|
+
/** HTML element names (not CSS selectors) to strip from `markdown` output. Applied after `include_tags`. Does not affect `raw`. */
|
|
73
73
|
exclude_tags?: string[];
|
|
74
74
|
/** 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. */
|
|
75
75
|
clean_markdown?: boolean;
|
package/dist/version.d.ts
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* outbound request carries — see the emit site in `client.ts`. The header name is spelled
|
|
6
6
|
* only there, so issue #2905's pre-merge gate 1 counts exactly one occurrence in `src/`.
|
|
7
7
|
*/
|
|
8
|
-
export declare const SDK_VERSION = "0.9.
|
|
8
|
+
export declare const SDK_VERSION = "0.9.2";
|
package/dist/version.js
CHANGED