@scrapa/sdk 0.3.0 → 0.5.0
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/README.md +52 -2
- package/dist/errors.d.ts +7 -4
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +8 -5
- package/dist/errors.js.map +1 -1
- package/dist/generated/contract.d.ts +114 -17
- package/dist/generated/contract.d.ts.map +1 -1
- package/dist/generated/contract.js +33 -13
- package/dist/generated/contract.js.map +1 -1
- package/dist/generated/operations.d.ts +61 -21
- package/dist/generated/operations.d.ts.map +1 -1
- package/dist/generated/operations.js +73 -19
- package/dist/generated/operations.js.map +1 -1
- package/dist/generated/params.d.ts +493 -61
- package/dist/generated/params.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/errors.ts +11 -7
- package/src/generated/contract.ts +138 -20
- package/src/generated/operations.ts +93 -19
- package/src/generated/params.ts +531 -61
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../src/generated/params.ts"],"names":[],"mappings":"AAMA,gCAAgC;AAChC,MAAM,WAAW,YAAY;IACzB,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAC;IACZ;;;wDAGoD;IACpD,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IACtC;;;uEAGmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;8BAE0B;IAC1B,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACxB;;;;qCAIiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;sCAGkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;qBAKiB;IACjB,OAAO,CAAC,EAAE,CAAC,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,CAAC,EAAE,CAAC;IAChG;;;6FAGyF;I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AAK,CAAC,EAAE,MAAM,CAAC;QACf;;;8DAGsD;QACtD,IAAI,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACL;AAED,uCAAuC;AACvC,MAAM,WAAW,kBAAkB;IAC/B,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,sCAAsC;AACtC,MAAM,WAAW,gBAAgB;IAC7B,+CAA+C;IAC/C,EAAE,EAAE,MAAM,CAAC;CACd;AAED,wCAAwC;AACxC,MAAM,WAAW,kBAAkB;IAC/B,+CAA+C;IAC/C,EAAE,EAAE,MAAM,CAAC;CACd"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrapa/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Official TypeScript client for scrapa.app. Scrape any web page as markdown, HTML, text, links, a screenshot or a PDF, search the web, and drive a real browser over CDP.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://scrapa.app",
|
package/src/errors.ts
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
//
|
|
3
3
|
// The API answers a refusal with a machine-readable code, and acting on the code is the
|
|
4
4
|
// whole point: it says WHO said no, which is what decides the caller's next move. The site
|
|
5
|
-
// blocked the page (try another engine, pool or country),
|
|
6
|
-
// (retrying cannot help), a limit needs waiting out,
|
|
7
|
-
// refunded). Collapse that into `Error("Request failed")`
|
|
5
|
+
// blocked the page (try another engine, pool or country), time ran out (send a larger
|
|
6
|
+
// `timeoutMs`), our policy refused the URL (retrying cannot help), a limit needs waiting out,
|
|
7
|
+
// or we broke it (retry as-is, it was refunded). Collapse that into `Error("Request failed")`
|
|
8
|
+
// and the caller is left guessing.
|
|
8
9
|
import { HEADERS, OUTCOME_OF, type ErrorCode } from "./generated/contract.ts";
|
|
9
10
|
import { retryAfterSecs } from "./generated/retry.ts";
|
|
10
11
|
import type { Failure } from "./generated/transport.ts";
|
|
@@ -28,8 +29,9 @@ export interface ScrapaErrorInit {
|
|
|
28
29
|
requestId?: string;
|
|
29
30
|
/** The call may have run, and been charged, though no answer from the API says so. */
|
|
30
31
|
mayHaveRun?: boolean;
|
|
31
|
-
/** What this call cost. Zero on
|
|
32
|
-
*
|
|
32
|
+
/** What this call cost. Zero on a refusal, except one your own `browser.actions` script
|
|
33
|
+
* could have caused once it started: that one keeps the browser price and its bandwidth
|
|
34
|
+
* (https://docs.scrapa.app/en/guides/credits lists which). A 5xx is always refunded. */
|
|
33
35
|
cost?: number;
|
|
34
36
|
creditsRemaining?: number;
|
|
35
37
|
cause?: unknown;
|
|
@@ -71,8 +73,10 @@ export class ScrapaError extends Error {
|
|
|
71
73
|
/**
|
|
72
74
|
* Who said no — the one thing that decides what to do next.
|
|
73
75
|
*
|
|
74
|
-
* "blocked" the site refused the page. It cost you nothing
|
|
75
|
-
*
|
|
76
|
+
* "blocked" the site refused the page. It cost you nothing, unless your own
|
|
77
|
+
* `browser.actions` script ran in the page first. Try another engine, pool
|
|
78
|
+
* or country. The same call again will be refused again. One code here is
|
|
79
|
+
* not a refusal: on NAV_TIMEOUT time ran out, so send a larger `timeoutMs`.
|
|
76
80
|
* "denied" our policy refused this URL (a private address, the acceptable-use list).
|
|
77
81
|
* Retrying cannot help; change the URL.
|
|
78
82
|
* "broken" we broke it, and already refunded it. Worth one retry as-is.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// GENERATED FILE — do not edit. Run `bun run sdk:gen`.
|
|
2
|
-
// Source: packages/shared/src/http/index.ts, packages/shared/src/locale/index.ts, packages/shared/src/enums/index.ts, packages/shared/src/billing/catalog.ts, packages/shared/src/dto/account.ts, packages/shared/src/dto/scrape.ts, packages/shared/src/dto/batch.ts, packages/shared/src/dto/search.ts, packages/shared/src/dto/sessions.ts, packages/shared/src/dto/usage.ts
|
|
2
|
+
// Source: packages/shared/src/http/index.ts, packages/shared/src/locale/index.ts, packages/shared/src/enums/index.ts, packages/shared/src/billing/catalog.ts, packages/shared/src/dto/account.ts, packages/shared/src/dto/scrape.ts, packages/shared/src/dto/batch.ts, packages/shared/src/dto/map.ts, packages/shared/src/dto/search.ts, packages/shared/src/dto/sessions.ts, packages/shared/src/dto/usage.ts
|
|
3
3
|
//
|
|
4
4
|
// The shapes the API speaks, lifted from the server's own contract.
|
|
5
5
|
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
* locale catalogs, exhaustiveness checks).
|
|
12
12
|
*
|
|
13
13
|
* THE WHOSE-FAULT VOCABULARY (DESIGN.md) is the organising principle: a caller's next move
|
|
14
|
-
* depends entirely on who said no, so the code says. `UPSTREAM_BLOCKED`
|
|
15
|
-
*
|
|
14
|
+
* depends entirely on who said no, so the code says. `UPSTREAM_BLOCKED` is "the site said no"
|
|
15
|
+
* (retry differently — another engine, pool or country), and `NAV_TIMEOUT` shares its hue under
|
|
16
|
+
* its own word, "time ran out" (give it more time; see `OWN_WORD`); `SSRF_DENIED` /
|
|
16
17
|
* `AUP_DENIED` are "our policy said no" (retrying cannot help, change the URL); a 5xx is
|
|
17
18
|
* "we broke it" (retry as-is, already refunded).
|
|
18
19
|
*/
|
|
@@ -35,19 +36,31 @@ export const ERROR_CODES = [
|
|
|
35
36
|
"CONFLICT", // 409 — e.g. the api-key name cap race
|
|
36
37
|
"PAYLOAD_TOO_LARGE", // 413 — the request body is over the surface's limit
|
|
37
38
|
// ── 422: the request was fine, the WEB did not cooperate. Deliberately 4xx, not 5xx:
|
|
38
|
-
// "5xx is reserved for what we broke" (AGENTS.md), and these cost the caller nothing
|
|
39
|
-
//
|
|
39
|
+
// "5xx is reserved for what we broke" (AGENTS.md), and these cost the caller nothing
|
|
40
|
+
// unless their own `browser.actions` script ran in the page first (OUTCOME_OF). 422
|
|
41
|
+
// also tells an HTTP client the truth: replaying the identical request gets the
|
|
40
42
|
// identical refusal, so the fix is a different engine/pool/country, not a retry.
|
|
41
43
|
"UPSTREAM_BLOCKED", // 422 — an anti-bot wall, a captcha, a hard 403 from the target
|
|
42
44
|
"NAV_TIMEOUT", // 422 — the page never reached a usable state inside the budget
|
|
43
45
|
// The exit proxy would not place the call, so the site never saw it: YOUR proxy refused
|
|
44
46
|
// or did not answer, or the managed pool has no exit in the place you asked for. Free,
|
|
45
|
-
//
|
|
47
|
+
// except your own proxy's refusal once your own `browser.actions` script ran. No colour:
|
|
48
|
+
// the fix is in the request (the proxy, the credentials, a wider place).
|
|
46
49
|
"PROXY_REFUSED", // 422 — details {reason: "no_exit" | "refused" | "unreachable", place?, status?}
|
|
47
50
|
// The site sent a file bigger than `raw` hands back whole. Not 413, which tells an HTTP
|
|
48
51
|
// client its OWN request was too big. Free, and no colour, for PROXY_REFUSED's reason:
|
|
49
52
|
// the fix is in the request (another format, or download it yourself), not another road.
|
|
50
53
|
"FILE_TOO_LARGE", // 422 — details {limit}, in bytes
|
|
54
|
+
// A PDF or a Word file arrived whole, and reading it into text took longer than the time
|
|
55
|
+
// the call had left, or than the most one file may read. Free, and no colour: the site
|
|
56
|
+
// answered in full, so another engine, pool or country reads the same file just as
|
|
57
|
+
// slowly. The fix is "raw" and reading it yourself, or a smaller file.
|
|
58
|
+
"DOCUMENT_TIMEOUT", // 422: details {budgetMs, readMaxMs}: the call's timeout, and the most one file may read
|
|
59
|
+
// One of the caller's `browser.actions` steps did not work on the page: a selector that
|
|
60
|
+
// matched nothing, a key Chrome does not know, a script that threw. Free unless one of the
|
|
61
|
+
// caller's scripts ran (their code read the page), and no colour, for PROXY_REFUSED's
|
|
62
|
+
// reason: the page answered, and the fix is in the step, not the road.
|
|
63
|
+
"ACTION_FAILED", // 422: details {index, type, reason}, index counting from 0
|
|
51
64
|
"RATE_LIMIT_EXCEEDED", // 429 — the per-minute burst bucket; Retry-After + details {limit}
|
|
52
65
|
"QUOTA_EXCEEDED", // 429 — a durable bound that WAITING clears; details {scope, limit, resetAt}
|
|
53
66
|
"INTERNAL_ERROR", // 500 — we broke it; the body is always generic, the cause stays server-side
|
|
@@ -76,6 +89,8 @@ export const ERROR_STATUS = {
|
|
|
76
89
|
NAV_TIMEOUT: 422,
|
|
77
90
|
PROXY_REFUSED: 422,
|
|
78
91
|
FILE_TOO_LARGE: 422,
|
|
92
|
+
DOCUMENT_TIMEOUT: 422,
|
|
93
|
+
ACTION_FAILED: 422,
|
|
79
94
|
RATE_LIMIT_EXCEEDED: 429,
|
|
80
95
|
QUOTA_EXCEEDED: 429,
|
|
81
96
|
INTERNAL_ERROR: 500,
|
|
@@ -84,11 +99,15 @@ export const ERROR_STATUS = {
|
|
|
84
99
|
} as const satisfies Record<ErrorCode, number>;
|
|
85
100
|
|
|
86
101
|
/**
|
|
87
|
-
* The three
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
102
|
+
* The three outcomes that get a colour, as DESIGN.md names them. Each code here maps to
|
|
103
|
+
* exactly one, and the SDK's `outcome` reads this map to tell a caller what to do next. A code
|
|
104
|
+
* absent from here gets no colour: the caller's own mistake (a bad body, a missing key), or a
|
|
105
|
+
* refusal whose fix is in the request rather than the site (PROXY_REFUSED, FILE_TOO_LARGE,
|
|
106
|
+
* DOCUMENT_TIMEOUT, ACTION_FAILED).
|
|
107
|
+
*
|
|
108
|
+
* Every one of these refusals is free, unless the caller's own `browser.actions` script ran
|
|
109
|
+
* in the page first: then a refusal the script could have caused keeps the browser price and
|
|
110
|
+
* its bandwidth (https://docs.scrapa.app/en/guides/credits lists which). `broken` is always refunded.
|
|
92
111
|
*
|
|
93
112
|
* blocked → the site said no → try another engine, pool or country
|
|
94
113
|
* denied → our policy said no → change the URL; retrying cannot help
|
|
@@ -211,8 +230,9 @@ export const SESSION_STATUSES = ["starting", "live", "closed", "expired", "faile
|
|
|
211
230
|
export type SessionStatus = (typeof SESSION_STATUSES)[number];
|
|
212
231
|
|
|
213
232
|
/** What a search is looking for. `general` is the web; `news` is dated journalism — a
|
|
214
|
-
* different door at every engine, and the only one that reliably carries a date
|
|
215
|
-
|
|
233
|
+
* different door at every engine, and the only one that reliably carries a date; `images`
|
|
234
|
+
* is pictures, each tied to the page that holds it. */
|
|
235
|
+
export const SEARCH_TOPICS = ["general", "news", "images"] as const;
|
|
216
236
|
|
|
217
237
|
export type SearchTopic = (typeof SEARCH_TOPICS)[number];
|
|
218
238
|
|
|
@@ -222,6 +242,9 @@ export const SEARCH_ENGINES = ["bing", "brave", "duckduckgo"] as const;
|
|
|
222
242
|
|
|
223
243
|
export type SearchEngine = (typeof SEARCH_ENGINES)[number];
|
|
224
244
|
|
|
245
|
+
/** Where a map's URLs came from. With none found, the sources that were read. */
|
|
246
|
+
export type MapSource = "sitemap" | "links" | "both";
|
|
247
|
+
|
|
225
248
|
/** A batch's life. `queued` is accepted but not yet picked up; `running` has at least one
|
|
226
249
|
* item in flight. The three end states answer the same question the session statuses do —
|
|
227
250
|
* who ended it: `completed` ran every item to a verdict (some of which may be failures,
|
|
@@ -283,6 +306,12 @@ export interface ScrapeMetadataDto {
|
|
|
283
306
|
* it so a caller can retry with `engine: "browser"` instead of trusting an empty page.
|
|
284
307
|
* Always false from the browser engine, which ran the scripts. */
|
|
285
308
|
needsJs: boolean;
|
|
309
|
+
/** How many pages the PDF has, when a PDF was read into text. Absent for anything else,
|
|
310
|
+
* and when only "raw" was asked for. */
|
|
311
|
+
pages?: number;
|
|
312
|
+
/** True when we read only part of the PDF: its first 200 pages, or its first 5 million
|
|
313
|
+
* characters of text, are in the answer and the rest is not. Absent otherwise. */
|
|
314
|
+
truncated?: boolean;
|
|
286
315
|
}
|
|
287
316
|
|
|
288
317
|
/** A file, exactly as the site sent it. */
|
|
@@ -293,6 +322,28 @@ export interface ScrapeRawDto {
|
|
|
293
322
|
contentType: string | null;
|
|
294
323
|
}
|
|
295
324
|
|
|
325
|
+
/** The page's address and HTML at the moment a `scrape` step ran. */
|
|
326
|
+
export interface ScrapeActionPageDto {
|
|
327
|
+
url: string;
|
|
328
|
+
html: string;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/** What a script returned, as JSON. */
|
|
332
|
+
export interface ScrapeActionReturnDto {
|
|
333
|
+
/** null when the script returned nothing, or something JSON cannot hold. */
|
|
334
|
+
value: unknown;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/** What the `browser.actions` steps kept along the way, each list in the order its steps ran. */
|
|
338
|
+
export interface ScrapeActionsDto {
|
|
339
|
+
/** One base64 PNG per `screenshot` step. */
|
|
340
|
+
screenshots: string[];
|
|
341
|
+
/** One per `scrape` step. */
|
|
342
|
+
scrapes: ScrapeActionPageDto[];
|
|
343
|
+
/** One per `executeJavascript` step. */
|
|
344
|
+
javascriptReturns: ScrapeActionReturnDto[];
|
|
345
|
+
}
|
|
346
|
+
|
|
296
347
|
/** `POST /v1/scrape`'s answer. Only the requested formats are present; everything else is
|
|
297
348
|
* always there. Artifacts (`screenshot`, `pdf`) are base64 in v1. */
|
|
298
349
|
export interface ScrapeResultDto {
|
|
@@ -317,6 +368,12 @@ export interface ScrapeResultDto {
|
|
|
317
368
|
* `fetch`: the body, decompressed — what the caller received. `browser`: every response
|
|
318
369
|
* the page pulled, as carried on the wire. An `auto` call that escalated counts both. */
|
|
319
370
|
bytes: number;
|
|
371
|
+
/** True when this answer is a copy of the page we read for your account earlier, because
|
|
372
|
+
* you sent `maxAge`. The page then costs 0 credits and carries no bandwidth; `extract` on
|
|
373
|
+
* it is still charged. */
|
|
374
|
+
cached: boolean;
|
|
375
|
+
/** When the copy was read, ISO 8601. Present only when `cached` is true. */
|
|
376
|
+
cachedAt?: string;
|
|
320
377
|
markdown?: string;
|
|
321
378
|
html?: string;
|
|
322
379
|
text?: string;
|
|
@@ -330,6 +387,9 @@ export interface ScrapeResultDto {
|
|
|
330
387
|
* could not answer — that credit is handed back and the page still stands. Present only
|
|
331
388
|
* when `extract` was in `formats`. */
|
|
332
389
|
extract?: Record<string, unknown> | null;
|
|
390
|
+
/** What the `browser.actions` steps kept. Present only when the request sent steps; the
|
|
391
|
+
* formats above read the page as the last step left it. */
|
|
392
|
+
actions?: ScrapeActionsDto;
|
|
333
393
|
metadata: ScrapeMetadataDto;
|
|
334
394
|
}
|
|
335
395
|
|
|
@@ -356,8 +416,9 @@ export interface ScrapeQuoteDto {
|
|
|
356
416
|
*
|
|
357
417
|
* The rule that shapes everything here is that **a batch is N scrapes and nothing more**.
|
|
358
418
|
* Each item is charged exactly what the same call would have cost synchronously, on the
|
|
359
|
-
* same terms
|
|
360
|
-
*
|
|
419
|
+
* same terms (a blocked page is free inside a batch too, unless the caller's own
|
|
420
|
+
* `browser.actions` script ran in it first), so there is no batch price, no discount and no
|
|
421
|
+
* surcharge to reason about. What the caller buys is not having to hold a
|
|
361
422
|
* connection open for an hour.
|
|
362
423
|
*
|
|
363
424
|
* `cost` and `bytes` therefore GROW while the batch runs. They are what it has spent so
|
|
@@ -375,7 +436,8 @@ export interface BatchDto {
|
|
|
375
436
|
completed: number;
|
|
376
437
|
/** Of those, how many the web or our policy refused. A `failed` count equal to `total`
|
|
377
438
|
* is still a `completed` batch: every URL got a verdict, and the verdicts were
|
|
378
|
-
* refusals. Free ones
|
|
439
|
+
* refusals. Free ones: a blocked page costs nothing here too, unless the caller's own
|
|
440
|
+
* `browser.actions` script ran in it first. */
|
|
379
441
|
failed: number;
|
|
380
442
|
/** Of those, how many were never attempted — the batch was cancelled, the month's
|
|
381
443
|
* credits ran out under it, or we could not finish it. Counted APART from `failed`
|
|
@@ -438,13 +500,15 @@ export interface BatchWebhookDto {
|
|
|
438
500
|
attempts: number;
|
|
439
501
|
}
|
|
440
502
|
|
|
441
|
-
/** `POST /v1/batches/quote
|
|
442
|
-
* synchronous call would be, so this is `total` × that
|
|
443
|
-
*
|
|
503
|
+
/** `POST /v1/batches/quote`: the ceiling, not a bill. Every item is priced as the same
|
|
504
|
+
* synchronous call would be, so this is `total` × that. The real cost is lower by every page
|
|
505
|
+
* that never needed a browser, and by the outcomes that cost nothing: a page the site blocked
|
|
506
|
+
* or our policy refused (unless the item's own `browser.actions` script ran in it first) and
|
|
507
|
+
* anything we broke. */
|
|
444
508
|
export interface BatchQuoteDto {
|
|
445
509
|
total: number;
|
|
446
510
|
pool: ProxyPool;
|
|
447
|
-
/** What one item would cost at most
|
|
511
|
+
/** What one item would cost at most: the browser row for `auto`, since that is the
|
|
448
512
|
* ceiling a page can escalate to. */
|
|
449
513
|
perItemMaxCost: number;
|
|
450
514
|
/** `total` × `perItemMaxCost`. Bandwidth is on top and cannot be quoted: it depends on
|
|
@@ -468,14 +532,66 @@ export interface CreatedBatchDto extends BatchDto {
|
|
|
468
532
|
* delivery somebody copied can be sent to you again. */
|
|
469
533
|
webhookSecret?: string;
|
|
470
534
|
}
|
|
535
|
+
// ── from packages/shared/src/dto/map.ts ──────────────────────────────
|
|
536
|
+
|
|
537
|
+
/** One URL a site lists, normalised: no fragment, no `utm_*` parameters, the query sorted,
|
|
538
|
+
* no trailing slash. */
|
|
539
|
+
export interface MapUrlDto {
|
|
540
|
+
url: string;
|
|
541
|
+
/** When the sitemap says the page last changed, as the sitemap wrote it (a W3C date, often
|
|
542
|
+
* just the day). Absent when it did not say, or when the URL came from the page's links. */
|
|
543
|
+
lastmod?: string;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/** `POST /v1/map`'s answer. */
|
|
547
|
+
export interface MapResultDto {
|
|
548
|
+
/** Every URL found, once each, sitemap URLs first in the order the site listed them. */
|
|
549
|
+
urls: MapUrlDto[];
|
|
550
|
+
/** Where they came from. With none found, the sources that were read. */
|
|
551
|
+
source: MapSource;
|
|
552
|
+
/** True when the site may list more than this answer holds: `limit` cut the list, or the
|
|
553
|
+
* robots.txt or a sitemap was not read to its end (the site refused it, its size, the
|
|
554
|
+
* 25-document cap, the time limit, or our own proxy failing, in which case the map is
|
|
555
|
+
* free and these are the URLs found before it). */
|
|
556
|
+
truncated: boolean;
|
|
557
|
+
pool: ProxyPool;
|
|
558
|
+
/** What the managed pool carried for every document the map read, decompressed. The
|
|
559
|
+
* first megabyte is free; past it, bandwidth is metered like any request's. */
|
|
560
|
+
bytes: number;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/** What a map would cost, without making it. */
|
|
564
|
+
export interface MapQuoteDto {
|
|
565
|
+
pool: ProxyPool;
|
|
566
|
+
/** Credits a map charges, whatever it finds. */
|
|
567
|
+
cost: number;
|
|
568
|
+
/** Managed-pool megabytes included before `perMb` applies. 0 on BYO. */
|
|
569
|
+
freeMb: number;
|
|
570
|
+
/** Credits per additional megabyte through the managed pool. 0 on BYO. */
|
|
571
|
+
perMb: number;
|
|
572
|
+
}
|
|
471
573
|
// ── from packages/shared/src/dto/search.ts ───────────────────────────
|
|
472
574
|
|
|
575
|
+
/** The picture behind a hit on the `images` topic. */
|
|
576
|
+
export interface SearchImageDto {
|
|
577
|
+
/** The picture itself, on the site that hosts it. It can be gone, or refuse a download
|
|
578
|
+
* that does not come from a browser: the thumbnail is the one that always loads. */
|
|
579
|
+
url: string;
|
|
580
|
+
/** A small copy the engine keeps, safe to show in a page. */
|
|
581
|
+
thumbnailUrl: string;
|
|
582
|
+
/** Pixels of the original, as the engine reported them. Null when it did not say. */
|
|
583
|
+
width: number | null;
|
|
584
|
+
height: number | null;
|
|
585
|
+
}
|
|
586
|
+
|
|
473
587
|
/** One hit, as the index ranked it. The array's ORDER is the ranking — there is no score,
|
|
474
588
|
* because no engine we read publishes one and a rank-derived float would be a made-up
|
|
475
589
|
* number in a public contract. */
|
|
476
590
|
export interface SearchHitDto {
|
|
477
591
|
/** 1-based rank within this answer. */
|
|
478
592
|
position: number;
|
|
593
|
+
/** The page. On the `images` topic it is the page that shows the picture, never the
|
|
594
|
+
* picture's own address: that is `image.url`. */
|
|
479
595
|
url: string;
|
|
480
596
|
title: string;
|
|
481
597
|
/** The engine's own summary of the page, a couple of lines. Never the page itself —
|
|
@@ -484,6 +600,8 @@ export interface SearchHitDto {
|
|
|
484
600
|
/** When the engine dated it, ISO 8601. Null whenever it did not, which on the general
|
|
485
601
|
* topic is most of the time — never guessed from the snippet. */
|
|
486
602
|
publishedAt: string | null;
|
|
603
|
+
/** The picture, on the `images` topic. Null on every other topic. */
|
|
604
|
+
image: SearchImageDto | null;
|
|
487
605
|
}
|
|
488
606
|
|
|
489
607
|
/** `POST /v1/search`'s answer. */
|
|
@@ -10,6 +10,8 @@ import type {
|
|
|
10
10
|
BatchQuoteDto,
|
|
11
11
|
CreatedBatchDto,
|
|
12
12
|
LiveSessionDto,
|
|
13
|
+
MapQuoteDto,
|
|
14
|
+
MapResultDto,
|
|
13
15
|
ScrapeQuoteDto,
|
|
14
16
|
ScrapeResultDto,
|
|
15
17
|
SearchResultDto,
|
|
@@ -26,7 +28,9 @@ import type {
|
|
|
26
28
|
GetSessionParams,
|
|
27
29
|
ListBatchesParams,
|
|
28
30
|
ListSessionsParams,
|
|
31
|
+
MapSiteParams,
|
|
29
32
|
QuoteBatchParams,
|
|
33
|
+
QuoteMapParams,
|
|
30
34
|
QuoteScrapeParams,
|
|
31
35
|
QuoteSessionParams,
|
|
32
36
|
ScrapeParams,
|
|
@@ -34,7 +38,7 @@ import type {
|
|
|
34
38
|
} from "./params.ts";
|
|
35
39
|
|
|
36
40
|
/** The version this client reports in `x-scrapa-client`. */
|
|
37
|
-
export const SDK_VERSION = "0.
|
|
41
|
+
export const SDK_VERSION = "0.5.0";
|
|
38
42
|
|
|
39
43
|
/** The hosted API. */
|
|
40
44
|
export const DEFAULT_BASE_URL = "https://api.scrapa.app/v1";
|
|
@@ -54,14 +58,19 @@ export abstract class GeneratedOperations {
|
|
|
54
58
|
* makes a plain HTTP request first and re-reads the page in a real Chromium when the body
|
|
55
59
|
* turns out to be a JavaScript shell, so you pay for a browser only when the page needed one.
|
|
56
60
|
* To send a search form or a JSON query, use `method: "POST"` with a `body`; to download a
|
|
57
|
-
* file exactly as the site sent it, ask for `formats: ["raw"]`.
|
|
58
|
-
*
|
|
59
|
-
*
|
|
61
|
+
* file exactly as the site sent it, ask for `formats: ["raw"]`. A link to a PDF or a Word file
|
|
62
|
+
* is read into text too, headings and paragraphs included. To click a cookie banner, type into
|
|
63
|
+
* a search box or run a script before the page is read, send `browser.actions`. Every request
|
|
64
|
+
* leaves through a residential proxy, or through your own with `proxy: { pool: "custom",
|
|
65
|
+
* server }`. The answer says which engine replied, where the page finally was and what it
|
|
66
|
+
* cost.
|
|
60
67
|
*
|
|
61
68
|
* Credits: 1 credit with the fetch engine, 5 with the browser (a screenshot or a PDF is
|
|
62
69
|
* included, never a surcharge), 5 more when you ask for `extract`, plus managed-proxy
|
|
63
|
-
* bandwidth past the first megabyte. A page the site blocked
|
|
64
|
-
*
|
|
70
|
+
* bandwidth past the first megabyte. A page the site blocked and a URL our policy refused cost
|
|
71
|
+
* nothing, unless your own `browser.actions` script ran in the page first. Anything we broke
|
|
72
|
+
* costs nothing, and neither does a page served from a copy you read earlier (`maxAge`),
|
|
73
|
+
* though `extract` on it is still charged.
|
|
65
74
|
*
|
|
66
75
|
* `POST /v1/scrape`
|
|
67
76
|
*/
|
|
@@ -87,7 +96,8 @@ export abstract class GeneratedOperations {
|
|
|
87
96
|
* What the same request would cost, without making it. Free, and refused by the same guards a
|
|
88
97
|
* real call meets, so a quote is never a price for a call that would be denied. `maxCost` is
|
|
89
98
|
* the ceiling: for `auto` it is the browser's price, which is only charged if the page turns
|
|
90
|
-
* out to need one.
|
|
99
|
+
* out to need one. With `maxAge`, the quote is the price of reading the page now; if a copy is
|
|
100
|
+
* there, the page costs nothing and only `extract` is charged.
|
|
91
101
|
*
|
|
92
102
|
* Credits: 0 credits. Pricing a call is free.
|
|
93
103
|
*
|
|
@@ -109,6 +119,66 @@ export abstract class GeneratedOperations {
|
|
|
109
119
|
);
|
|
110
120
|
}
|
|
111
121
|
|
|
122
|
+
/**
|
|
123
|
+
* List a site's URLs
|
|
124
|
+
*
|
|
125
|
+
* Hand back every URL a site lists, without reading the pages: what its robots.txt and
|
|
126
|
+
* sitemaps name (gzipped ones too, and indexes of sitemaps), plus the links on the page you
|
|
127
|
+
* named. Each URL comes back once, without tracking parameters or a trailing slash, with
|
|
128
|
+
* `lastmod` when the sitemap gives one. Only the host you named is kept unless you set
|
|
129
|
+
* `includeSubdomains`, and `search` keeps the URLs that contain a word. To read a page, pass
|
|
130
|
+
* its URL to `scrape`.
|
|
131
|
+
*
|
|
132
|
+
* Credits: 2 credits, plus managed-proxy bandwidth past the first megabyte, every file the map
|
|
133
|
+
* read counted together. A site that lists nothing is charged, because it answered. A site
|
|
134
|
+
* that refused every file, and anything we broke, cost nothing. When our side fails partway,
|
|
135
|
+
* you still get the URLs found so far, with `truncated: true`.
|
|
136
|
+
*
|
|
137
|
+
* `POST /v1/map`
|
|
138
|
+
*/
|
|
139
|
+
map(
|
|
140
|
+
params: MapSiteParams,
|
|
141
|
+
opts?: Omit<RequestOptions, "idempotencyKey">,
|
|
142
|
+
): Promise<MapResultDto> {
|
|
143
|
+
return this.request(
|
|
144
|
+
{
|
|
145
|
+
method: "POST",
|
|
146
|
+
path: "/map",
|
|
147
|
+
repeatable: false,
|
|
148
|
+
proxy: ["pool", "server", "country"],
|
|
149
|
+
},
|
|
150
|
+
params,
|
|
151
|
+
opts,
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Price a map
|
|
157
|
+
*
|
|
158
|
+
* What the same map would cost, without making it. Free, and refused by the same guards a real
|
|
159
|
+
* call meets. Bandwidth is priced per megabyte because nobody knows a site's sitemap size
|
|
160
|
+
* before reading it.
|
|
161
|
+
*
|
|
162
|
+
* Credits: 0 credits. Pricing a call is free.
|
|
163
|
+
*
|
|
164
|
+
* `POST /v1/map/quote`
|
|
165
|
+
*/
|
|
166
|
+
quoteMap(
|
|
167
|
+
params: QuoteMapParams,
|
|
168
|
+
opts?: Omit<RequestOptions, "idempotencyKey">,
|
|
169
|
+
): Promise<MapQuoteDto> {
|
|
170
|
+
return this.request(
|
|
171
|
+
{
|
|
172
|
+
method: "POST",
|
|
173
|
+
path: "/map/quote",
|
|
174
|
+
repeatable: true,
|
|
175
|
+
proxy: ["pool", "server", "country"],
|
|
176
|
+
},
|
|
177
|
+
params,
|
|
178
|
+
opts,
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
112
182
|
/**
|
|
113
183
|
* Search the web
|
|
114
184
|
*
|
|
@@ -116,9 +186,9 @@ export abstract class GeneratedOperations {
|
|
|
116
186
|
* holds. They are read live off a real search front through a residential exit, never a
|
|
117
187
|
* reseller's cache. `country` picks both the exit and the market, so `br` returns what
|
|
118
188
|
* somebody in Brazil would see. Narrow to your own list of hosts with `includeDomains`, ask
|
|
119
|
-
* for `topic: "news"` when you want dated journalism
|
|
120
|
-
*
|
|
121
|
-
* its URL to `scrape`.
|
|
189
|
+
* for `topic: "news"` when you want dated journalism or `topic: "images"` when you want
|
|
190
|
+
* pictures, and add `answer: true` when you want a paragraph written over the results instead
|
|
191
|
+
* of writing it yourself. To read a result, pass its URL to `scrape`.
|
|
122
192
|
*
|
|
123
193
|
* Credits: 4 credits per 10 results, so a `limit` above 10 costs two rows, plus 1 for `answer:
|
|
124
194
|
* true`. A search every front refused, and anything we broke, cost nothing; a search that ran
|
|
@@ -149,15 +219,17 @@ export abstract class GeneratedOperations {
|
|
|
149
219
|
*
|
|
150
220
|
* Hand us a list of URLs and stop holding a connection open. Every one is read with the
|
|
151
221
|
* options you pass here. It uses the same engines, the same exit and the same meter as a
|
|
152
|
-
* single `scrape`, and a page the site blocked costs nothing here too
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* 24 hours
|
|
222
|
+
* single `scrape`, and a page the site blocked costs nothing here too, unless your own
|
|
223
|
+
* `browser.actions` script ran in the page first. Nothing is charged when you submit: a
|
|
224
|
+
* batch spends as it goes, so use `quote` for the ceiling. Poll `get` for progress, or
|
|
225
|
+
* pass a `webhook` and we will call you instead. Results are readable for 24 hours from
|
|
226
|
+
* when you submit. A batch still running then stops, and the URLs it has not read are
|
|
227
|
+
* `skipped`, free.
|
|
156
228
|
*
|
|
157
229
|
* Credits: Creating a batch is free, and nothing is held: each URL then costs exactly what
|
|
158
230
|
* the same call would have cost on its own, and the pages the web refused cost nothing
|
|
159
|
-
* here too
|
|
160
|
-
* runs.
|
|
231
|
+
* here too, unless your own `browser.actions` script ran in them first. What the batch has
|
|
232
|
+
* spent so far is on the batch itself, and it grows while it runs.
|
|
161
233
|
*
|
|
162
234
|
* `POST /v1/batches`
|
|
163
235
|
*/
|
|
@@ -179,9 +251,11 @@ export abstract class GeneratedOperations {
|
|
|
179
251
|
* Price a batch
|
|
180
252
|
*
|
|
181
253
|
* What that submission would cost at most, without submitting it. `maxCost` prices every
|
|
182
|
-
* URL at the ceiling one page could reach
|
|
183
|
-
*
|
|
184
|
-
*
|
|
254
|
+
* URL at the ceiling one page could reach. The real bill comes in lower by every page that
|
|
255
|
+
* never needed a browser and by every outcome that costs nothing: a page the site blocked
|
|
256
|
+
* or our policy refused (unless your own `browser.actions` script ran in it first) and
|
|
257
|
+
* anything we broke. Bandwidth is on top and cannot be quoted, because it depends on what
|
|
258
|
+
* the pages weigh.
|
|
185
259
|
*
|
|
186
260
|
* Credits: 0 credits. Pricing a batch is free.
|
|
187
261
|
*
|