@decodo/sdk-ts 2.1.0 → 2.1.1

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.
Files changed (53) hide show
  1. package/build/cjs/index.cjs +3104 -0
  2. package/build/cjs/index.d.cts +900 -0
  3. package/package.json +9 -5
  4. package/build/cjs/api/web-scraping-api.d.ts +0 -15
  5. package/build/cjs/api/web-scraping-api.js +0 -43
  6. package/build/cjs/client.d.ts +0 -13
  7. package/build/cjs/client.js +0 -36
  8. package/build/cjs/errors.d.ts +0 -18
  9. package/build/cjs/errors.js +0 -44
  10. package/build/cjs/generated/parameters.d.ts +0 -11
  11. package/build/cjs/generated/parameters.js +0 -82
  12. package/build/cjs/generated/request-schemas.d.ts +0 -1951
  13. package/build/cjs/generated/request-schemas.js +0 -2241
  14. package/build/cjs/generated/targets.d.ts +0 -675
  15. package/build/cjs/generated/targets.js +0 -319
  16. package/build/cjs/http.d.ts +0 -22
  17. package/build/cjs/http.js +0 -95
  18. package/build/cjs/index.d.ts +0 -12
  19. package/build/cjs/index.js +0 -23
  20. package/build/cjs/schema/build-request-schemas.d.ts +0 -4
  21. package/build/cjs/schema/build-request-schemas.js +0 -56
  22. package/build/cjs/schema/build-target-meta.d.ts +0 -3
  23. package/build/cjs/schema/build-target-meta.js +0 -19
  24. package/build/cjs/schema/bundled-provider.d.ts +0 -2
  25. package/build/cjs/schema/bundled-provider.js +0 -9
  26. package/build/cjs/schema/bundled-schema.d.ts +0 -10
  27. package/build/cjs/schema/bundled-schema.js +0 -24
  28. package/build/cjs/schema/constants.d.ts +0 -5
  29. package/build/cjs/schema/constants.js +0 -8
  30. package/build/cjs/schema/expand-path.d.ts +0 -1
  31. package/build/cjs/schema/expand-path.js +0 -15
  32. package/build/cjs/schema/remote-provider.d.ts +0 -8
  33. package/build/cjs/schema/remote-provider.js +0 -120
  34. package/build/cjs/schema/remote-schema.d.ts +0 -19
  35. package/build/cjs/schema/remote-schema.js +0 -149
  36. package/build/cjs/schema/resolve-latest-ir.d.ts +0 -2
  37. package/build/cjs/schema/resolve-latest-ir.js +0 -55
  38. package/build/cjs/schema/resolve-provider.d.ts +0 -3
  39. package/build/cjs/schema/resolve-provider.js +0 -27
  40. package/build/cjs/schema/types.d.ts +0 -44
  41. package/build/cjs/schema/types.js +0 -2
  42. package/build/cjs/types/requests.d.ts +0 -1
  43. package/build/cjs/types/requests.js +0 -2
  44. package/build/cjs/types/responses.d.ts +0 -62
  45. package/build/cjs/types/responses.js +0 -2
  46. package/build/esm/schema/build-request-schemas.d.ts +0 -4
  47. package/build/esm/schema/build-request-schemas.js +0 -18
  48. package/build/esm/schema/bundled-provider.d.ts +0 -2
  49. package/build/esm/schema/bundled-provider.js +0 -6
  50. package/build/esm/schema/remote-provider.d.ts +0 -8
  51. package/build/esm/schema/remote-provider.js +0 -83
  52. package/build/esm/schema/resolve-provider.d.ts +0 -3
  53. package/build/esm/schema/resolve-provider.js +0 -22
@@ -0,0 +1,900 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ import { JSONSchema4 } from 'json-schema';
4
+ import { z } from 'zod';
5
+
6
+ export type BasicAuth = {
7
+ type: "basic";
8
+ token: string;
9
+ };
10
+ export type ApiKeyAuth = {
11
+ type: "apiKey";
12
+ apiKey: string;
13
+ };
14
+ export type HttpClientConfig = {
15
+ baseUrl: string;
16
+ auth: BasicAuth | ApiKeyAuth;
17
+ timeoutMs: number;
18
+ };
19
+ declare class HttpClient {
20
+ private readonly baseUrl;
21
+ private readonly authHeader;
22
+ private readonly timeoutMs;
23
+ constructor(config: HttpClientConfig);
24
+ request<T>(method: string, path: string, body?: unknown): Promise<T>;
25
+ post<T>(path: string, body: unknown): Promise<T>;
26
+ get<T>(path: string, query?: Record<string, string>): Promise<T>;
27
+ }
28
+ /**
29
+ * Scrape target discriminator (wire string values).
30
+ */
31
+ export declare enum Target {
32
+ UniversalEcommerce = "universal_ecommerce",
33
+ GoogleSearch = "google_search",
34
+ GoogleTravelHotels = "google_travel_hotels",
35
+ GoogleTrendsExplore = "google_trends_explore",
36
+ GoogleShoppingSearch = "google_shopping_search",
37
+ GoogleShoppingProduct = "google_shopping_product",
38
+ Google = "google",
39
+ GoogleSuggest = "google_suggest",
40
+ GoogleMaps = "google_maps",
41
+ GoogleAiMode = "google_ai_mode",
42
+ GoogleAds = "google_ads",
43
+ GoogleLens = "google_lens",
44
+ BingSearch = "bing_search",
45
+ Bing = "bing",
46
+ YoutubeTranscript = "youtube_transcript",
47
+ AmazonProduct = "amazon_product",
48
+ AmazonPricing = "amazon_pricing",
49
+ AmazonSearch = "amazon_search",
50
+ AmazonSellers = "amazon_sellers",
51
+ AmazonBestsellers = "amazon_bestsellers",
52
+ Amazon = "amazon",
53
+ Ecommerce = "ecommerce",
54
+ WalmartProduct = "walmart_product",
55
+ WalmartSearch = "walmart_search",
56
+ Walmart = "walmart",
57
+ TargetProduct = "target_product",
58
+ TargetSearch = "target_search",
59
+ Target = "target",
60
+ LowesSearch = "lowes_search",
61
+ Universal = "universal",
62
+ Chatgpt = "chatgpt",
63
+ Perplexity = "perplexity",
64
+ Bbb = "bbb",
65
+ Autotrader = "autotrader",
66
+ Mobile = "mobile",
67
+ Airbnb = "airbnb",
68
+ AppleAppStore = "apple_app_store",
69
+ InstagramGraphqlProfile = "instagram_graphql_profile",
70
+ TiktokPost = "tiktok_post",
71
+ TiktokShopSearch = "tiktok_shop_search",
72
+ TiktokShopProduct = "tiktok_shop_product",
73
+ Tiktok = "tiktok",
74
+ RedditPost = "reddit_post",
75
+ RedditSubreddit = "reddit_subreddit",
76
+ RedditUser = "reddit_user",
77
+ YoutubeVideo = "youtube_video",
78
+ YoutubeMetadata = "youtube_metadata",
79
+ YoutubeSearch = "youtube_search",
80
+ YoutubeSearchMax = "youtube_search_max",
81
+ YoutubeSubtitles = "youtube_subtitles",
82
+ YoutubeChannel = "youtube_channel"
83
+ }
84
+ /** API discriminator string literals (same values as {@link Target}). */
85
+ export type TargetString = (typeof Target)[keyof typeof Target];
86
+ export declare const targets: readonly [
87
+ Target.UniversalEcommerce,
88
+ Target.GoogleSearch,
89
+ Target.GoogleTravelHotels,
90
+ Target.GoogleTrendsExplore,
91
+ Target.GoogleShoppingSearch,
92
+ Target.GoogleShoppingProduct,
93
+ Target.Google,
94
+ Target.GoogleSuggest,
95
+ Target.GoogleMaps,
96
+ Target.GoogleAiMode,
97
+ Target.GoogleAds,
98
+ Target.GoogleLens,
99
+ Target.BingSearch,
100
+ Target.Bing,
101
+ Target.YoutubeTranscript,
102
+ Target.AmazonProduct,
103
+ Target.AmazonPricing,
104
+ Target.AmazonSearch,
105
+ Target.AmazonSellers,
106
+ Target.AmazonBestsellers,
107
+ Target.Amazon,
108
+ Target.Ecommerce,
109
+ Target.WalmartProduct,
110
+ Target.WalmartSearch,
111
+ Target.Walmart,
112
+ Target.TargetProduct,
113
+ Target.TargetSearch,
114
+ Target.Target,
115
+ Target.LowesSearch,
116
+ Target.Universal,
117
+ Target.Chatgpt,
118
+ Target.Perplexity,
119
+ Target.Bbb,
120
+ Target.Autotrader,
121
+ Target.Mobile,
122
+ Target.Airbnb,
123
+ Target.AppleAppStore,
124
+ Target.InstagramGraphqlProfile,
125
+ Target.TiktokPost,
126
+ Target.TiktokShopSearch,
127
+ Target.TiktokShopProduct,
128
+ Target.Tiktok,
129
+ Target.RedditPost,
130
+ Target.RedditSubreddit,
131
+ Target.RedditUser,
132
+ Target.YoutubeVideo,
133
+ Target.YoutubeMetadata,
134
+ Target.YoutubeSearch,
135
+ Target.YoutubeSearchMax,
136
+ Target.YoutubeSubtitles,
137
+ Target.YoutubeChannel
138
+ ];
139
+ export interface UniversalEcommerceParams {
140
+ callback_url?: string;
141
+ }
142
+ export interface GoogleSearchParams {
143
+ query?: string;
144
+ headless?: "html" | "png";
145
+ locale?: string;
146
+ geo?: string;
147
+ device_type?: string;
148
+ page_from?: number;
149
+ google_results_language?: string;
150
+ google_tbm?: string;
151
+ google_tbs?: string;
152
+ parse?: boolean;
153
+ google_nfpr?: boolean;
154
+ google_safe_search?: boolean;
155
+ session_id?: string;
156
+ xhr?: boolean;
157
+ markdown?: boolean;
158
+ page_count?: number;
159
+ callback_url?: string;
160
+ }
161
+ export interface GoogleTravelHotelsParams {
162
+ query?: string;
163
+ headless?: "html" | "png";
164
+ locale?: string;
165
+ device_type?: string;
166
+ page_from?: number;
167
+ date_range?: string;
168
+ stars?: number;
169
+ adults?: number;
170
+ children?: number;
171
+ session_id?: string;
172
+ markdown?: boolean;
173
+ callback_url?: string;
174
+ }
175
+ export interface GoogleTrendsExploreParams {
176
+ query?: string;
177
+ geo?: string;
178
+ device_type?: string;
179
+ search_type?: string;
180
+ date_start?: string;
181
+ date_end?: string;
182
+ callback_url?: string;
183
+ }
184
+ export interface GoogleShoppingSearchParams {
185
+ query?: string;
186
+ headless?: "html" | "png";
187
+ locale?: string;
188
+ geo?: string;
189
+ device_type?: string;
190
+ page_from?: number;
191
+ google_tbs?: string;
192
+ parse?: boolean;
193
+ session_id?: string;
194
+ google_results_language?: string;
195
+ markdown?: boolean;
196
+ callback_url?: string;
197
+ }
198
+ export interface GoogleShoppingProductParams {
199
+ query?: string;
200
+ headless?: "html" | "png";
201
+ locale?: string;
202
+ geo?: string;
203
+ device_type?: string;
204
+ page_from?: number;
205
+ parse?: boolean;
206
+ session_id?: string;
207
+ google_results_language?: string;
208
+ markdown?: boolean;
209
+ xhr?: boolean;
210
+ callback_url?: string;
211
+ }
212
+ export interface GoogleParams {
213
+ url?: string;
214
+ headless?: "html" | "png";
215
+ locale?: string;
216
+ device_type?: string;
217
+ parse?: boolean;
218
+ session_id?: string;
219
+ markdown?: boolean;
220
+ xhr?: boolean;
221
+ page_count?: number;
222
+ callback_url?: string;
223
+ }
224
+ export interface GoogleSuggestParams {
225
+ query?: string;
226
+ device_type?: string;
227
+ geo?: string;
228
+ locale?: string;
229
+ session_id?: string;
230
+ callback_url?: string;
231
+ }
232
+ export interface GoogleMapsParams {
233
+ query?: string;
234
+ headless?: "html" | "png";
235
+ geo?: string;
236
+ locale?: string;
237
+ page_from?: number;
238
+ device_type?: string;
239
+ session_id?: string;
240
+ google_results_language?: string;
241
+ google_nfpr?: boolean;
242
+ hotel_occupancy?: string;
243
+ date_range?: string;
244
+ markdown?: boolean;
245
+ callback_url?: string;
246
+ }
247
+ export interface GoogleAiModeParams {
248
+ query?: string;
249
+ geo?: string;
250
+ parse?: boolean;
251
+ device_type?: string;
252
+ session_id?: string;
253
+ markdown?: boolean;
254
+ xhr?: boolean;
255
+ callback_url?: string;
256
+ }
257
+ export interface GoogleAdsParams {
258
+ query?: string;
259
+ headless?: "html" | "png";
260
+ locale?: string;
261
+ geo?: string;
262
+ device_type?: string;
263
+ page_from?: number;
264
+ google_results_language?: string;
265
+ google_tbm?: string;
266
+ google_tbs?: string;
267
+ parse?: boolean;
268
+ google_nfpr?: boolean;
269
+ session_id?: string;
270
+ markdown?: boolean;
271
+ xhr?: boolean;
272
+ page_count?: number;
273
+ callback_url?: string;
274
+ }
275
+ export interface GoogleLensParams {
276
+ query?: string;
277
+ headless?: "html" | "png";
278
+ parse?: boolean;
279
+ device_type?: string;
280
+ markdown?: boolean;
281
+ callback_url?: string;
282
+ }
283
+ export interface BingSearchParams {
284
+ query?: string;
285
+ headless?: "html" | "png";
286
+ locale?: string;
287
+ geo?: string;
288
+ domain?: string;
289
+ device_type?: string;
290
+ page_from?: number;
291
+ parse?: boolean;
292
+ page_count?: number;
293
+ session_id?: string;
294
+ markdown?: boolean;
295
+ xhr?: boolean;
296
+ callback_url?: string;
297
+ }
298
+ export interface BingParams {
299
+ url?: string;
300
+ headless?: "html" | "png";
301
+ locale?: string;
302
+ geo?: string;
303
+ device_type?: string;
304
+ page_from?: number;
305
+ parse?: boolean;
306
+ session_id?: string;
307
+ markdown?: boolean;
308
+ xhr?: boolean;
309
+ callback_url?: string;
310
+ }
311
+ export interface YoutubeTranscriptParams {
312
+ query?: string;
313
+ language_code?: string;
314
+ transcript_origin?: string;
315
+ callback_url?: string;
316
+ }
317
+ export interface AmazonProductParams {
318
+ query?: string;
319
+ headless?: "html" | "png";
320
+ domain?: string;
321
+ device_type?: string;
322
+ parse?: boolean;
323
+ autoselect_variant?: boolean;
324
+ geo?: string;
325
+ session_id?: string;
326
+ currency?: string;
327
+ markdown?: boolean;
328
+ xhr?: boolean;
329
+ callback_url?: string;
330
+ }
331
+ export interface AmazonPricingParams {
332
+ query?: string;
333
+ headless?: "html" | "png";
334
+ domain?: string;
335
+ device_type?: string;
336
+ page_from?: number;
337
+ parse?: boolean;
338
+ geo?: string;
339
+ session_id?: string;
340
+ currency?: string;
341
+ markdown?: boolean;
342
+ xhr?: boolean;
343
+ callback_url?: string;
344
+ }
345
+ export interface AmazonSearchParams {
346
+ query?: string;
347
+ headless?: "html" | "png";
348
+ domain?: string;
349
+ device_type?: string;
350
+ page_from?: number;
351
+ category?: string;
352
+ merchant?: string;
353
+ parse?: boolean;
354
+ geo?: string;
355
+ session_id?: string;
356
+ sort_by?: string;
357
+ currency?: string;
358
+ markdown?: boolean;
359
+ xhr?: boolean;
360
+ callback_url?: string;
361
+ }
362
+ export interface AmazonSellersParams {
363
+ query?: string;
364
+ headless?: "html" | "png";
365
+ locale?: string;
366
+ domain?: string;
367
+ device_type?: string;
368
+ geo?: string;
369
+ parse?: boolean;
370
+ markdown?: boolean;
371
+ xhr?: boolean;
372
+ callback_url?: string;
373
+ }
374
+ export interface AmazonBestsellersParams {
375
+ query?: string;
376
+ domain?: string;
377
+ device_type?: string;
378
+ geo?: string;
379
+ page_from?: number;
380
+ category?: string;
381
+ parse?: boolean;
382
+ session_id?: string;
383
+ currency?: string;
384
+ markdown?: boolean;
385
+ xhr?: boolean;
386
+ callback_url?: string;
387
+ }
388
+ export interface AmazonParams {
389
+ url?: string;
390
+ headless?: "html" | "png";
391
+ device_type?: string;
392
+ parse?: boolean;
393
+ geo?: string;
394
+ session_id?: string;
395
+ markdown?: boolean;
396
+ xhr?: boolean;
397
+ callback_url?: string;
398
+ }
399
+ export interface EcommerceParams {
400
+ url?: string;
401
+ headless?: "html" | "png";
402
+ locale?: string;
403
+ geo?: string;
404
+ device_type?: string;
405
+ parse?: boolean;
406
+ parser_type?: string;
407
+ callback_url?: string;
408
+ }
409
+ export interface WalmartProductParams {
410
+ product_id?: string;
411
+ headless?: "html" | "png";
412
+ parse?: boolean;
413
+ xhr?: boolean;
414
+ markdown?: boolean;
415
+ fulfillment_type?: string;
416
+ walmart_store_id?: string;
417
+ delivery_zip?: string;
418
+ callback_url?: string;
419
+ }
420
+ export interface WalmartSearchParams {
421
+ query?: string;
422
+ headless?: "html" | "png";
423
+ parse?: boolean;
424
+ markdown?: boolean;
425
+ fulfillment_type?: string;
426
+ walmart_store_id?: string;
427
+ delivery_zip?: string;
428
+ callback_url?: string;
429
+ }
430
+ export interface WalmartParams {
431
+ url?: string;
432
+ headless?: "html" | "png";
433
+ locale?: string;
434
+ geo?: string;
435
+ device_type?: string;
436
+ store_id?: string;
437
+ markdown?: boolean;
438
+ xhr?: boolean;
439
+ callback_url?: string;
440
+ }
441
+ export interface TargetProductParams {
442
+ product_id?: string;
443
+ headless?: "html" | "png";
444
+ parse?: boolean;
445
+ device_type?: string;
446
+ markdown?: boolean;
447
+ xhr?: boolean;
448
+ delivery_type?: string;
449
+ target_store_id?: string;
450
+ delivery_zip?: string;
451
+ callback_url?: string;
452
+ }
453
+ export interface TargetSearchParams {
454
+ query?: string;
455
+ headless?: "html" | "png";
456
+ parse?: boolean;
457
+ device_type?: string;
458
+ delivery_type?: string;
459
+ target_store_id?: string;
460
+ delivery_zip?: string;
461
+ xhr?: boolean;
462
+ markdown?: boolean;
463
+ callback_url?: string;
464
+ }
465
+ export interface TargetParams {
466
+ url?: string;
467
+ headless?: "html" | "png";
468
+ device_type?: string;
469
+ xhr?: boolean;
470
+ delivery_zip?: string;
471
+ target_store_id?: string;
472
+ callback_url?: string;
473
+ }
474
+ export interface LowesSearchParams {
475
+ query?: string;
476
+ lowes_store_id?: string;
477
+ headless?: "html" | "png";
478
+ delivery_zip?: string;
479
+ user_agent_type?: string;
480
+ free_delivery?: boolean;
481
+ pickup_today?: boolean;
482
+ delivery_today_tomorrow?: boolean;
483
+ callback_url?: string;
484
+ }
485
+ export interface UniversalParams {
486
+ url?: string;
487
+ payload?: string;
488
+ proxy_pool?: "standard" | "premium";
489
+ http_method?: string;
490
+ headless?: "html" | "png";
491
+ geo?: string;
492
+ locale?: string;
493
+ device_type?: string;
494
+ session_id?: string;
495
+ successful_status_codes?: number[];
496
+ headers?: {
497
+ [k: string]: unknown;
498
+ };
499
+ cookies?: {
500
+ [k: string]: unknown;
501
+ };
502
+ force_headers?: boolean;
503
+ force_cookies?: boolean;
504
+ xhr?: boolean;
505
+ markdown?: boolean;
506
+ callback_url?: string;
507
+ }
508
+ export interface ChatgptParams {
509
+ prompt?: string;
510
+ search?: boolean;
511
+ parse?: boolean;
512
+ geo?: string;
513
+ device_type?: string;
514
+ markdown?: boolean;
515
+ xhr?: boolean;
516
+ callback_url?: string;
517
+ }
518
+ export interface PerplexityParams {
519
+ prompt?: string;
520
+ parse?: boolean;
521
+ geo?: string;
522
+ device_type?: string;
523
+ markdown?: boolean;
524
+ xhr?: boolean;
525
+ callback_url?: string;
526
+ }
527
+ export interface BbbParams {
528
+ url?: string;
529
+ headless?: "html" | "png";
530
+ geo?: string;
531
+ device_type?: string;
532
+ markdown?: boolean;
533
+ xhr?: boolean;
534
+ callback_url?: string;
535
+ }
536
+ export interface AutotraderParams {
537
+ url?: string;
538
+ headless?: "html" | "png";
539
+ geo?: string;
540
+ device_type?: string;
541
+ markdown?: boolean;
542
+ xhr?: boolean;
543
+ callback_url?: string;
544
+ }
545
+ export interface MobileParams {
546
+ url?: string;
547
+ headless?: "html" | "png";
548
+ geo?: string;
549
+ device_type?: string;
550
+ markdown?: boolean;
551
+ xhr?: boolean;
552
+ callback_url?: string;
553
+ }
554
+ export interface AirbnbParams {
555
+ url?: string;
556
+ headless?: "html" | "png";
557
+ geo?: string;
558
+ device_type?: string;
559
+ markdown?: boolean;
560
+ xhr?: boolean;
561
+ callback_url?: string;
562
+ }
563
+ export interface AppleAppStoreParams {
564
+ url?: string;
565
+ headless?: "html" | "png";
566
+ geo?: string;
567
+ device_type?: string;
568
+ markdown?: boolean;
569
+ xhr?: boolean;
570
+ callback_url?: string;
571
+ }
572
+ export interface InstagramGraphqlProfileParams {
573
+ query?: string;
574
+ callback_url?: string;
575
+ }
576
+ export interface TiktokPostParams {
577
+ url?: string;
578
+ xhr?: boolean;
579
+ callback_url?: string;
580
+ }
581
+ export interface TiktokShopSearchParams {
582
+ query?: string;
583
+ headless?: "html" | "png";
584
+ device_type?: string;
585
+ markdown?: boolean;
586
+ country?: string;
587
+ callback_url?: string;
588
+ }
589
+ export interface TiktokShopProductParams {
590
+ product_id?: string;
591
+ headless?: "html" | "png";
592
+ device_type?: string;
593
+ xhr?: boolean;
594
+ markdown?: boolean;
595
+ country?: string;
596
+ callback_url?: string;
597
+ }
598
+ export interface TiktokParams {
599
+ url?: string;
600
+ headless?: "html" | "png";
601
+ user_agent_type?: string;
602
+ callback_url?: string;
603
+ }
604
+ export interface RedditPostParams {
605
+ url?: string;
606
+ locale?: string;
607
+ geo?: string;
608
+ callback_url?: string;
609
+ }
610
+ export interface RedditSubredditParams {
611
+ url?: string;
612
+ locale?: string;
613
+ geo?: string;
614
+ callback_url?: string;
615
+ }
616
+ export interface RedditUserParams {
617
+ url?: string;
618
+ locale?: string;
619
+ geo?: string;
620
+ sort?: string;
621
+ callback_url?: string;
622
+ }
623
+ export interface YoutubeVideoParams {
624
+ query?: string;
625
+ geo?: string;
626
+ callback_url?: string;
627
+ }
628
+ export interface YoutubeMetadataParams {
629
+ query?: string;
630
+ callback_url?: string;
631
+ }
632
+ export interface YoutubeSearchParams {
633
+ "360"?: boolean;
634
+ query?: string;
635
+ upload_date?: string;
636
+ type?: string;
637
+ duration?: string;
638
+ video_sort_by?: string;
639
+ "3d"?: boolean;
640
+ "4k"?: boolean;
641
+ creative_commons?: boolean;
642
+ hd?: boolean;
643
+ hdr?: boolean;
644
+ vr180?: boolean;
645
+ live?: boolean;
646
+ location?: boolean;
647
+ purchased?: boolean;
648
+ subtitles?: boolean;
649
+ callback_url?: string;
650
+ }
651
+ export interface YoutubeSearchMaxParams {
652
+ "360"?: boolean;
653
+ query?: string;
654
+ upload_date?: string;
655
+ type?: string;
656
+ duration?: string;
657
+ video_sort_by?: string;
658
+ "3d"?: boolean;
659
+ "4k"?: boolean;
660
+ creative_commons?: boolean;
661
+ hd?: boolean;
662
+ hdr?: boolean;
663
+ vr180?: boolean;
664
+ live?: boolean;
665
+ location?: boolean;
666
+ purchased?: boolean;
667
+ subtitles?: boolean;
668
+ markdown?: boolean;
669
+ callback_url?: string;
670
+ }
671
+ export interface YoutubeSubtitlesParams {
672
+ query?: string;
673
+ language_code?: string;
674
+ subtitle_origin?: string;
675
+ callback_url?: string;
676
+ }
677
+ export interface YoutubeChannelParams {
678
+ query?: string;
679
+ parse?: boolean;
680
+ limit?: number;
681
+ markdown?: boolean;
682
+ callback_url?: string;
683
+ }
684
+ export type TargetParamsMap = {
685
+ [Target.UniversalEcommerce]: UniversalEcommerceParams;
686
+ [Target.GoogleSearch]: GoogleSearchParams;
687
+ [Target.GoogleTravelHotels]: GoogleTravelHotelsParams;
688
+ [Target.GoogleTrendsExplore]: GoogleTrendsExploreParams;
689
+ [Target.GoogleShoppingSearch]: GoogleShoppingSearchParams;
690
+ [Target.GoogleShoppingProduct]: GoogleShoppingProductParams;
691
+ [Target.Google]: GoogleParams;
692
+ [Target.GoogleSuggest]: GoogleSuggestParams;
693
+ [Target.GoogleMaps]: GoogleMapsParams;
694
+ [Target.GoogleAiMode]: GoogleAiModeParams;
695
+ [Target.GoogleAds]: GoogleAdsParams;
696
+ [Target.GoogleLens]: GoogleLensParams;
697
+ [Target.BingSearch]: BingSearchParams;
698
+ [Target.Bing]: BingParams;
699
+ [Target.YoutubeTranscript]: YoutubeTranscriptParams;
700
+ [Target.AmazonProduct]: AmazonProductParams;
701
+ [Target.AmazonPricing]: AmazonPricingParams;
702
+ [Target.AmazonSearch]: AmazonSearchParams;
703
+ [Target.AmazonSellers]: AmazonSellersParams;
704
+ [Target.AmazonBestsellers]: AmazonBestsellersParams;
705
+ [Target.Amazon]: AmazonParams;
706
+ [Target.Ecommerce]: EcommerceParams;
707
+ [Target.WalmartProduct]: WalmartProductParams;
708
+ [Target.WalmartSearch]: WalmartSearchParams;
709
+ [Target.Walmart]: WalmartParams;
710
+ [Target.TargetProduct]: TargetProductParams;
711
+ [Target.TargetSearch]: TargetSearchParams;
712
+ [Target.Target]: TargetParams;
713
+ [Target.LowesSearch]: LowesSearchParams;
714
+ [Target.Universal]: UniversalParams;
715
+ [Target.Chatgpt]: ChatgptParams;
716
+ [Target.Perplexity]: PerplexityParams;
717
+ [Target.Bbb]: BbbParams;
718
+ [Target.Autotrader]: AutotraderParams;
719
+ [Target.Mobile]: MobileParams;
720
+ [Target.Airbnb]: AirbnbParams;
721
+ [Target.AppleAppStore]: AppleAppStoreParams;
722
+ [Target.InstagramGraphqlProfile]: InstagramGraphqlProfileParams;
723
+ [Target.TiktokPost]: TiktokPostParams;
724
+ [Target.TiktokShopSearch]: TiktokShopSearchParams;
725
+ [Target.TiktokShopProduct]: TiktokShopProductParams;
726
+ [Target.Tiktok]: TiktokParams;
727
+ [Target.RedditPost]: RedditPostParams;
728
+ [Target.RedditSubreddit]: RedditSubredditParams;
729
+ [Target.RedditUser]: RedditUserParams;
730
+ [Target.YoutubeVideo]: YoutubeVideoParams;
731
+ [Target.YoutubeMetadata]: YoutubeMetadataParams;
732
+ [Target.YoutubeSearch]: YoutubeSearchParams;
733
+ [Target.YoutubeSearchMax]: YoutubeSearchMaxParams;
734
+ [Target.YoutubeSubtitles]: YoutubeSubtitlesParams;
735
+ [Target.YoutubeChannel]: YoutubeChannelParams;
736
+ };
737
+ export type ScrapeRequest = {
738
+ [T in TargetString]: {
739
+ target: T;
740
+ } & TargetParamsMap[T];
741
+ }[TargetString];
742
+ export type BatchRequest = {
743
+ [T in TargetString]: {
744
+ target: T;
745
+ url?: string[];
746
+ query?: string[];
747
+ } & Omit<TargetParamsMap[T], "url" | "query">;
748
+ }[TargetString];
749
+ export type TargetMeta = {
750
+ group: string;
751
+ response_format: string;
752
+ parameters: string[];
753
+ };
754
+ export declare const targetMeta: Record<Target, TargetMeta>;
755
+ export type RemoteSchemaLoadOptions = {
756
+ url?: string;
757
+ cachePath?: string;
758
+ ttlMs?: number;
759
+ };
760
+ export type DecodoSchema = {
761
+ getRequestSchema: (target: string) => z.ZodType | undefined;
762
+ listTargets: () => string[];
763
+ getTargetMeta: (target: string) => TargetMeta | undefined;
764
+ getTargetParameterSchema: (target: string) => JSONSchema4 | undefined;
765
+ getSharedParameters: () => Record<string, unknown>;
766
+ readonly version?: string;
767
+ };
768
+ export type ResultEntry = {
769
+ content: unknown;
770
+ status_code: number;
771
+ url?: string;
772
+ task_id: string;
773
+ headers?: Record<string, string>;
774
+ cookies?: Record<string, string>[];
775
+ created_at: string;
776
+ updated_at: string;
777
+ help?: string;
778
+ browser_actions_warnings?: Record<string, string>[];
779
+ browser_actions_error?: Record<string, string>[];
780
+ delivery_zip?: string;
781
+ };
782
+ export type SyncResponse = {
783
+ results: ResultEntry[];
784
+ };
785
+ export type AsyncTaskResponse = {
786
+ id: string;
787
+ target?: string;
788
+ url?: string;
789
+ query?: string;
790
+ status: string;
791
+ created_at?: string;
792
+ updated_at?: string;
793
+ page_from?: number;
794
+ limit?: number;
795
+ geo?: string | null;
796
+ device_type?: string;
797
+ headless?: string | null;
798
+ parse?: boolean;
799
+ locale?: string | null;
800
+ domain?: string;
801
+ output_schema?: string | null;
802
+ content_encoding?: string;
803
+ page_count?: number;
804
+ adults?: number;
805
+ children?: number;
806
+ callback_url?: string;
807
+ browser_actions_error?: Record<string, string>[];
808
+ browser_actions_warnings?: Record<string, string>[];
809
+ };
810
+ export type BatchResponse = {
811
+ id?: string;
812
+ queries?: AsyncTaskResponse[];
813
+ errors?: Array<{
814
+ message: string;
815
+ }>;
816
+ };
817
+ export type TaskStatus = "pending" | "faulted" | "done";
818
+ export type TaskMetadata = {
819
+ status: TaskStatus;
820
+ [key: string]: unknown;
821
+ };
822
+ export type TaskResultsResponse = {
823
+ results: ResultEntry[];
824
+ };
825
+ export declare class WebScrapingApi {
826
+ private readonly http;
827
+ private readonly schemas;
828
+ constructor(http: HttpClient, schemas?: DecodoSchema);
829
+ private validate;
830
+ scrape(params: ScrapeRequest): Promise<SyncResponse>;
831
+ scrapeAsync(params: ScrapeRequest): Promise<AsyncTaskResponse>;
832
+ scrapeBatch(params: BatchRequest): Promise<BatchResponse>;
833
+ getStatus(taskId: string): Promise<TaskMetadata>;
834
+ getResults(taskId: string): Promise<TaskResultsResponse | null>;
835
+ }
836
+ export type DecodoConfig = {
837
+ webScrapingApi?: {
838
+ token: string;
839
+ };
840
+ timeoutMs?: number;
841
+ schema?: DecodoSchema;
842
+ };
843
+ export declare class DecodoClient {
844
+ readonly webScrapingApi: WebScrapingApi;
845
+ constructor(config: DecodoConfig);
846
+ }
847
+ export declare class BundledSchema implements DecodoSchema {
848
+ static readonly shared: BundledSchema;
849
+ getRequestSchema(target: string): import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
850
+ listTargets(): string[];
851
+ getTargetMeta(target: string): TargetMeta;
852
+ getTargetParameterSchema(target: string): JSONSchema4 | undefined;
853
+ getSharedParameters(): Record<string, unknown>;
854
+ }
855
+ export declare class RemoteSchema implements DecodoSchema {
856
+ readonly version: string;
857
+ private readonly schemas;
858
+ private readonly meta;
859
+ private readonly parameterSchemas;
860
+ private readonly sharedParameters;
861
+ private readonly targetKeys;
862
+ private constructor();
863
+ static load(config?: RemoteSchemaLoadOptions): Promise<RemoteSchema>;
864
+ getRequestSchema(target: string): z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
865
+ listTargets(): string[];
866
+ getTargetMeta(target: string): TargetMeta | undefined;
867
+ getTargetParameterSchema(target: string): JSONSchema4 | undefined;
868
+ getSharedParameters(): Record<string, unknown>;
869
+ }
870
+ export type ParameterMeta = {
871
+ type: string;
872
+ maxLength?: number;
873
+ minimum?: number;
874
+ maximum?: number;
875
+ enum?: (string | number)[];
876
+ items?: {
877
+ type: string;
878
+ };
879
+ };
880
+ export declare const parameterMeta: Record<string, ParameterMeta>;
881
+ export declare class DecodoError extends Error {
882
+ readonly statusCode: number;
883
+ readonly apiStatus: string | undefined;
884
+ constructor(message: string, statusCode: number, apiStatus?: string);
885
+ }
886
+ export declare class AuthenticationError extends DecodoError {
887
+ constructor(message?: string);
888
+ }
889
+ export declare class RateLimitError extends DecodoError {
890
+ constructor(message?: string);
891
+ }
892
+ export declare class ValidationError extends DecodoError {
893
+ readonly errors: unknown[] | undefined;
894
+ constructor(message: string, errors?: unknown[]);
895
+ }
896
+ export declare class TimeoutError extends Error {
897
+ constructor(message?: string);
898
+ }
899
+
900
+ export {};