mcpscraper-sdk 0.55.0 → 0.57.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 +26 -2
- package/dist/index.cjs +11 -0
- package/dist/index.d.cts +420 -85
- package/dist/index.d.ts +420 -85
- package/dist/index.js +11 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Official TypeScript/JavaScript client for the [mcpscraper.dev](https://mcpscraper.dev) REST API — SERP search, People-Also-Ask harvesting, single-page and whole-site extraction, YouTube, Facebook/Google Ads Transparency, Instagram, Reddit, video breakdown, Google Maps, and directory/rank-tracking workflows.
|
|
4
4
|
|
|
5
|
-
[Release history](https://github.com/VilovietaSEO/mcpscraper-sdk/
|
|
5
|
+
[Release history](https://github.com/VilovietaSEO/mcpscraper-sdk/releases/tag/v0.57.0)
|
|
6
6
|
|
|
7
7
|
This is a thin HTTP client generated against [`../../contracts/scraper.openapi.generated.json`](../../contracts/scraper.openapi.generated.json), the complete public REST contract for the hosted API. It contains no scraping, proxy, or billing logic — only typed request/response plumbing.
|
|
8
8
|
|
|
@@ -193,7 +193,7 @@ npm run verify:rest-contract
|
|
|
193
193
|
|
|
194
194
|
Durable PAA harvests should wait at least 20 seconds between status checks and honor a longer returned polling interval. Keep the same job ID and retry key while the original work is running.
|
|
195
195
|
|
|
196
|
-
Release changes: [SDK 0.
|
|
196
|
+
Release changes: [SDK 0.56.0 release notes](https://github.com/VilovietaSEO/mcpscraper-sdk/releases/tag/v0.56.0).
|
|
197
197
|
|
|
198
198
|
## Client attribution and full results
|
|
199
199
|
|
|
@@ -206,3 +206,27 @@ export artifact ID with `artifact_download`, `artifact_read` or `artifact_descri
|
|
|
206
206
|
to generate Markdown from retained JSON without repeating acquisition. The
|
|
207
207
|
[on-demand export example](https://github.com/VilovietaSEO/mcpscraper-sdk/blob/v0.55.0/examples/serp-on-demand-export.mjs)
|
|
208
208
|
shows the complete flow and preserves a retry key for uncertain search responses.
|
|
209
|
+
|
|
210
|
+
## Reddit discovery and known threads
|
|
211
|
+
|
|
212
|
+
Use `reddit_trending` with `window:"year"` to discover past-year search candidates and
|
|
213
|
+
select relevant threads before collecting comments. Set `maxThreads` to bound the
|
|
214
|
+
number selected and `maxCommentsPerThread:20` for a per-thread capture limit.
|
|
215
|
+
Twenty is a request limit; inspect returned coverage because fewer accessible text
|
|
216
|
+
comments can produce a partial result. Publication dates are optional when unknown.
|
|
217
|
+
|
|
218
|
+
Pass a known Reddit thread URL directly to `reddit_thread` with `maxComments:20`;
|
|
219
|
+
it does not require a discovery call first. Trending returns ranked summaries and
|
|
220
|
+
questions; the thread tool returns full comment bodies. Preserve each operation's
|
|
221
|
+
retry key and exact inputs after an uncertain response.
|
|
222
|
+
|
|
223
|
+
The [past-year and direct-thread example](https://github.com/VilovietaSEO/mcpscraper-sdk/blob/v0.56.0/examples/reddit-past-year.mjs)
|
|
224
|
+
shows both paths.
|
|
225
|
+
|
|
226
|
+
## Saved Maps reviews
|
|
227
|
+
|
|
228
|
+
Server 0.100.1 improves Maps discovery, review text and list collection through the existing interfaces. Use the exact name and location returned by discovery. Read the saved run and its review pages before considering a new acquisition. An explicit resume uses a fresh browser and reopens the profile and reviews; it retains saved review IDs. A new resume key authorizes a separately billed attempt, while repeating that key reads the same run.
|
|
229
|
+
|
|
230
|
+
## Bug Reporting
|
|
231
|
+
|
|
232
|
+
Use `bug_reporting` to prepare a redacted draft from observed calls and errors. Review the returned report, then submit its exact `reportId` and `reviewToken` only when the user requests submission. Status returns the private receipt. The support team receives the report and verified account email. Drafts expire after one day; submitted reports after 365 days. See [the complete workflow](https://github.com/VilovietaSEO/mcpscraper-sdk/blob/v0.57.0/examples/bug-reporting.mjs) and [release history](https://github.com/VilovietaSEO/mcpscraper-sdk/releases/tag/v0.57.0).
|
package/dist/index.cjs
CHANGED
|
@@ -673,6 +673,17 @@ var ScraperClient = class {
|
|
|
673
673
|
options
|
|
674
674
|
);
|
|
675
675
|
}
|
|
676
|
+
async bugReporting(params, options = {}) {
|
|
677
|
+
try {
|
|
678
|
+
return await this.r.call("POST", "/bugs/report", params, {}, options);
|
|
679
|
+
} catch (error) {
|
|
680
|
+
if (error instanceof ScraperApiError && error.code === "mcp_request_timeout") {
|
|
681
|
+
const message = params.action === "prepare" || params.action === void 0 ? "Draft preparation was not confirmed. An unreturned draft expires after one day; prepare never submits a report." : "Submission was not confirmed. Read status with the same reportId, then retry submit with the same reportId and reviewToken if needed. Bug Reporting is free.";
|
|
682
|
+
throw new ScraperApiError(408, { error_code: "mcp_request_timeout", error_type: "timeout", message, retryable: true, charge_status: "not_charged" }, { requestId: error.requestId });
|
|
683
|
+
}
|
|
684
|
+
throw error;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
676
687
|
searchSerp(params, options = {}) {
|
|
677
688
|
return this.r.call("POST", "/harvest/sync", { ...params, serpOnly: true }, {}, options);
|
|
678
689
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -6,6 +6,26 @@ export { ArtifactDelivery, ClientAttribution, ClientMetadataOptions, DeliveredNa
|
|
|
6
6
|
* Do not make direct changes to the file.
|
|
7
7
|
*/
|
|
8
8
|
interface paths {
|
|
9
|
+
"/bugs/report": {
|
|
10
|
+
parameters: {
|
|
11
|
+
query?: never;
|
|
12
|
+
header?: never;
|
|
13
|
+
path?: never;
|
|
14
|
+
cookie?: never;
|
|
15
|
+
};
|
|
16
|
+
get?: never;
|
|
17
|
+
put?: never;
|
|
18
|
+
/**
|
|
19
|
+
* Prepare, submit or read a private bug report
|
|
20
|
+
* @description Prepare a redacted one-day draft from observed evidence. Submit its exact reportId and reviewToken only at the user’s request. Submitted reports and verified account email are shared with private support for 365 days. Free; status and repeated submit are safe.
|
|
21
|
+
*/
|
|
22
|
+
post: operations["bugReporting"];
|
|
23
|
+
delete?: never;
|
|
24
|
+
options?: never;
|
|
25
|
+
head?: never;
|
|
26
|
+
patch?: never;
|
|
27
|
+
trace?: never;
|
|
28
|
+
};
|
|
9
29
|
"/harvest": {
|
|
10
30
|
parameters: {
|
|
11
31
|
query?: never;
|
|
@@ -562,7 +582,7 @@ interface paths {
|
|
|
562
582
|
put?: never;
|
|
563
583
|
/**
|
|
564
584
|
* Capture a Reddit post and its comment tree
|
|
565
|
-
* @description Costs 30 credits for the thread plus 2 credits per comment actually returned. Refunded automatically if Reddit blocks the request after retries.
|
|
585
|
+
* @description Opens a known Reddit thread directly without a discovery search. Costs 30 credits for the thread plus 2 credits per comment actually returned. Refunded automatically if Reddit blocks the request after retries.
|
|
566
586
|
*/
|
|
567
587
|
post: operations["redditThread"];
|
|
568
588
|
delete?: never;
|
|
@@ -582,13 +602,14 @@ interface paths {
|
|
|
582
602
|
put?: never;
|
|
583
603
|
/**
|
|
584
604
|
* Discover and rank the top recent Reddit threads for a topic
|
|
585
|
-
* @description
|
|
586
|
-
*
|
|
587
|
-
*
|
|
588
|
-
* includeComments
|
|
589
|
-
*
|
|
590
|
-
*
|
|
591
|
-
*
|
|
605
|
+
* @description Discovers Reddit threads through a Google site:reddit.com search and selects relevant candidates
|
|
606
|
+
* before scraping. Supports week, month, year and all-time windows. Scraped post dates are checked
|
|
607
|
+
* against the requested publication window; discovery-only candidate dates remain unverified.
|
|
608
|
+
* With includeComments:true, collects selected threads and ranks by engagement (upvotes + 2x
|
|
609
|
+
* reported comments). Billing: one discovery debit plus 30 credits per scraped thread and 2 credits
|
|
610
|
+
* per captured comment, each refunded on failure. Set includeComments:false for a candidate list
|
|
611
|
+
* without per-thread billing. Comment coverage distinguishes the requested limit, returned text
|
|
612
|
+
* comments and reported comment count. A bounded capture can return partial:true.
|
|
592
613
|
*/
|
|
593
614
|
post: operations["redditTrending"];
|
|
594
615
|
delete?: never;
|
|
@@ -2366,6 +2387,260 @@ interface components {
|
|
|
2366
2387
|
} & {
|
|
2367
2388
|
[key: string]: unknown;
|
|
2368
2389
|
};
|
|
2390
|
+
RedditThreadRequest: {
|
|
2391
|
+
/** @description A known Reddit thread URL to open directly without searching; legacy Reddit hostnames are normalized to the current page. */
|
|
2392
|
+
url: string;
|
|
2393
|
+
maxComments?: number;
|
|
2394
|
+
};
|
|
2395
|
+
RedditThreadResponse: {
|
|
2396
|
+
title?: string;
|
|
2397
|
+
author?: string | null;
|
|
2398
|
+
score?: string | null;
|
|
2399
|
+
postBody?: string;
|
|
2400
|
+
/**
|
|
2401
|
+
* Format: date-time
|
|
2402
|
+
* @description Observed publication timestamp when available.
|
|
2403
|
+
*/
|
|
2404
|
+
publishedAt?: string | null;
|
|
2405
|
+
numComments?: number;
|
|
2406
|
+
comments?: {
|
|
2407
|
+
author?: string | null;
|
|
2408
|
+
score?: string;
|
|
2409
|
+
depth?: number;
|
|
2410
|
+
body?: string;
|
|
2411
|
+
}[];
|
|
2412
|
+
sourceUrl?: string;
|
|
2413
|
+
};
|
|
2414
|
+
RedditTrendingRequest: {
|
|
2415
|
+
/** @description Topic in plain words, e.g. "crm for small business". Not a URL. */
|
|
2416
|
+
topic: string;
|
|
2417
|
+
/** @description Bare subreddit name to scope the scan, e.g. "SEO" (no r/ prefix). Omit to scan all of Reddit. */
|
|
2418
|
+
subreddit?: string;
|
|
2419
|
+
/**
|
|
2420
|
+
* @description Publication window; scraped threads are checked against their actual post dates, while discovery-only dates remain unverified.
|
|
2421
|
+
* @default month
|
|
2422
|
+
* @enum {string}
|
|
2423
|
+
*/
|
|
2424
|
+
window: "week" | "month" | "year" | "all";
|
|
2425
|
+
/**
|
|
2426
|
+
* @description Cap on relevant threads selected before scraping; one search page can yield fewer. Each scraped thread and its returned comments are billed separately.
|
|
2427
|
+
* @default 20
|
|
2428
|
+
*/
|
|
2429
|
+
maxThreads: number;
|
|
2430
|
+
/**
|
|
2431
|
+
* @description Open selected threads to verify post dates and collect comments; false returns search candidates for your own selection, without per-thread charges or verified post dates.
|
|
2432
|
+
* @default true
|
|
2433
|
+
*/
|
|
2434
|
+
includeComments: boolean;
|
|
2435
|
+
/**
|
|
2436
|
+
* @description Comments captured (and billed) per scraped thread when includeComments is true.
|
|
2437
|
+
* @default 50
|
|
2438
|
+
*/
|
|
2439
|
+
maxCommentsPerThread: number;
|
|
2440
|
+
};
|
|
2441
|
+
RedditTrendingResponse: {
|
|
2442
|
+
topic?: string;
|
|
2443
|
+
subreddit?: string | null;
|
|
2444
|
+
/** @description Resolved publication window: "7d", "30d", "365d" or "all". */
|
|
2445
|
+
window?: string;
|
|
2446
|
+
totals?: {
|
|
2447
|
+
threads?: number;
|
|
2448
|
+
upvotes?: number;
|
|
2449
|
+
comments?: number;
|
|
2450
|
+
};
|
|
2451
|
+
rankedThreads?: {
|
|
2452
|
+
title?: string;
|
|
2453
|
+
url?: string;
|
|
2454
|
+
subreddit?: string;
|
|
2455
|
+
score?: number;
|
|
2456
|
+
commentCount?: number;
|
|
2457
|
+
engagementScore?: number;
|
|
2458
|
+
ageText?: string;
|
|
2459
|
+
/**
|
|
2460
|
+
* Format: date-time
|
|
2461
|
+
* @description Observed publication timestamp when available.
|
|
2462
|
+
*/
|
|
2463
|
+
publishedAt?: string | null;
|
|
2464
|
+
/** @description Text comments actually returned for this thread. */
|
|
2465
|
+
capturedCommentCount?: number;
|
|
2466
|
+
/** @description Requested per-thread comment cap. */
|
|
2467
|
+
requestedCommentLimit?: number;
|
|
2468
|
+
commentCoverage?: {
|
|
2469
|
+
requestedLimit: number;
|
|
2470
|
+
returnedCount: number;
|
|
2471
|
+
declaredCount: number;
|
|
2472
|
+
status: components["schemas"]["RedditCommentCoverageStatus"];
|
|
2473
|
+
reason: components["schemas"]["RedditCommentCoverageReason"];
|
|
2474
|
+
};
|
|
2475
|
+
topQuestions?: string[];
|
|
2476
|
+
}[];
|
|
2477
|
+
questions?: {
|
|
2478
|
+
question?: string;
|
|
2479
|
+
threadUrl?: string;
|
|
2480
|
+
}[];
|
|
2481
|
+
threadsScraped?: number;
|
|
2482
|
+
candidatesFound?: number;
|
|
2483
|
+
/** @description true if scraping stopped early at the time limit. */
|
|
2484
|
+
partial?: boolean;
|
|
2485
|
+
/** @description The Google site:reddit.com query used for discovery. */
|
|
2486
|
+
searchQuery?: string;
|
|
2487
|
+
};
|
|
2488
|
+
/** @enum {string} */
|
|
2489
|
+
RedditCommentCoverageStatus: "complete" | "partial";
|
|
2490
|
+
/** @enum {string} */
|
|
2491
|
+
RedditCommentCoverageReason: "requested_limit_reached" | "declared_count_reached" | "stable_visible_shortfall" | "capture_shortfall" | "funding_limited";
|
|
2492
|
+
BugReportingRequest: {
|
|
2493
|
+
/**
|
|
2494
|
+
* @description prepare saves a private one-day draft for review; submit sends that exact draft to support; status reads your report receipt.
|
|
2495
|
+
* @default prepare
|
|
2496
|
+
* @enum {string}
|
|
2497
|
+
*/
|
|
2498
|
+
action: "prepare" | "submit" | "status";
|
|
2499
|
+
/** @description Required for prepare. Collect known evidence from the conversation before asking the user for missing details. */
|
|
2500
|
+
report?: {
|
|
2501
|
+
/** @description Short description of the problem in plain language. */
|
|
2502
|
+
title: string;
|
|
2503
|
+
/** @description What the user was trying to accomplish, using their words. */
|
|
2504
|
+
goal: string;
|
|
2505
|
+
/** @description What should have happened. */
|
|
2506
|
+
expected: string;
|
|
2507
|
+
/** @description What actually happened. Separate observations from suspected causes. */
|
|
2508
|
+
actual: string;
|
|
2509
|
+
/** @description Ordered reproduction steps, including retries and what changed. */
|
|
2510
|
+
steps: string[];
|
|
2511
|
+
/** @description Calls in the order made. Include successful calls that explain the failure. */
|
|
2512
|
+
attempts: {
|
|
2513
|
+
/** @description Exact tool name or REST method and path. */
|
|
2514
|
+
tool: string;
|
|
2515
|
+
/**
|
|
2516
|
+
* Format: date-time
|
|
2517
|
+
* @description Observed call time with timezone; omit if unknown.
|
|
2518
|
+
*/
|
|
2519
|
+
submittedAt?: string;
|
|
2520
|
+
/** @description Exact submitted arguments as JSON or text. Remove credentials, cookies and unrelated private content first. Do not reconstruct unknown arguments. */
|
|
2521
|
+
arguments: string;
|
|
2522
|
+
/** @description Observed response or error text, including error codes and retry outcome. Remove secrets. */
|
|
2523
|
+
result: string;
|
|
2524
|
+
/** @description Returned request ID, when available. */
|
|
2525
|
+
requestId?: string;
|
|
2526
|
+
/** @description Returned job or run ID, when available. */
|
|
2527
|
+
jobId?: string;
|
|
2528
|
+
}[];
|
|
2529
|
+
/** @description Observed client environment; use unknown rather than guessing. */
|
|
2530
|
+
client: {
|
|
2531
|
+
/** @description Observed application or SDK name. */
|
|
2532
|
+
name: string;
|
|
2533
|
+
/** @description Observed application or package version; omit if unknown. */
|
|
2534
|
+
version?: string;
|
|
2535
|
+
/**
|
|
2536
|
+
* @description Connection or install route used for the failed calls.
|
|
2537
|
+
* @enum {string}
|
|
2538
|
+
*/
|
|
2539
|
+
transport: "oauth" | "api-key" | "npx" | "npm" | "sdk" | "mcpb" | "rest" | "unknown";
|
|
2540
|
+
/** @description Observed operating system; omit if unknown. */
|
|
2541
|
+
operatingSystem?: string;
|
|
2542
|
+
/** @description Observed AI model; omit if unknown. */
|
|
2543
|
+
model?: string;
|
|
2544
|
+
};
|
|
2545
|
+
/** @description Impact, frequency, useful prior context, and suspected cause clearly labeled as a guess. No full conversation dump. */
|
|
2546
|
+
context?: string;
|
|
2547
|
+
/**
|
|
2548
|
+
* @description Evidence that is unknown or unavailable; do not invent it.
|
|
2549
|
+
* @default []
|
|
2550
|
+
*/
|
|
2551
|
+
missing: string[];
|
|
2552
|
+
};
|
|
2553
|
+
/**
|
|
2554
|
+
* Format: uuid
|
|
2555
|
+
* @description ID returned by prepare; required for submit or status.
|
|
2556
|
+
*/
|
|
2557
|
+
reportId?: string;
|
|
2558
|
+
/** @description Exact token returned by prepare; required for submit. A changed report requires a new prepare. */
|
|
2559
|
+
reviewToken?: string;
|
|
2560
|
+
/** @description Set true only when the user has asked to submit this bug or approved the reviewed draft. Repeated errors alone do not authorize submission. */
|
|
2561
|
+
userApproved?: boolean;
|
|
2562
|
+
};
|
|
2563
|
+
BugReportingResponse: {
|
|
2564
|
+
/** @enum {boolean} */
|
|
2565
|
+
ok: true;
|
|
2566
|
+
accountEmail: string;
|
|
2567
|
+
/** Format: uuid */
|
|
2568
|
+
reportId: string;
|
|
2569
|
+
/** @enum {string} */
|
|
2570
|
+
status: "draft" | "submitted";
|
|
2571
|
+
receivedAt: string;
|
|
2572
|
+
submittedAt: string | null;
|
|
2573
|
+
expiresAt: string;
|
|
2574
|
+
report: {
|
|
2575
|
+
/** @description Short description of the problem in plain language. */
|
|
2576
|
+
title: string;
|
|
2577
|
+
/** @description What the user was trying to accomplish, using their words. */
|
|
2578
|
+
goal: string;
|
|
2579
|
+
/** @description What should have happened. */
|
|
2580
|
+
expected: string;
|
|
2581
|
+
/** @description What actually happened. Separate observations from suspected causes. */
|
|
2582
|
+
actual: string;
|
|
2583
|
+
/** @description Ordered reproduction steps, including retries and what changed. */
|
|
2584
|
+
steps: string[];
|
|
2585
|
+
/** @description Calls in the order made. Include successful calls that explain the failure. */
|
|
2586
|
+
attempts: {
|
|
2587
|
+
/** @description Exact tool name or REST method and path. */
|
|
2588
|
+
tool: string;
|
|
2589
|
+
/**
|
|
2590
|
+
* Format: date-time
|
|
2591
|
+
* @description Observed call time with timezone; omit if unknown.
|
|
2592
|
+
*/
|
|
2593
|
+
submittedAt?: string;
|
|
2594
|
+
/** @description Exact submitted arguments as JSON or text. Remove credentials, cookies and unrelated private content first. Do not reconstruct unknown arguments. */
|
|
2595
|
+
arguments: string;
|
|
2596
|
+
/** @description Observed response or error text, including error codes and retry outcome. Remove secrets. */
|
|
2597
|
+
result: string;
|
|
2598
|
+
/** @description Returned request ID, when available. */
|
|
2599
|
+
requestId?: string;
|
|
2600
|
+
/** @description Returned job or run ID, when available. */
|
|
2601
|
+
jobId?: string;
|
|
2602
|
+
}[];
|
|
2603
|
+
/** @description Observed client environment; use unknown rather than guessing. */
|
|
2604
|
+
client: {
|
|
2605
|
+
/** @description Observed application or SDK name. */
|
|
2606
|
+
name: string;
|
|
2607
|
+
/** @description Observed application or package version; omit if unknown. */
|
|
2608
|
+
version?: string;
|
|
2609
|
+
/**
|
|
2610
|
+
* @description Connection or install route used for the failed calls.
|
|
2611
|
+
* @enum {string}
|
|
2612
|
+
*/
|
|
2613
|
+
transport: "oauth" | "api-key" | "npx" | "npm" | "sdk" | "mcpb" | "rest" | "unknown";
|
|
2614
|
+
/** @description Observed operating system; omit if unknown. */
|
|
2615
|
+
operatingSystem?: string;
|
|
2616
|
+
/** @description Observed AI model; omit if unknown. */
|
|
2617
|
+
model?: string;
|
|
2618
|
+
};
|
|
2619
|
+
/** @description Impact, frequency, useful prior context, and suspected cause clearly labeled as a guess. No full conversation dump. */
|
|
2620
|
+
context?: string;
|
|
2621
|
+
/**
|
|
2622
|
+
* @description Evidence that is unknown or unavailable; do not invent it.
|
|
2623
|
+
* @default []
|
|
2624
|
+
*/
|
|
2625
|
+
missing: string[];
|
|
2626
|
+
};
|
|
2627
|
+
reviewToken?: string;
|
|
2628
|
+
redacted: boolean;
|
|
2629
|
+
message: string;
|
|
2630
|
+
};
|
|
2631
|
+
BugReportingError: {
|
|
2632
|
+
error?: string;
|
|
2633
|
+
/** @enum {string} */
|
|
2634
|
+
error_code: "request_aborted" | "captcha_exhausted" | "captcha_or_blocked" | "location_mismatch" | "proxy_tunnel_failed" | "proxy_unavailable" | "harvest_timeout" | "mcp_request_timeout" | "mcp_http_error" | "extraction_failed" | "concurrency_limit_exceeded" | "unauthorized" | "forbidden" | "invalid_request" | "rate_limited" | "upstream_rate_limited" | "insufficient_balance" | "service_unavailable" | "response_lost" | "vendor_unavailable" | "page_not_found" | "page_forbidden" | "page_rate_limited" | "page_server_error" | "page_http_error" | "bot_check_unresolved" | "page_too_large" | "page_unreachable" | "browser_session_interrupted" | "site_export_not_found" | "directory_job_not_found" | "site_export_format_unavailable" | "site_export_read_failed" | "site_export_image_not_found" | "image_url_invalid" | "image_url_not_https" | "image_host_unresolvable" | "image_host_blocked" | "image_redirect_invalid" | "image_source_unavailable" | "image_too_large" | "image_redirect_limit" | "image_base64_invalid" | "image_source_missing" | "image_source_ambiguous" | "image_source_type_invalid" | "image_artifact_not_found" | "image_page_too_large" | "page_image_not_found" | "page_image_candidates_unusable" | "image_format_unsupported" | "image_storage_unconfigured" | "featured_image_unhostable";
|
|
2635
|
+
/** @enum {string} */
|
|
2636
|
+
error_type: "request_aborted" | "captcha" | "location_mismatch" | "connection" | "timeout" | "extraction" | "concurrency_limit" | "unauthorized" | "forbidden" | "invalid_request" | "not_found" | "rate_limit" | "billing" | "service_unavailable";
|
|
2637
|
+
message: string;
|
|
2638
|
+
retryable: boolean;
|
|
2639
|
+
/** @enum {string} */
|
|
2640
|
+
charge_status: "not_charged";
|
|
2641
|
+
} & {
|
|
2642
|
+
[key: string]: unknown;
|
|
2643
|
+
};
|
|
2369
2644
|
MapsSearchRequest: {
|
|
2370
2645
|
query: string;
|
|
2371
2646
|
location?: string;
|
|
@@ -2645,6 +2920,102 @@ interface components {
|
|
|
2645
2920
|
pathItems: never;
|
|
2646
2921
|
}
|
|
2647
2922
|
interface operations {
|
|
2923
|
+
bugReporting: {
|
|
2924
|
+
parameters: {
|
|
2925
|
+
query?: never;
|
|
2926
|
+
header?: never;
|
|
2927
|
+
path?: never;
|
|
2928
|
+
cookie?: never;
|
|
2929
|
+
};
|
|
2930
|
+
requestBody: {
|
|
2931
|
+
content: {
|
|
2932
|
+
"application/json": components["schemas"]["BugReportingRequest"];
|
|
2933
|
+
};
|
|
2934
|
+
};
|
|
2935
|
+
responses: {
|
|
2936
|
+
/** @description Prepare, submit or read a private bug report */
|
|
2937
|
+
200: {
|
|
2938
|
+
headers: {
|
|
2939
|
+
[name: string]: unknown;
|
|
2940
|
+
};
|
|
2941
|
+
content: {
|
|
2942
|
+
"application/json": components["schemas"]["BugReportingResponse"];
|
|
2943
|
+
};
|
|
2944
|
+
};
|
|
2945
|
+
/** @description Prepare, submit or read a private bug report */
|
|
2946
|
+
400: {
|
|
2947
|
+
headers: {
|
|
2948
|
+
[name: string]: unknown;
|
|
2949
|
+
};
|
|
2950
|
+
content: {
|
|
2951
|
+
"application/json": components["schemas"]["BugReportingError"];
|
|
2952
|
+
};
|
|
2953
|
+
};
|
|
2954
|
+
/** @description Prepare, submit or read a private bug report */
|
|
2955
|
+
401: {
|
|
2956
|
+
headers: {
|
|
2957
|
+
[name: string]: unknown;
|
|
2958
|
+
};
|
|
2959
|
+
content: {
|
|
2960
|
+
"application/json": components["schemas"]["BugReportingError"];
|
|
2961
|
+
};
|
|
2962
|
+
};
|
|
2963
|
+
/** @description Prepare, submit or read a private bug report */
|
|
2964
|
+
403: {
|
|
2965
|
+
headers: {
|
|
2966
|
+
[name: string]: unknown;
|
|
2967
|
+
};
|
|
2968
|
+
content: {
|
|
2969
|
+
"application/json": components["schemas"]["BugReportingError"];
|
|
2970
|
+
};
|
|
2971
|
+
};
|
|
2972
|
+
/** @description Prepare, submit or read a private bug report */
|
|
2973
|
+
404: {
|
|
2974
|
+
headers: {
|
|
2975
|
+
[name: string]: unknown;
|
|
2976
|
+
};
|
|
2977
|
+
content: {
|
|
2978
|
+
"application/json": components["schemas"]["BugReportingError"];
|
|
2979
|
+
};
|
|
2980
|
+
};
|
|
2981
|
+
/** @description Prepare, submit or read a private bug report */
|
|
2982
|
+
409: {
|
|
2983
|
+
headers: {
|
|
2984
|
+
[name: string]: unknown;
|
|
2985
|
+
};
|
|
2986
|
+
content: {
|
|
2987
|
+
"application/json": components["schemas"]["BugReportingError"];
|
|
2988
|
+
};
|
|
2989
|
+
};
|
|
2990
|
+
/** @description Prepare, submit or read a private bug report */
|
|
2991
|
+
413: {
|
|
2992
|
+
headers: {
|
|
2993
|
+
[name: string]: unknown;
|
|
2994
|
+
};
|
|
2995
|
+
content: {
|
|
2996
|
+
"application/json": components["schemas"]["BugReportingError"];
|
|
2997
|
+
};
|
|
2998
|
+
};
|
|
2999
|
+
/** @description Prepare, submit or read a private bug report */
|
|
3000
|
+
429: {
|
|
3001
|
+
headers: {
|
|
3002
|
+
[name: string]: unknown;
|
|
3003
|
+
};
|
|
3004
|
+
content: {
|
|
3005
|
+
"application/json": components["schemas"]["BugReportingError"];
|
|
3006
|
+
};
|
|
3007
|
+
};
|
|
3008
|
+
/** @description Prepare, submit or read a private bug report */
|
|
3009
|
+
503: {
|
|
3010
|
+
headers: {
|
|
3011
|
+
[name: string]: unknown;
|
|
3012
|
+
};
|
|
3013
|
+
content: {
|
|
3014
|
+
"application/json": components["schemas"]["BugReportingError"];
|
|
3015
|
+
};
|
|
3016
|
+
};
|
|
3017
|
+
};
|
|
3018
|
+
};
|
|
2648
3019
|
startHarvest: {
|
|
2649
3020
|
parameters: {
|
|
2650
3021
|
query?: never;
|
|
@@ -3591,11 +3962,7 @@ interface operations {
|
|
|
3591
3962
|
};
|
|
3592
3963
|
requestBody: {
|
|
3593
3964
|
content: {
|
|
3594
|
-
"application/json":
|
|
3595
|
-
/** @description A reddit.com or redd.it thread URL. */
|
|
3596
|
-
url: string;
|
|
3597
|
-
maxComments?: number;
|
|
3598
|
-
};
|
|
3965
|
+
"application/json": components["schemas"]["RedditThreadRequest"];
|
|
3599
3966
|
};
|
|
3600
3967
|
};
|
|
3601
3968
|
responses: {
|
|
@@ -3605,20 +3972,7 @@ interface operations {
|
|
|
3605
3972
|
[name: string]: unknown;
|
|
3606
3973
|
};
|
|
3607
3974
|
content: {
|
|
3608
|
-
"application/json":
|
|
3609
|
-
title?: string;
|
|
3610
|
-
author?: string | null;
|
|
3611
|
-
score?: string | null;
|
|
3612
|
-
postBody?: string;
|
|
3613
|
-
numComments?: number;
|
|
3614
|
-
comments?: {
|
|
3615
|
-
author?: string | null;
|
|
3616
|
-
score?: string;
|
|
3617
|
-
depth?: number;
|
|
3618
|
-
body?: string;
|
|
3619
|
-
}[];
|
|
3620
|
-
sourceUrl?: string;
|
|
3621
|
-
};
|
|
3975
|
+
"application/json": components["schemas"]["RedditThreadResponse"];
|
|
3622
3976
|
};
|
|
3623
3977
|
};
|
|
3624
3978
|
400: components["responses"]["BadRequest"];
|
|
@@ -3643,33 +3997,7 @@ interface operations {
|
|
|
3643
3997
|
};
|
|
3644
3998
|
requestBody: {
|
|
3645
3999
|
content: {
|
|
3646
|
-
"application/json":
|
|
3647
|
-
/** @description Topic in plain words, e.g. "crm for small business". Not a URL. */
|
|
3648
|
-
topic: string;
|
|
3649
|
-
/** @description Bare subreddit name to scope the scan, e.g. "SEO" (no r/ prefix). Omit to scan all of Reddit. */
|
|
3650
|
-
subreddit?: string;
|
|
3651
|
-
/**
|
|
3652
|
-
* @description How recent the threads must be.
|
|
3653
|
-
* @default month
|
|
3654
|
-
* @enum {string}
|
|
3655
|
-
*/
|
|
3656
|
-
window?: "week" | "month";
|
|
3657
|
-
/**
|
|
3658
|
-
* @description How many discovered threads to scrape and rank (scrape-all default). Lower to cap cost.
|
|
3659
|
-
* @default 20
|
|
3660
|
-
*/
|
|
3661
|
-
maxThreads?: number;
|
|
3662
|
-
/**
|
|
3663
|
-
* @description true = scrape each thread for engagement + questions and rank; false = cheap discovery-only list.
|
|
3664
|
-
* @default true
|
|
3665
|
-
*/
|
|
3666
|
-
includeComments?: boolean;
|
|
3667
|
-
/**
|
|
3668
|
-
* @description Comments captured (and billed) per scraped thread when includeComments is true.
|
|
3669
|
-
* @default 50
|
|
3670
|
-
*/
|
|
3671
|
-
maxCommentsPerThread?: number;
|
|
3672
|
-
};
|
|
4000
|
+
"application/json": components["schemas"]["RedditTrendingRequest"];
|
|
3673
4001
|
};
|
|
3674
4002
|
};
|
|
3675
4003
|
responses: {
|
|
@@ -3679,37 +4007,7 @@ interface operations {
|
|
|
3679
4007
|
[name: string]: unknown;
|
|
3680
4008
|
};
|
|
3681
4009
|
content: {
|
|
3682
|
-
"application/json":
|
|
3683
|
-
topic?: string;
|
|
3684
|
-
subreddit?: string | null;
|
|
3685
|
-
/** @description Resolved window, e.g. "7d" or "30d". */
|
|
3686
|
-
window?: string;
|
|
3687
|
-
totals?: {
|
|
3688
|
-
threads?: number;
|
|
3689
|
-
upvotes?: number;
|
|
3690
|
-
comments?: number;
|
|
3691
|
-
};
|
|
3692
|
-
rankedThreads?: {
|
|
3693
|
-
title?: string;
|
|
3694
|
-
url?: string;
|
|
3695
|
-
subreddit?: string;
|
|
3696
|
-
score?: number;
|
|
3697
|
-
commentCount?: number;
|
|
3698
|
-
engagementScore?: number;
|
|
3699
|
-
ageText?: string;
|
|
3700
|
-
topQuestions?: string[];
|
|
3701
|
-
}[];
|
|
3702
|
-
questions?: {
|
|
3703
|
-
question?: string;
|
|
3704
|
-
threadUrl?: string;
|
|
3705
|
-
}[];
|
|
3706
|
-
threadsScraped?: number;
|
|
3707
|
-
candidatesFound?: number;
|
|
3708
|
-
/** @description true if scraping stopped early at the time limit. */
|
|
3709
|
-
partial?: boolean;
|
|
3710
|
-
/** @description The Google site:reddit.com query used for discovery. */
|
|
3711
|
-
searchQuery?: string;
|
|
3712
|
-
};
|
|
4010
|
+
"application/json": components["schemas"]["RedditTrendingResponse"];
|
|
3713
4011
|
};
|
|
3714
4012
|
};
|
|
3715
4013
|
400: components["responses"]["BadRequest"];
|
|
@@ -4905,6 +5203,7 @@ declare class RedditNamespace {
|
|
|
4905
5203
|
author?: string | null;
|
|
4906
5204
|
score?: string | null;
|
|
4907
5205
|
postBody?: string;
|
|
5206
|
+
publishedAt?: string | null;
|
|
4908
5207
|
numComments?: number;
|
|
4909
5208
|
comments?: {
|
|
4910
5209
|
author?: string | null;
|
|
@@ -5415,6 +5714,42 @@ declare class ScraperClient {
|
|
|
5415
5714
|
job_id: string;
|
|
5416
5715
|
status: "pending";
|
|
5417
5716
|
}>;
|
|
5717
|
+
bugReporting(params: RequestBodyOf<'bugReporting'>, options?: ScraperRequestOptions): Promise<{
|
|
5718
|
+
ok: true;
|
|
5719
|
+
accountEmail: string;
|
|
5720
|
+
reportId: string;
|
|
5721
|
+
status: "draft" | "submitted";
|
|
5722
|
+
receivedAt: string;
|
|
5723
|
+
submittedAt: string | null;
|
|
5724
|
+
expiresAt: string;
|
|
5725
|
+
report: {
|
|
5726
|
+
title: string;
|
|
5727
|
+
goal: string;
|
|
5728
|
+
expected: string;
|
|
5729
|
+
actual: string;
|
|
5730
|
+
steps: string[];
|
|
5731
|
+
attempts: {
|
|
5732
|
+
tool: string;
|
|
5733
|
+
submittedAt?: string;
|
|
5734
|
+
arguments: string;
|
|
5735
|
+
result: string;
|
|
5736
|
+
requestId?: string;
|
|
5737
|
+
jobId?: string;
|
|
5738
|
+
}[];
|
|
5739
|
+
client: {
|
|
5740
|
+
name: string;
|
|
5741
|
+
version?: string;
|
|
5742
|
+
transport: "oauth" | "api-key" | "npx" | "npm" | "sdk" | "mcpb" | "rest" | "unknown";
|
|
5743
|
+
operatingSystem?: string;
|
|
5744
|
+
model?: string;
|
|
5745
|
+
};
|
|
5746
|
+
context?: string;
|
|
5747
|
+
missing: string[];
|
|
5748
|
+
};
|
|
5749
|
+
reviewToken?: string;
|
|
5750
|
+
redacted: boolean;
|
|
5751
|
+
message: string;
|
|
5752
|
+
}>;
|
|
5418
5753
|
searchSerp(params: SearchSerpParams, options?: ScraperRequestOptions): Promise<{
|
|
5419
5754
|
job_id: string;
|
|
5420
5755
|
status: "done" | "cancelled" | "failed";
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,26 @@ export { ArtifactDelivery, ClientAttribution, ClientMetadataOptions, DeliveredNa
|
|
|
6
6
|
* Do not make direct changes to the file.
|
|
7
7
|
*/
|
|
8
8
|
interface paths {
|
|
9
|
+
"/bugs/report": {
|
|
10
|
+
parameters: {
|
|
11
|
+
query?: never;
|
|
12
|
+
header?: never;
|
|
13
|
+
path?: never;
|
|
14
|
+
cookie?: never;
|
|
15
|
+
};
|
|
16
|
+
get?: never;
|
|
17
|
+
put?: never;
|
|
18
|
+
/**
|
|
19
|
+
* Prepare, submit or read a private bug report
|
|
20
|
+
* @description Prepare a redacted one-day draft from observed evidence. Submit its exact reportId and reviewToken only at the user’s request. Submitted reports and verified account email are shared with private support for 365 days. Free; status and repeated submit are safe.
|
|
21
|
+
*/
|
|
22
|
+
post: operations["bugReporting"];
|
|
23
|
+
delete?: never;
|
|
24
|
+
options?: never;
|
|
25
|
+
head?: never;
|
|
26
|
+
patch?: never;
|
|
27
|
+
trace?: never;
|
|
28
|
+
};
|
|
9
29
|
"/harvest": {
|
|
10
30
|
parameters: {
|
|
11
31
|
query?: never;
|
|
@@ -562,7 +582,7 @@ interface paths {
|
|
|
562
582
|
put?: never;
|
|
563
583
|
/**
|
|
564
584
|
* Capture a Reddit post and its comment tree
|
|
565
|
-
* @description Costs 30 credits for the thread plus 2 credits per comment actually returned. Refunded automatically if Reddit blocks the request after retries.
|
|
585
|
+
* @description Opens a known Reddit thread directly without a discovery search. Costs 30 credits for the thread plus 2 credits per comment actually returned. Refunded automatically if Reddit blocks the request after retries.
|
|
566
586
|
*/
|
|
567
587
|
post: operations["redditThread"];
|
|
568
588
|
delete?: never;
|
|
@@ -582,13 +602,14 @@ interface paths {
|
|
|
582
602
|
put?: never;
|
|
583
603
|
/**
|
|
584
604
|
* Discover and rank the top recent Reddit threads for a topic
|
|
585
|
-
* @description
|
|
586
|
-
*
|
|
587
|
-
*
|
|
588
|
-
* includeComments
|
|
589
|
-
*
|
|
590
|
-
*
|
|
591
|
-
*
|
|
605
|
+
* @description Discovers Reddit threads through a Google site:reddit.com search and selects relevant candidates
|
|
606
|
+
* before scraping. Supports week, month, year and all-time windows. Scraped post dates are checked
|
|
607
|
+
* against the requested publication window; discovery-only candidate dates remain unverified.
|
|
608
|
+
* With includeComments:true, collects selected threads and ranks by engagement (upvotes + 2x
|
|
609
|
+
* reported comments). Billing: one discovery debit plus 30 credits per scraped thread and 2 credits
|
|
610
|
+
* per captured comment, each refunded on failure. Set includeComments:false for a candidate list
|
|
611
|
+
* without per-thread billing. Comment coverage distinguishes the requested limit, returned text
|
|
612
|
+
* comments and reported comment count. A bounded capture can return partial:true.
|
|
592
613
|
*/
|
|
593
614
|
post: operations["redditTrending"];
|
|
594
615
|
delete?: never;
|
|
@@ -2366,6 +2387,260 @@ interface components {
|
|
|
2366
2387
|
} & {
|
|
2367
2388
|
[key: string]: unknown;
|
|
2368
2389
|
};
|
|
2390
|
+
RedditThreadRequest: {
|
|
2391
|
+
/** @description A known Reddit thread URL to open directly without searching; legacy Reddit hostnames are normalized to the current page. */
|
|
2392
|
+
url: string;
|
|
2393
|
+
maxComments?: number;
|
|
2394
|
+
};
|
|
2395
|
+
RedditThreadResponse: {
|
|
2396
|
+
title?: string;
|
|
2397
|
+
author?: string | null;
|
|
2398
|
+
score?: string | null;
|
|
2399
|
+
postBody?: string;
|
|
2400
|
+
/**
|
|
2401
|
+
* Format: date-time
|
|
2402
|
+
* @description Observed publication timestamp when available.
|
|
2403
|
+
*/
|
|
2404
|
+
publishedAt?: string | null;
|
|
2405
|
+
numComments?: number;
|
|
2406
|
+
comments?: {
|
|
2407
|
+
author?: string | null;
|
|
2408
|
+
score?: string;
|
|
2409
|
+
depth?: number;
|
|
2410
|
+
body?: string;
|
|
2411
|
+
}[];
|
|
2412
|
+
sourceUrl?: string;
|
|
2413
|
+
};
|
|
2414
|
+
RedditTrendingRequest: {
|
|
2415
|
+
/** @description Topic in plain words, e.g. "crm for small business". Not a URL. */
|
|
2416
|
+
topic: string;
|
|
2417
|
+
/** @description Bare subreddit name to scope the scan, e.g. "SEO" (no r/ prefix). Omit to scan all of Reddit. */
|
|
2418
|
+
subreddit?: string;
|
|
2419
|
+
/**
|
|
2420
|
+
* @description Publication window; scraped threads are checked against their actual post dates, while discovery-only dates remain unverified.
|
|
2421
|
+
* @default month
|
|
2422
|
+
* @enum {string}
|
|
2423
|
+
*/
|
|
2424
|
+
window: "week" | "month" | "year" | "all";
|
|
2425
|
+
/**
|
|
2426
|
+
* @description Cap on relevant threads selected before scraping; one search page can yield fewer. Each scraped thread and its returned comments are billed separately.
|
|
2427
|
+
* @default 20
|
|
2428
|
+
*/
|
|
2429
|
+
maxThreads: number;
|
|
2430
|
+
/**
|
|
2431
|
+
* @description Open selected threads to verify post dates and collect comments; false returns search candidates for your own selection, without per-thread charges or verified post dates.
|
|
2432
|
+
* @default true
|
|
2433
|
+
*/
|
|
2434
|
+
includeComments: boolean;
|
|
2435
|
+
/**
|
|
2436
|
+
* @description Comments captured (and billed) per scraped thread when includeComments is true.
|
|
2437
|
+
* @default 50
|
|
2438
|
+
*/
|
|
2439
|
+
maxCommentsPerThread: number;
|
|
2440
|
+
};
|
|
2441
|
+
RedditTrendingResponse: {
|
|
2442
|
+
topic?: string;
|
|
2443
|
+
subreddit?: string | null;
|
|
2444
|
+
/** @description Resolved publication window: "7d", "30d", "365d" or "all". */
|
|
2445
|
+
window?: string;
|
|
2446
|
+
totals?: {
|
|
2447
|
+
threads?: number;
|
|
2448
|
+
upvotes?: number;
|
|
2449
|
+
comments?: number;
|
|
2450
|
+
};
|
|
2451
|
+
rankedThreads?: {
|
|
2452
|
+
title?: string;
|
|
2453
|
+
url?: string;
|
|
2454
|
+
subreddit?: string;
|
|
2455
|
+
score?: number;
|
|
2456
|
+
commentCount?: number;
|
|
2457
|
+
engagementScore?: number;
|
|
2458
|
+
ageText?: string;
|
|
2459
|
+
/**
|
|
2460
|
+
* Format: date-time
|
|
2461
|
+
* @description Observed publication timestamp when available.
|
|
2462
|
+
*/
|
|
2463
|
+
publishedAt?: string | null;
|
|
2464
|
+
/** @description Text comments actually returned for this thread. */
|
|
2465
|
+
capturedCommentCount?: number;
|
|
2466
|
+
/** @description Requested per-thread comment cap. */
|
|
2467
|
+
requestedCommentLimit?: number;
|
|
2468
|
+
commentCoverage?: {
|
|
2469
|
+
requestedLimit: number;
|
|
2470
|
+
returnedCount: number;
|
|
2471
|
+
declaredCount: number;
|
|
2472
|
+
status: components["schemas"]["RedditCommentCoverageStatus"];
|
|
2473
|
+
reason: components["schemas"]["RedditCommentCoverageReason"];
|
|
2474
|
+
};
|
|
2475
|
+
topQuestions?: string[];
|
|
2476
|
+
}[];
|
|
2477
|
+
questions?: {
|
|
2478
|
+
question?: string;
|
|
2479
|
+
threadUrl?: string;
|
|
2480
|
+
}[];
|
|
2481
|
+
threadsScraped?: number;
|
|
2482
|
+
candidatesFound?: number;
|
|
2483
|
+
/** @description true if scraping stopped early at the time limit. */
|
|
2484
|
+
partial?: boolean;
|
|
2485
|
+
/** @description The Google site:reddit.com query used for discovery. */
|
|
2486
|
+
searchQuery?: string;
|
|
2487
|
+
};
|
|
2488
|
+
/** @enum {string} */
|
|
2489
|
+
RedditCommentCoverageStatus: "complete" | "partial";
|
|
2490
|
+
/** @enum {string} */
|
|
2491
|
+
RedditCommentCoverageReason: "requested_limit_reached" | "declared_count_reached" | "stable_visible_shortfall" | "capture_shortfall" | "funding_limited";
|
|
2492
|
+
BugReportingRequest: {
|
|
2493
|
+
/**
|
|
2494
|
+
* @description prepare saves a private one-day draft for review; submit sends that exact draft to support; status reads your report receipt.
|
|
2495
|
+
* @default prepare
|
|
2496
|
+
* @enum {string}
|
|
2497
|
+
*/
|
|
2498
|
+
action: "prepare" | "submit" | "status";
|
|
2499
|
+
/** @description Required for prepare. Collect known evidence from the conversation before asking the user for missing details. */
|
|
2500
|
+
report?: {
|
|
2501
|
+
/** @description Short description of the problem in plain language. */
|
|
2502
|
+
title: string;
|
|
2503
|
+
/** @description What the user was trying to accomplish, using their words. */
|
|
2504
|
+
goal: string;
|
|
2505
|
+
/** @description What should have happened. */
|
|
2506
|
+
expected: string;
|
|
2507
|
+
/** @description What actually happened. Separate observations from suspected causes. */
|
|
2508
|
+
actual: string;
|
|
2509
|
+
/** @description Ordered reproduction steps, including retries and what changed. */
|
|
2510
|
+
steps: string[];
|
|
2511
|
+
/** @description Calls in the order made. Include successful calls that explain the failure. */
|
|
2512
|
+
attempts: {
|
|
2513
|
+
/** @description Exact tool name or REST method and path. */
|
|
2514
|
+
tool: string;
|
|
2515
|
+
/**
|
|
2516
|
+
* Format: date-time
|
|
2517
|
+
* @description Observed call time with timezone; omit if unknown.
|
|
2518
|
+
*/
|
|
2519
|
+
submittedAt?: string;
|
|
2520
|
+
/** @description Exact submitted arguments as JSON or text. Remove credentials, cookies and unrelated private content first. Do not reconstruct unknown arguments. */
|
|
2521
|
+
arguments: string;
|
|
2522
|
+
/** @description Observed response or error text, including error codes and retry outcome. Remove secrets. */
|
|
2523
|
+
result: string;
|
|
2524
|
+
/** @description Returned request ID, when available. */
|
|
2525
|
+
requestId?: string;
|
|
2526
|
+
/** @description Returned job or run ID, when available. */
|
|
2527
|
+
jobId?: string;
|
|
2528
|
+
}[];
|
|
2529
|
+
/** @description Observed client environment; use unknown rather than guessing. */
|
|
2530
|
+
client: {
|
|
2531
|
+
/** @description Observed application or SDK name. */
|
|
2532
|
+
name: string;
|
|
2533
|
+
/** @description Observed application or package version; omit if unknown. */
|
|
2534
|
+
version?: string;
|
|
2535
|
+
/**
|
|
2536
|
+
* @description Connection or install route used for the failed calls.
|
|
2537
|
+
* @enum {string}
|
|
2538
|
+
*/
|
|
2539
|
+
transport: "oauth" | "api-key" | "npx" | "npm" | "sdk" | "mcpb" | "rest" | "unknown";
|
|
2540
|
+
/** @description Observed operating system; omit if unknown. */
|
|
2541
|
+
operatingSystem?: string;
|
|
2542
|
+
/** @description Observed AI model; omit if unknown. */
|
|
2543
|
+
model?: string;
|
|
2544
|
+
};
|
|
2545
|
+
/** @description Impact, frequency, useful prior context, and suspected cause clearly labeled as a guess. No full conversation dump. */
|
|
2546
|
+
context?: string;
|
|
2547
|
+
/**
|
|
2548
|
+
* @description Evidence that is unknown or unavailable; do not invent it.
|
|
2549
|
+
* @default []
|
|
2550
|
+
*/
|
|
2551
|
+
missing: string[];
|
|
2552
|
+
};
|
|
2553
|
+
/**
|
|
2554
|
+
* Format: uuid
|
|
2555
|
+
* @description ID returned by prepare; required for submit or status.
|
|
2556
|
+
*/
|
|
2557
|
+
reportId?: string;
|
|
2558
|
+
/** @description Exact token returned by prepare; required for submit. A changed report requires a new prepare. */
|
|
2559
|
+
reviewToken?: string;
|
|
2560
|
+
/** @description Set true only when the user has asked to submit this bug or approved the reviewed draft. Repeated errors alone do not authorize submission. */
|
|
2561
|
+
userApproved?: boolean;
|
|
2562
|
+
};
|
|
2563
|
+
BugReportingResponse: {
|
|
2564
|
+
/** @enum {boolean} */
|
|
2565
|
+
ok: true;
|
|
2566
|
+
accountEmail: string;
|
|
2567
|
+
/** Format: uuid */
|
|
2568
|
+
reportId: string;
|
|
2569
|
+
/** @enum {string} */
|
|
2570
|
+
status: "draft" | "submitted";
|
|
2571
|
+
receivedAt: string;
|
|
2572
|
+
submittedAt: string | null;
|
|
2573
|
+
expiresAt: string;
|
|
2574
|
+
report: {
|
|
2575
|
+
/** @description Short description of the problem in plain language. */
|
|
2576
|
+
title: string;
|
|
2577
|
+
/** @description What the user was trying to accomplish, using their words. */
|
|
2578
|
+
goal: string;
|
|
2579
|
+
/** @description What should have happened. */
|
|
2580
|
+
expected: string;
|
|
2581
|
+
/** @description What actually happened. Separate observations from suspected causes. */
|
|
2582
|
+
actual: string;
|
|
2583
|
+
/** @description Ordered reproduction steps, including retries and what changed. */
|
|
2584
|
+
steps: string[];
|
|
2585
|
+
/** @description Calls in the order made. Include successful calls that explain the failure. */
|
|
2586
|
+
attempts: {
|
|
2587
|
+
/** @description Exact tool name or REST method and path. */
|
|
2588
|
+
tool: string;
|
|
2589
|
+
/**
|
|
2590
|
+
* Format: date-time
|
|
2591
|
+
* @description Observed call time with timezone; omit if unknown.
|
|
2592
|
+
*/
|
|
2593
|
+
submittedAt?: string;
|
|
2594
|
+
/** @description Exact submitted arguments as JSON or text. Remove credentials, cookies and unrelated private content first. Do not reconstruct unknown arguments. */
|
|
2595
|
+
arguments: string;
|
|
2596
|
+
/** @description Observed response or error text, including error codes and retry outcome. Remove secrets. */
|
|
2597
|
+
result: string;
|
|
2598
|
+
/** @description Returned request ID, when available. */
|
|
2599
|
+
requestId?: string;
|
|
2600
|
+
/** @description Returned job or run ID, when available. */
|
|
2601
|
+
jobId?: string;
|
|
2602
|
+
}[];
|
|
2603
|
+
/** @description Observed client environment; use unknown rather than guessing. */
|
|
2604
|
+
client: {
|
|
2605
|
+
/** @description Observed application or SDK name. */
|
|
2606
|
+
name: string;
|
|
2607
|
+
/** @description Observed application or package version; omit if unknown. */
|
|
2608
|
+
version?: string;
|
|
2609
|
+
/**
|
|
2610
|
+
* @description Connection or install route used for the failed calls.
|
|
2611
|
+
* @enum {string}
|
|
2612
|
+
*/
|
|
2613
|
+
transport: "oauth" | "api-key" | "npx" | "npm" | "sdk" | "mcpb" | "rest" | "unknown";
|
|
2614
|
+
/** @description Observed operating system; omit if unknown. */
|
|
2615
|
+
operatingSystem?: string;
|
|
2616
|
+
/** @description Observed AI model; omit if unknown. */
|
|
2617
|
+
model?: string;
|
|
2618
|
+
};
|
|
2619
|
+
/** @description Impact, frequency, useful prior context, and suspected cause clearly labeled as a guess. No full conversation dump. */
|
|
2620
|
+
context?: string;
|
|
2621
|
+
/**
|
|
2622
|
+
* @description Evidence that is unknown or unavailable; do not invent it.
|
|
2623
|
+
* @default []
|
|
2624
|
+
*/
|
|
2625
|
+
missing: string[];
|
|
2626
|
+
};
|
|
2627
|
+
reviewToken?: string;
|
|
2628
|
+
redacted: boolean;
|
|
2629
|
+
message: string;
|
|
2630
|
+
};
|
|
2631
|
+
BugReportingError: {
|
|
2632
|
+
error?: string;
|
|
2633
|
+
/** @enum {string} */
|
|
2634
|
+
error_code: "request_aborted" | "captcha_exhausted" | "captcha_or_blocked" | "location_mismatch" | "proxy_tunnel_failed" | "proxy_unavailable" | "harvest_timeout" | "mcp_request_timeout" | "mcp_http_error" | "extraction_failed" | "concurrency_limit_exceeded" | "unauthorized" | "forbidden" | "invalid_request" | "rate_limited" | "upstream_rate_limited" | "insufficient_balance" | "service_unavailable" | "response_lost" | "vendor_unavailable" | "page_not_found" | "page_forbidden" | "page_rate_limited" | "page_server_error" | "page_http_error" | "bot_check_unresolved" | "page_too_large" | "page_unreachable" | "browser_session_interrupted" | "site_export_not_found" | "directory_job_not_found" | "site_export_format_unavailable" | "site_export_read_failed" | "site_export_image_not_found" | "image_url_invalid" | "image_url_not_https" | "image_host_unresolvable" | "image_host_blocked" | "image_redirect_invalid" | "image_source_unavailable" | "image_too_large" | "image_redirect_limit" | "image_base64_invalid" | "image_source_missing" | "image_source_ambiguous" | "image_source_type_invalid" | "image_artifact_not_found" | "image_page_too_large" | "page_image_not_found" | "page_image_candidates_unusable" | "image_format_unsupported" | "image_storage_unconfigured" | "featured_image_unhostable";
|
|
2635
|
+
/** @enum {string} */
|
|
2636
|
+
error_type: "request_aborted" | "captcha" | "location_mismatch" | "connection" | "timeout" | "extraction" | "concurrency_limit" | "unauthorized" | "forbidden" | "invalid_request" | "not_found" | "rate_limit" | "billing" | "service_unavailable";
|
|
2637
|
+
message: string;
|
|
2638
|
+
retryable: boolean;
|
|
2639
|
+
/** @enum {string} */
|
|
2640
|
+
charge_status: "not_charged";
|
|
2641
|
+
} & {
|
|
2642
|
+
[key: string]: unknown;
|
|
2643
|
+
};
|
|
2369
2644
|
MapsSearchRequest: {
|
|
2370
2645
|
query: string;
|
|
2371
2646
|
location?: string;
|
|
@@ -2645,6 +2920,102 @@ interface components {
|
|
|
2645
2920
|
pathItems: never;
|
|
2646
2921
|
}
|
|
2647
2922
|
interface operations {
|
|
2923
|
+
bugReporting: {
|
|
2924
|
+
parameters: {
|
|
2925
|
+
query?: never;
|
|
2926
|
+
header?: never;
|
|
2927
|
+
path?: never;
|
|
2928
|
+
cookie?: never;
|
|
2929
|
+
};
|
|
2930
|
+
requestBody: {
|
|
2931
|
+
content: {
|
|
2932
|
+
"application/json": components["schemas"]["BugReportingRequest"];
|
|
2933
|
+
};
|
|
2934
|
+
};
|
|
2935
|
+
responses: {
|
|
2936
|
+
/** @description Prepare, submit or read a private bug report */
|
|
2937
|
+
200: {
|
|
2938
|
+
headers: {
|
|
2939
|
+
[name: string]: unknown;
|
|
2940
|
+
};
|
|
2941
|
+
content: {
|
|
2942
|
+
"application/json": components["schemas"]["BugReportingResponse"];
|
|
2943
|
+
};
|
|
2944
|
+
};
|
|
2945
|
+
/** @description Prepare, submit or read a private bug report */
|
|
2946
|
+
400: {
|
|
2947
|
+
headers: {
|
|
2948
|
+
[name: string]: unknown;
|
|
2949
|
+
};
|
|
2950
|
+
content: {
|
|
2951
|
+
"application/json": components["schemas"]["BugReportingError"];
|
|
2952
|
+
};
|
|
2953
|
+
};
|
|
2954
|
+
/** @description Prepare, submit or read a private bug report */
|
|
2955
|
+
401: {
|
|
2956
|
+
headers: {
|
|
2957
|
+
[name: string]: unknown;
|
|
2958
|
+
};
|
|
2959
|
+
content: {
|
|
2960
|
+
"application/json": components["schemas"]["BugReportingError"];
|
|
2961
|
+
};
|
|
2962
|
+
};
|
|
2963
|
+
/** @description Prepare, submit or read a private bug report */
|
|
2964
|
+
403: {
|
|
2965
|
+
headers: {
|
|
2966
|
+
[name: string]: unknown;
|
|
2967
|
+
};
|
|
2968
|
+
content: {
|
|
2969
|
+
"application/json": components["schemas"]["BugReportingError"];
|
|
2970
|
+
};
|
|
2971
|
+
};
|
|
2972
|
+
/** @description Prepare, submit or read a private bug report */
|
|
2973
|
+
404: {
|
|
2974
|
+
headers: {
|
|
2975
|
+
[name: string]: unknown;
|
|
2976
|
+
};
|
|
2977
|
+
content: {
|
|
2978
|
+
"application/json": components["schemas"]["BugReportingError"];
|
|
2979
|
+
};
|
|
2980
|
+
};
|
|
2981
|
+
/** @description Prepare, submit or read a private bug report */
|
|
2982
|
+
409: {
|
|
2983
|
+
headers: {
|
|
2984
|
+
[name: string]: unknown;
|
|
2985
|
+
};
|
|
2986
|
+
content: {
|
|
2987
|
+
"application/json": components["schemas"]["BugReportingError"];
|
|
2988
|
+
};
|
|
2989
|
+
};
|
|
2990
|
+
/** @description Prepare, submit or read a private bug report */
|
|
2991
|
+
413: {
|
|
2992
|
+
headers: {
|
|
2993
|
+
[name: string]: unknown;
|
|
2994
|
+
};
|
|
2995
|
+
content: {
|
|
2996
|
+
"application/json": components["schemas"]["BugReportingError"];
|
|
2997
|
+
};
|
|
2998
|
+
};
|
|
2999
|
+
/** @description Prepare, submit or read a private bug report */
|
|
3000
|
+
429: {
|
|
3001
|
+
headers: {
|
|
3002
|
+
[name: string]: unknown;
|
|
3003
|
+
};
|
|
3004
|
+
content: {
|
|
3005
|
+
"application/json": components["schemas"]["BugReportingError"];
|
|
3006
|
+
};
|
|
3007
|
+
};
|
|
3008
|
+
/** @description Prepare, submit or read a private bug report */
|
|
3009
|
+
503: {
|
|
3010
|
+
headers: {
|
|
3011
|
+
[name: string]: unknown;
|
|
3012
|
+
};
|
|
3013
|
+
content: {
|
|
3014
|
+
"application/json": components["schemas"]["BugReportingError"];
|
|
3015
|
+
};
|
|
3016
|
+
};
|
|
3017
|
+
};
|
|
3018
|
+
};
|
|
2648
3019
|
startHarvest: {
|
|
2649
3020
|
parameters: {
|
|
2650
3021
|
query?: never;
|
|
@@ -3591,11 +3962,7 @@ interface operations {
|
|
|
3591
3962
|
};
|
|
3592
3963
|
requestBody: {
|
|
3593
3964
|
content: {
|
|
3594
|
-
"application/json":
|
|
3595
|
-
/** @description A reddit.com or redd.it thread URL. */
|
|
3596
|
-
url: string;
|
|
3597
|
-
maxComments?: number;
|
|
3598
|
-
};
|
|
3965
|
+
"application/json": components["schemas"]["RedditThreadRequest"];
|
|
3599
3966
|
};
|
|
3600
3967
|
};
|
|
3601
3968
|
responses: {
|
|
@@ -3605,20 +3972,7 @@ interface operations {
|
|
|
3605
3972
|
[name: string]: unknown;
|
|
3606
3973
|
};
|
|
3607
3974
|
content: {
|
|
3608
|
-
"application/json":
|
|
3609
|
-
title?: string;
|
|
3610
|
-
author?: string | null;
|
|
3611
|
-
score?: string | null;
|
|
3612
|
-
postBody?: string;
|
|
3613
|
-
numComments?: number;
|
|
3614
|
-
comments?: {
|
|
3615
|
-
author?: string | null;
|
|
3616
|
-
score?: string;
|
|
3617
|
-
depth?: number;
|
|
3618
|
-
body?: string;
|
|
3619
|
-
}[];
|
|
3620
|
-
sourceUrl?: string;
|
|
3621
|
-
};
|
|
3975
|
+
"application/json": components["schemas"]["RedditThreadResponse"];
|
|
3622
3976
|
};
|
|
3623
3977
|
};
|
|
3624
3978
|
400: components["responses"]["BadRequest"];
|
|
@@ -3643,33 +3997,7 @@ interface operations {
|
|
|
3643
3997
|
};
|
|
3644
3998
|
requestBody: {
|
|
3645
3999
|
content: {
|
|
3646
|
-
"application/json":
|
|
3647
|
-
/** @description Topic in plain words, e.g. "crm for small business". Not a URL. */
|
|
3648
|
-
topic: string;
|
|
3649
|
-
/** @description Bare subreddit name to scope the scan, e.g. "SEO" (no r/ prefix). Omit to scan all of Reddit. */
|
|
3650
|
-
subreddit?: string;
|
|
3651
|
-
/**
|
|
3652
|
-
* @description How recent the threads must be.
|
|
3653
|
-
* @default month
|
|
3654
|
-
* @enum {string}
|
|
3655
|
-
*/
|
|
3656
|
-
window?: "week" | "month";
|
|
3657
|
-
/**
|
|
3658
|
-
* @description How many discovered threads to scrape and rank (scrape-all default). Lower to cap cost.
|
|
3659
|
-
* @default 20
|
|
3660
|
-
*/
|
|
3661
|
-
maxThreads?: number;
|
|
3662
|
-
/**
|
|
3663
|
-
* @description true = scrape each thread for engagement + questions and rank; false = cheap discovery-only list.
|
|
3664
|
-
* @default true
|
|
3665
|
-
*/
|
|
3666
|
-
includeComments?: boolean;
|
|
3667
|
-
/**
|
|
3668
|
-
* @description Comments captured (and billed) per scraped thread when includeComments is true.
|
|
3669
|
-
* @default 50
|
|
3670
|
-
*/
|
|
3671
|
-
maxCommentsPerThread?: number;
|
|
3672
|
-
};
|
|
4000
|
+
"application/json": components["schemas"]["RedditTrendingRequest"];
|
|
3673
4001
|
};
|
|
3674
4002
|
};
|
|
3675
4003
|
responses: {
|
|
@@ -3679,37 +4007,7 @@ interface operations {
|
|
|
3679
4007
|
[name: string]: unknown;
|
|
3680
4008
|
};
|
|
3681
4009
|
content: {
|
|
3682
|
-
"application/json":
|
|
3683
|
-
topic?: string;
|
|
3684
|
-
subreddit?: string | null;
|
|
3685
|
-
/** @description Resolved window, e.g. "7d" or "30d". */
|
|
3686
|
-
window?: string;
|
|
3687
|
-
totals?: {
|
|
3688
|
-
threads?: number;
|
|
3689
|
-
upvotes?: number;
|
|
3690
|
-
comments?: number;
|
|
3691
|
-
};
|
|
3692
|
-
rankedThreads?: {
|
|
3693
|
-
title?: string;
|
|
3694
|
-
url?: string;
|
|
3695
|
-
subreddit?: string;
|
|
3696
|
-
score?: number;
|
|
3697
|
-
commentCount?: number;
|
|
3698
|
-
engagementScore?: number;
|
|
3699
|
-
ageText?: string;
|
|
3700
|
-
topQuestions?: string[];
|
|
3701
|
-
}[];
|
|
3702
|
-
questions?: {
|
|
3703
|
-
question?: string;
|
|
3704
|
-
threadUrl?: string;
|
|
3705
|
-
}[];
|
|
3706
|
-
threadsScraped?: number;
|
|
3707
|
-
candidatesFound?: number;
|
|
3708
|
-
/** @description true if scraping stopped early at the time limit. */
|
|
3709
|
-
partial?: boolean;
|
|
3710
|
-
/** @description The Google site:reddit.com query used for discovery. */
|
|
3711
|
-
searchQuery?: string;
|
|
3712
|
-
};
|
|
4010
|
+
"application/json": components["schemas"]["RedditTrendingResponse"];
|
|
3713
4011
|
};
|
|
3714
4012
|
};
|
|
3715
4013
|
400: components["responses"]["BadRequest"];
|
|
@@ -4905,6 +5203,7 @@ declare class RedditNamespace {
|
|
|
4905
5203
|
author?: string | null;
|
|
4906
5204
|
score?: string | null;
|
|
4907
5205
|
postBody?: string;
|
|
5206
|
+
publishedAt?: string | null;
|
|
4908
5207
|
numComments?: number;
|
|
4909
5208
|
comments?: {
|
|
4910
5209
|
author?: string | null;
|
|
@@ -5415,6 +5714,42 @@ declare class ScraperClient {
|
|
|
5415
5714
|
job_id: string;
|
|
5416
5715
|
status: "pending";
|
|
5417
5716
|
}>;
|
|
5717
|
+
bugReporting(params: RequestBodyOf<'bugReporting'>, options?: ScraperRequestOptions): Promise<{
|
|
5718
|
+
ok: true;
|
|
5719
|
+
accountEmail: string;
|
|
5720
|
+
reportId: string;
|
|
5721
|
+
status: "draft" | "submitted";
|
|
5722
|
+
receivedAt: string;
|
|
5723
|
+
submittedAt: string | null;
|
|
5724
|
+
expiresAt: string;
|
|
5725
|
+
report: {
|
|
5726
|
+
title: string;
|
|
5727
|
+
goal: string;
|
|
5728
|
+
expected: string;
|
|
5729
|
+
actual: string;
|
|
5730
|
+
steps: string[];
|
|
5731
|
+
attempts: {
|
|
5732
|
+
tool: string;
|
|
5733
|
+
submittedAt?: string;
|
|
5734
|
+
arguments: string;
|
|
5735
|
+
result: string;
|
|
5736
|
+
requestId?: string;
|
|
5737
|
+
jobId?: string;
|
|
5738
|
+
}[];
|
|
5739
|
+
client: {
|
|
5740
|
+
name: string;
|
|
5741
|
+
version?: string;
|
|
5742
|
+
transport: "oauth" | "api-key" | "npx" | "npm" | "sdk" | "mcpb" | "rest" | "unknown";
|
|
5743
|
+
operatingSystem?: string;
|
|
5744
|
+
model?: string;
|
|
5745
|
+
};
|
|
5746
|
+
context?: string;
|
|
5747
|
+
missing: string[];
|
|
5748
|
+
};
|
|
5749
|
+
reviewToken?: string;
|
|
5750
|
+
redacted: boolean;
|
|
5751
|
+
message: string;
|
|
5752
|
+
}>;
|
|
5418
5753
|
searchSerp(params: SearchSerpParams, options?: ScraperRequestOptions): Promise<{
|
|
5419
5754
|
job_id: string;
|
|
5420
5755
|
status: "done" | "cancelled" | "failed";
|
package/dist/index.js
CHANGED
|
@@ -662,6 +662,17 @@ var ScraperClient = class {
|
|
|
662
662
|
options
|
|
663
663
|
);
|
|
664
664
|
}
|
|
665
|
+
async bugReporting(params, options = {}) {
|
|
666
|
+
try {
|
|
667
|
+
return await this.r.call("POST", "/bugs/report", params, {}, options);
|
|
668
|
+
} catch (error) {
|
|
669
|
+
if (error instanceof ScraperApiError && error.code === "mcp_request_timeout") {
|
|
670
|
+
const message = params.action === "prepare" || params.action === void 0 ? "Draft preparation was not confirmed. An unreturned draft expires after one day; prepare never submits a report." : "Submission was not confirmed. Read status with the same reportId, then retry submit with the same reportId and reviewToken if needed. Bug Reporting is free.";
|
|
671
|
+
throw new ScraperApiError(408, { error_code: "mcp_request_timeout", error_type: "timeout", message, retryable: true, charge_status: "not_charged" }, { requestId: error.requestId });
|
|
672
|
+
}
|
|
673
|
+
throw error;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
665
676
|
searchSerp(params, options = {}) {
|
|
666
677
|
return this.r.call("POST", "/harvest/sync", { ...params, serpOnly: true }, {}, options);
|
|
667
678
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcpscraper-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Official Node.js client for all
|
|
3
|
+
"version": "0.57.0",
|
|
4
|
+
"description": "Official Node.js client for all 348 mcpscraper.dev MCP tools and the REST API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.cjs",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"seo-api"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"mcpscraper-memory-sdk": "^0.
|
|
35
|
+
"mcpscraper-memory-sdk": "^0.56.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"openapi-typescript": "^7.13.0"
|