mcpscraper-sdk 0.18.0 → 0.20.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/dist/index.d.cts CHANGED
@@ -479,6 +479,32 @@ interface paths {
479
479
  patch?: never;
480
480
  trace?: never;
481
481
  };
482
+ "/reddit/trending": {
483
+ parameters: {
484
+ query?: never;
485
+ header?: never;
486
+ path?: never;
487
+ cookie?: never;
488
+ };
489
+ get?: never;
490
+ put?: never;
491
+ /**
492
+ * Discover and rank the top recent Reddit threads for a topic
493
+ * @description Finds relevant recent Reddit threads via a Google site:reddit.com search over a week/month window,
494
+ * then (by default) scrapes them all in parallel for real upvotes, comments, and the questions people
495
+ * asked, and ranks by engagement (upvotes + 2x comments). Billing: one discovery debit plus, when
496
+ * includeComments is true, 30 credits per scraped thread and 2 credits per captured comment, each
497
+ * refunded on failure. Set includeComments:false for a cheap discovery-only sweep (thread list, no
498
+ * engagement stats, no per-thread billing). Scraping respects a soft deadline and returns partial:true
499
+ * if it stops early rather than exceeding the request limit.
500
+ */
501
+ post: operations["redditTrending"];
502
+ delete?: never;
503
+ options?: never;
504
+ head?: never;
505
+ patch?: never;
506
+ trace?: never;
507
+ };
482
508
  "/video/analyze": {
483
509
  parameters: {
484
510
  query?: never;
@@ -820,9 +846,6 @@ interface components {
820
846
  error_type: string;
821
847
  message: string;
822
848
  retryable: boolean;
823
- attempts?: {
824
- [key: string]: unknown;
825
- }[];
826
849
  };
827
850
  InsufficientBalanceError: {
828
851
  /** @enum {string} */
@@ -898,6 +921,11 @@ interface components {
898
921
  * @default false
899
922
  */
900
923
  serpOnly: boolean;
924
+ /**
925
+ * @description Optional Google time filter (past day/week/month/year). Omit for all-time. Pairs well with a site: operator in the query.
926
+ * @enum {string}
927
+ */
928
+ recency?: "day" | "week" | "month" | "year";
901
929
  /** @default false */
902
930
  debug: boolean;
903
931
  };
@@ -909,9 +937,6 @@ interface components {
909
937
  result?: {
910
938
  [key: string]: unknown;
911
939
  };
912
- attempts?: {
913
- [key: string]: unknown;
914
- }[];
915
940
  error?: string;
916
941
  };
917
942
  JobRecord: {
@@ -921,9 +946,6 @@ interface components {
921
946
  result?: {
922
947
  [key: string]: unknown;
923
948
  } | null;
924
- attempts?: {
925
- [key: string]: unknown;
926
- }[];
927
949
  created_at?: string;
928
950
  };
929
951
  ExtractUrlRequest: {
@@ -1397,20 +1419,8 @@ interface components {
1397
1419
  message?: string;
1398
1420
  } | null;
1399
1421
  };
1400
- SerpIntelligenceCaptureAttempt: {
1401
- attemptNumber?: number;
1402
- outcome?: string;
1403
- startedAt?: string;
1404
- completedAt?: string;
1405
- durationMs?: number;
1406
- problemCode?: string;
1407
- message?: string;
1408
- browserSessionId?: string | null;
1409
- cleanupSucceeded?: boolean | null;
1410
- };
1411
1422
  SerpIntelligenceCaptureResponse: {
1412
1423
  harvestResult?: components["schemas"]["SerpIntelligenceHarvestResult"];
1413
- attempts?: components["schemas"]["SerpIntelligenceCaptureAttempt"][];
1414
1424
  locationEvidence?: {
1415
1425
  [key: string]: unknown;
1416
1426
  } | null;
@@ -1421,7 +1431,6 @@ interface components {
1421
1431
  };
1422
1432
  SerpIntelligencePageSnapshotsResponse: {
1423
1433
  pageSnapshotArtifacts?: components["schemas"]["SerpPageSnapshotCapture"][];
1424
- attempts?: components["schemas"]["SerpIntelligenceCaptureAttempt"][];
1425
1434
  };
1426
1435
  WorkflowRun: {
1427
1436
  id?: string;
@@ -2465,6 +2474,97 @@ interface operations {
2465
2474
  };
2466
2475
  };
2467
2476
  };
2477
+ redditTrending: {
2478
+ parameters: {
2479
+ query?: never;
2480
+ header?: never;
2481
+ path?: never;
2482
+ cookie?: never;
2483
+ };
2484
+ requestBody: {
2485
+ content: {
2486
+ "application/json": {
2487
+ /** @description Topic in plain words, e.g. "crm for small business". Not a URL. */
2488
+ topic: string;
2489
+ /** @description Bare subreddit name to scope the scan, e.g. "SEO" (no r/ prefix). Omit to scan all of Reddit. */
2490
+ subreddit?: string;
2491
+ /**
2492
+ * @description How recent the threads must be.
2493
+ * @default month
2494
+ * @enum {string}
2495
+ */
2496
+ window?: "week" | "month";
2497
+ /**
2498
+ * @description How many discovered threads to scrape and rank (scrape-all default). Lower to cap cost.
2499
+ * @default 20
2500
+ */
2501
+ maxThreads?: number;
2502
+ /**
2503
+ * @description true = scrape each thread for engagement + questions and rank; false = cheap discovery-only list.
2504
+ * @default true
2505
+ */
2506
+ includeComments?: boolean;
2507
+ /**
2508
+ * @description Comments captured (and billed) per scraped thread when includeComments is true.
2509
+ * @default 50
2510
+ */
2511
+ maxCommentsPerThread?: number;
2512
+ };
2513
+ };
2514
+ };
2515
+ responses: {
2516
+ /** @description Ranked trending threads. */
2517
+ 200: {
2518
+ headers: {
2519
+ [name: string]: unknown;
2520
+ };
2521
+ content: {
2522
+ "application/json": {
2523
+ topic?: string;
2524
+ subreddit?: string | null;
2525
+ /** @description Resolved window, e.g. "7d" or "30d". */
2526
+ window?: string;
2527
+ totals?: {
2528
+ threads?: number;
2529
+ upvotes?: number;
2530
+ comments?: number;
2531
+ };
2532
+ rankedThreads?: {
2533
+ title?: string;
2534
+ url?: string;
2535
+ subreddit?: string;
2536
+ score?: number;
2537
+ commentCount?: number;
2538
+ engagementScore?: number;
2539
+ ageText?: string;
2540
+ topQuestions?: string[];
2541
+ }[];
2542
+ questions?: {
2543
+ question?: string;
2544
+ threadUrl?: string;
2545
+ }[];
2546
+ threadsScraped?: number;
2547
+ candidatesFound?: number;
2548
+ /** @description true if scraping stopped early at the time limit. */
2549
+ partial?: boolean;
2550
+ /** @description The Google site:reddit.com query used for discovery. */
2551
+ searchQuery?: string;
2552
+ };
2553
+ };
2554
+ };
2555
+ 400: components["responses"]["BadRequest"];
2556
+ 402: components["responses"]["InsufficientBalance"];
2557
+ /** @description No Reddit threads found for that topic and window — billed amount was refunded. */
2558
+ 404: {
2559
+ headers: {
2560
+ [name: string]: unknown;
2561
+ };
2562
+ content?: never;
2563
+ };
2564
+ 429: components["responses"]["ConcurrencyLimitExceeded"];
2565
+ 500: components["responses"]["ServerError"];
2566
+ };
2567
+ };
2468
2568
  videoAnalyze: {
2469
2569
  parameters: {
2470
2570
  query?: never;
@@ -3380,7 +3480,6 @@ declare class SerpIntelligenceNamespace {
3380
3480
  constructor(r: Requester);
3381
3481
  capture(params: SerpIntelligenceCaptureParams, options?: SerpIntelligenceCaptureOptions): Promise<{
3382
3482
  harvestResult?: components["schemas"]["SerpIntelligenceHarvestResult"];
3383
- attempts?: components["schemas"]["SerpIntelligenceCaptureAttempt"][];
3384
3483
  locationEvidence?: {
3385
3484
  [key: string]: unknown;
3386
3485
  } | null;
@@ -3392,7 +3491,6 @@ declare class SerpIntelligenceNamespace {
3392
3491
  captureWithReceipt(params: SerpIntelligenceCaptureParams, options?: SerpIntelligenceCaptureOptions): Promise<SerpIntelligenceCaptureReceipt>;
3393
3492
  pageSnapshots(params: RequestBodyOf<'serpIntelligencePageSnapshots'>): Promise<{
3394
3493
  pageSnapshotArtifacts?: components["schemas"]["SerpPageSnapshotCapture"][];
3395
- attempts?: components["schemas"]["SerpIntelligenceCaptureAttempt"][];
3396
3494
  }>;
3397
3495
  }
3398
3496
  declare class WorkflowsNamespace {
@@ -3512,9 +3610,6 @@ declare class ScraperClient {
3512
3610
  result?: {
3513
3611
  [key: string]: unknown;
3514
3612
  };
3515
- attempts?: {
3516
- [key: string]: unknown;
3517
- }[];
3518
3613
  error?: string;
3519
3614
  }>;
3520
3615
  harvestPaa(params: RequestBodyOf<'harvestSync'>): Promise<{
@@ -3523,9 +3618,6 @@ declare class ScraperClient {
3523
3618
  result?: {
3524
3619
  [key: string]: unknown;
3525
3620
  };
3526
- attempts?: {
3527
- [key: string]: unknown;
3528
- }[];
3529
3621
  error?: string;
3530
3622
  }>;
3531
3623
  extractUrl(params: RequestBodyOf<'extractUrl'>): Promise<{
@@ -3752,9 +3844,6 @@ declare class ScraperClient {
3752
3844
  result?: {
3753
3845
  [key: string]: unknown;
3754
3846
  } | null;
3755
- attempts?: {
3756
- [key: string]: unknown;
3757
- }[];
3758
3847
  created_at?: string;
3759
3848
  }[]>;
3760
3849
  getJob(id: string): Promise<{
@@ -3764,9 +3853,6 @@ declare class ScraperClient {
3764
3853
  result?: {
3765
3854
  [key: string]: unknown;
3766
3855
  } | null;
3767
- attempts?: {
3768
- [key: string]: unknown;
3769
- }[];
3770
3856
  created_at?: string;
3771
3857
  }>;
3772
3858
  getHistory(): Promise<{
package/dist/index.d.ts CHANGED
@@ -479,6 +479,32 @@ interface paths {
479
479
  patch?: never;
480
480
  trace?: never;
481
481
  };
482
+ "/reddit/trending": {
483
+ parameters: {
484
+ query?: never;
485
+ header?: never;
486
+ path?: never;
487
+ cookie?: never;
488
+ };
489
+ get?: never;
490
+ put?: never;
491
+ /**
492
+ * Discover and rank the top recent Reddit threads for a topic
493
+ * @description Finds relevant recent Reddit threads via a Google site:reddit.com search over a week/month window,
494
+ * then (by default) scrapes them all in parallel for real upvotes, comments, and the questions people
495
+ * asked, and ranks by engagement (upvotes + 2x comments). Billing: one discovery debit plus, when
496
+ * includeComments is true, 30 credits per scraped thread and 2 credits per captured comment, each
497
+ * refunded on failure. Set includeComments:false for a cheap discovery-only sweep (thread list, no
498
+ * engagement stats, no per-thread billing). Scraping respects a soft deadline and returns partial:true
499
+ * if it stops early rather than exceeding the request limit.
500
+ */
501
+ post: operations["redditTrending"];
502
+ delete?: never;
503
+ options?: never;
504
+ head?: never;
505
+ patch?: never;
506
+ trace?: never;
507
+ };
482
508
  "/video/analyze": {
483
509
  parameters: {
484
510
  query?: never;
@@ -820,9 +846,6 @@ interface components {
820
846
  error_type: string;
821
847
  message: string;
822
848
  retryable: boolean;
823
- attempts?: {
824
- [key: string]: unknown;
825
- }[];
826
849
  };
827
850
  InsufficientBalanceError: {
828
851
  /** @enum {string} */
@@ -898,6 +921,11 @@ interface components {
898
921
  * @default false
899
922
  */
900
923
  serpOnly: boolean;
924
+ /**
925
+ * @description Optional Google time filter (past day/week/month/year). Omit for all-time. Pairs well with a site: operator in the query.
926
+ * @enum {string}
927
+ */
928
+ recency?: "day" | "week" | "month" | "year";
901
929
  /** @default false */
902
930
  debug: boolean;
903
931
  };
@@ -909,9 +937,6 @@ interface components {
909
937
  result?: {
910
938
  [key: string]: unknown;
911
939
  };
912
- attempts?: {
913
- [key: string]: unknown;
914
- }[];
915
940
  error?: string;
916
941
  };
917
942
  JobRecord: {
@@ -921,9 +946,6 @@ interface components {
921
946
  result?: {
922
947
  [key: string]: unknown;
923
948
  } | null;
924
- attempts?: {
925
- [key: string]: unknown;
926
- }[];
927
949
  created_at?: string;
928
950
  };
929
951
  ExtractUrlRequest: {
@@ -1397,20 +1419,8 @@ interface components {
1397
1419
  message?: string;
1398
1420
  } | null;
1399
1421
  };
1400
- SerpIntelligenceCaptureAttempt: {
1401
- attemptNumber?: number;
1402
- outcome?: string;
1403
- startedAt?: string;
1404
- completedAt?: string;
1405
- durationMs?: number;
1406
- problemCode?: string;
1407
- message?: string;
1408
- browserSessionId?: string | null;
1409
- cleanupSucceeded?: boolean | null;
1410
- };
1411
1422
  SerpIntelligenceCaptureResponse: {
1412
1423
  harvestResult?: components["schemas"]["SerpIntelligenceHarvestResult"];
1413
- attempts?: components["schemas"]["SerpIntelligenceCaptureAttempt"][];
1414
1424
  locationEvidence?: {
1415
1425
  [key: string]: unknown;
1416
1426
  } | null;
@@ -1421,7 +1431,6 @@ interface components {
1421
1431
  };
1422
1432
  SerpIntelligencePageSnapshotsResponse: {
1423
1433
  pageSnapshotArtifacts?: components["schemas"]["SerpPageSnapshotCapture"][];
1424
- attempts?: components["schemas"]["SerpIntelligenceCaptureAttempt"][];
1425
1434
  };
1426
1435
  WorkflowRun: {
1427
1436
  id?: string;
@@ -2465,6 +2474,97 @@ interface operations {
2465
2474
  };
2466
2475
  };
2467
2476
  };
2477
+ redditTrending: {
2478
+ parameters: {
2479
+ query?: never;
2480
+ header?: never;
2481
+ path?: never;
2482
+ cookie?: never;
2483
+ };
2484
+ requestBody: {
2485
+ content: {
2486
+ "application/json": {
2487
+ /** @description Topic in plain words, e.g. "crm for small business". Not a URL. */
2488
+ topic: string;
2489
+ /** @description Bare subreddit name to scope the scan, e.g. "SEO" (no r/ prefix). Omit to scan all of Reddit. */
2490
+ subreddit?: string;
2491
+ /**
2492
+ * @description How recent the threads must be.
2493
+ * @default month
2494
+ * @enum {string}
2495
+ */
2496
+ window?: "week" | "month";
2497
+ /**
2498
+ * @description How many discovered threads to scrape and rank (scrape-all default). Lower to cap cost.
2499
+ * @default 20
2500
+ */
2501
+ maxThreads?: number;
2502
+ /**
2503
+ * @description true = scrape each thread for engagement + questions and rank; false = cheap discovery-only list.
2504
+ * @default true
2505
+ */
2506
+ includeComments?: boolean;
2507
+ /**
2508
+ * @description Comments captured (and billed) per scraped thread when includeComments is true.
2509
+ * @default 50
2510
+ */
2511
+ maxCommentsPerThread?: number;
2512
+ };
2513
+ };
2514
+ };
2515
+ responses: {
2516
+ /** @description Ranked trending threads. */
2517
+ 200: {
2518
+ headers: {
2519
+ [name: string]: unknown;
2520
+ };
2521
+ content: {
2522
+ "application/json": {
2523
+ topic?: string;
2524
+ subreddit?: string | null;
2525
+ /** @description Resolved window, e.g. "7d" or "30d". */
2526
+ window?: string;
2527
+ totals?: {
2528
+ threads?: number;
2529
+ upvotes?: number;
2530
+ comments?: number;
2531
+ };
2532
+ rankedThreads?: {
2533
+ title?: string;
2534
+ url?: string;
2535
+ subreddit?: string;
2536
+ score?: number;
2537
+ commentCount?: number;
2538
+ engagementScore?: number;
2539
+ ageText?: string;
2540
+ topQuestions?: string[];
2541
+ }[];
2542
+ questions?: {
2543
+ question?: string;
2544
+ threadUrl?: string;
2545
+ }[];
2546
+ threadsScraped?: number;
2547
+ candidatesFound?: number;
2548
+ /** @description true if scraping stopped early at the time limit. */
2549
+ partial?: boolean;
2550
+ /** @description The Google site:reddit.com query used for discovery. */
2551
+ searchQuery?: string;
2552
+ };
2553
+ };
2554
+ };
2555
+ 400: components["responses"]["BadRequest"];
2556
+ 402: components["responses"]["InsufficientBalance"];
2557
+ /** @description No Reddit threads found for that topic and window — billed amount was refunded. */
2558
+ 404: {
2559
+ headers: {
2560
+ [name: string]: unknown;
2561
+ };
2562
+ content?: never;
2563
+ };
2564
+ 429: components["responses"]["ConcurrencyLimitExceeded"];
2565
+ 500: components["responses"]["ServerError"];
2566
+ };
2567
+ };
2468
2568
  videoAnalyze: {
2469
2569
  parameters: {
2470
2570
  query?: never;
@@ -3380,7 +3480,6 @@ declare class SerpIntelligenceNamespace {
3380
3480
  constructor(r: Requester);
3381
3481
  capture(params: SerpIntelligenceCaptureParams, options?: SerpIntelligenceCaptureOptions): Promise<{
3382
3482
  harvestResult?: components["schemas"]["SerpIntelligenceHarvestResult"];
3383
- attempts?: components["schemas"]["SerpIntelligenceCaptureAttempt"][];
3384
3483
  locationEvidence?: {
3385
3484
  [key: string]: unknown;
3386
3485
  } | null;
@@ -3392,7 +3491,6 @@ declare class SerpIntelligenceNamespace {
3392
3491
  captureWithReceipt(params: SerpIntelligenceCaptureParams, options?: SerpIntelligenceCaptureOptions): Promise<SerpIntelligenceCaptureReceipt>;
3393
3492
  pageSnapshots(params: RequestBodyOf<'serpIntelligencePageSnapshots'>): Promise<{
3394
3493
  pageSnapshotArtifacts?: components["schemas"]["SerpPageSnapshotCapture"][];
3395
- attempts?: components["schemas"]["SerpIntelligenceCaptureAttempt"][];
3396
3494
  }>;
3397
3495
  }
3398
3496
  declare class WorkflowsNamespace {
@@ -3512,9 +3610,6 @@ declare class ScraperClient {
3512
3610
  result?: {
3513
3611
  [key: string]: unknown;
3514
3612
  };
3515
- attempts?: {
3516
- [key: string]: unknown;
3517
- }[];
3518
3613
  error?: string;
3519
3614
  }>;
3520
3615
  harvestPaa(params: RequestBodyOf<'harvestSync'>): Promise<{
@@ -3523,9 +3618,6 @@ declare class ScraperClient {
3523
3618
  result?: {
3524
3619
  [key: string]: unknown;
3525
3620
  };
3526
- attempts?: {
3527
- [key: string]: unknown;
3528
- }[];
3529
3621
  error?: string;
3530
3622
  }>;
3531
3623
  extractUrl(params: RequestBodyOf<'extractUrl'>): Promise<{
@@ -3752,9 +3844,6 @@ declare class ScraperClient {
3752
3844
  result?: {
3753
3845
  [key: string]: unknown;
3754
3846
  } | null;
3755
- attempts?: {
3756
- [key: string]: unknown;
3757
- }[];
3758
3847
  created_at?: string;
3759
3848
  }[]>;
3760
3849
  getJob(id: string): Promise<{
@@ -3764,9 +3853,6 @@ declare class ScraperClient {
3764
3853
  result?: {
3765
3854
  [key: string]: unknown;
3766
3855
  } | null;
3767
- attempts?: {
3768
- [key: string]: unknown;
3769
- }[];
3770
3856
  created_at?: string;
3771
3857
  }>;
3772
3858
  getHistory(): Promise<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcpscraper-sdk",
3
- "version": "0.18.0",
3
+ "version": "0.20.0",
4
4
  "description": "Official Node.js client for all 165 mcpscraper.dev MCP tools and the REST API",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  "seo-api"
33
33
  ],
34
34
  "dependencies": {
35
- "mcpscraper-memory-sdk": "^0.18.0"
35
+ "mcpscraper-memory-sdk": "^0.19.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "openapi-typescript": "^7.13.0"