scavio 0.2.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -6
- package/dist/index.cjs +229 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +550 -30
- package/dist/index.d.ts +550 -30
- package/dist/index.js +225 -37
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,59 +1,430 @@
|
|
|
1
1
|
interface AmazonSearchOptions {
|
|
2
|
+
/** Product search query (1-500 characters). */
|
|
2
3
|
query: string;
|
|
4
|
+
/** Amazon domain suffix (default 'com', e.g. 'co.uk'). */
|
|
3
5
|
domain?: string;
|
|
6
|
+
/** Country code for localization. */
|
|
4
7
|
country?: string;
|
|
8
|
+
/** Language code. */
|
|
5
9
|
language?: string;
|
|
10
|
+
/** Currency code (ISO 4217, e.g. 'USD'). */
|
|
6
11
|
currency?: string;
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
/** Device to emulate. */
|
|
13
|
+
device?: "desktop" | "mobile" | "tablet";
|
|
14
|
+
/** Result sort order. */
|
|
15
|
+
sort_by?: "most_recent" | "price_low_to_high" | "price_high_to_low" | "featured" | "average_review" | "bestsellers";
|
|
16
|
+
/** Starting page (1-indexed). */
|
|
9
17
|
start_page?: number;
|
|
18
|
+
/** Number of pages to fetch. */
|
|
10
19
|
pages?: number;
|
|
20
|
+
/** Amazon category id. */
|
|
11
21
|
category_id?: string;
|
|
22
|
+
/** Filter to a specific merchant. */
|
|
12
23
|
merchant_id?: string;
|
|
24
|
+
/** ZIP/postal code for localized pricing. */
|
|
13
25
|
zip_code?: string;
|
|
26
|
+
/** Auto-select the default variant. */
|
|
14
27
|
autoselect_variant?: boolean;
|
|
28
|
+
[key: string]: unknown;
|
|
15
29
|
}
|
|
16
30
|
interface AmazonProductOptions {
|
|
31
|
+
/** Amazon ASIN (e.g. 'B09XS7JWHH'). Sent to the API as 'query'. */
|
|
17
32
|
asin: string;
|
|
33
|
+
/** Amazon domain suffix (default 'com'). */
|
|
18
34
|
domain?: string;
|
|
35
|
+
/** Country code for localization. */
|
|
19
36
|
country?: string;
|
|
37
|
+
/** Language code. */
|
|
20
38
|
language?: string;
|
|
39
|
+
/** Currency code (ISO 4217, e.g. 'USD'). */
|
|
21
40
|
currency?: string;
|
|
22
|
-
|
|
41
|
+
/** Device to emulate. */
|
|
42
|
+
device?: "desktop" | "mobile" | "tablet";
|
|
43
|
+
/** ZIP/postal code for localized pricing. */
|
|
23
44
|
zip_code?: string;
|
|
45
|
+
/** Auto-select the default variant. */
|
|
24
46
|
autoselect_variant?: boolean;
|
|
47
|
+
[key: string]: unknown;
|
|
25
48
|
}
|
|
26
49
|
declare class AmazonNamespace {
|
|
27
50
|
private client;
|
|
28
51
|
constructor(client: Scavio);
|
|
29
52
|
search(options: AmazonSearchOptions): Promise<Record<string, unknown>>;
|
|
30
53
|
product(options: AmazonProductOptions): Promise<Record<string, unknown>>;
|
|
54
|
+
/** Supported Amazon domains, languages, currencies, and countries. */
|
|
55
|
+
options(): Promise<Record<string, unknown>>;
|
|
31
56
|
}
|
|
32
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Google endpoints (scrape.do engine, /api/v2/google). A faithful passthrough
|
|
60
|
+
* that returns Google's full response. Every endpoint costs 1 credit. Any
|
|
61
|
+
* additional scrape.do parameter can be added to the options object.
|
|
62
|
+
* See https://scavio.dev/docs/search-api.
|
|
63
|
+
*/
|
|
33
64
|
interface GoogleSearchOptions {
|
|
65
|
+
/** Search query (1-500 characters). */
|
|
34
66
|
query: string;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
page
|
|
38
|
-
|
|
39
|
-
|
|
67
|
+
/** Device to emulate. */
|
|
68
|
+
device?: "desktop" | "mobile";
|
|
69
|
+
/** Result offset: 0 = page 1, 10 = page 2, ... up to 990. */
|
|
70
|
+
start?: number;
|
|
71
|
+
/** Include the raw Google HTML in the response. */
|
|
72
|
+
include_html?: boolean;
|
|
73
|
+
/** UI language (ISO 639-1, e.g. 'en'). */
|
|
74
|
+
hl?: string;
|
|
75
|
+
/** Country of the search (ISO 3166-1 alpha-2, e.g. 'us'). */
|
|
76
|
+
gl?: string;
|
|
77
|
+
/** Regional Google domain (e.g. 'google.co.uk'). */
|
|
78
|
+
google_domain?: string;
|
|
79
|
+
/** Canonical location name; auto-encoded to a UULE string. */
|
|
80
|
+
location?: string;
|
|
81
|
+
/** Pre-encoded UULE location string (takes priority over location). */
|
|
82
|
+
uule?: string;
|
|
83
|
+
/** Language restrict (e.g. 'lang_en'). */
|
|
84
|
+
lr?: string;
|
|
85
|
+
/** Country restrict (e.g. 'countryUS'). */
|
|
86
|
+
cr?: string;
|
|
87
|
+
/** SafeSearch filter. */
|
|
88
|
+
safe?: "active";
|
|
89
|
+
/** Disable spelling correction / auto-fixes when true. */
|
|
40
90
|
nfpr?: boolean;
|
|
41
|
-
|
|
91
|
+
/** '0' disables the omitted/similar-results filter. */
|
|
92
|
+
filter?: "0" | "1";
|
|
93
|
+
/** Restrict results to a recent time window. */
|
|
94
|
+
time_period?: "last_hour" | "last_day" | "last_week" | "last_month" | "last_year";
|
|
95
|
+
/** Resolve a deferred AI Overview (server default true). */
|
|
96
|
+
resolve_ai_overview?: boolean;
|
|
97
|
+
[key: string]: unknown;
|
|
98
|
+
}
|
|
99
|
+
interface GoogleAiModeOptions {
|
|
100
|
+
/** Question or prompt (1-500 characters). */
|
|
101
|
+
query: string;
|
|
102
|
+
/** Device to emulate. */
|
|
103
|
+
device?: "desktop" | "mobile";
|
|
104
|
+
/** Include the raw Google HTML in the response. */
|
|
105
|
+
include_html?: boolean;
|
|
106
|
+
/** UI language (ISO 639-1, e.g. 'en'). */
|
|
107
|
+
hl?: string;
|
|
108
|
+
/** Country of the search (ISO 3166-1 alpha-2, e.g. 'us'). */
|
|
109
|
+
gl?: string;
|
|
110
|
+
/** Regional Google domain (e.g. 'google.co.uk'). */
|
|
111
|
+
google_domain?: string;
|
|
112
|
+
/** Canonical location name; auto-encoded to a UULE string. */
|
|
113
|
+
location?: string;
|
|
114
|
+
/** Pre-encoded UULE location string (takes priority over location). */
|
|
115
|
+
uule?: string;
|
|
116
|
+
/** SafeSearch filter. */
|
|
117
|
+
safe?: "active";
|
|
118
|
+
[key: string]: unknown;
|
|
119
|
+
}
|
|
120
|
+
interface GoogleMapsSearchOptions {
|
|
121
|
+
/** Search query (1-500 characters). */
|
|
122
|
+
query: string;
|
|
123
|
+
/** Result offset; must be a multiple of 20 (0, 20, 40, ...). */
|
|
124
|
+
start?: number;
|
|
125
|
+
/** Map center as '@lat,lng,zoomz'; controls where results come from. */
|
|
126
|
+
ll?: string;
|
|
127
|
+
/** UI language (ISO 639-1, e.g. 'en'). */
|
|
128
|
+
hl?: string;
|
|
129
|
+
/** Country of the search (ISO 3166-1 alpha-2, e.g. 'us'). */
|
|
130
|
+
gl?: string;
|
|
131
|
+
/** Regional Google domain (e.g. 'google.co.uk'). */
|
|
132
|
+
google_domain?: string;
|
|
133
|
+
[key: string]: unknown;
|
|
134
|
+
}
|
|
135
|
+
interface GoogleMapsPlaceOptions {
|
|
136
|
+
/** Place ID (ChIJ...). */
|
|
137
|
+
place_id?: string;
|
|
138
|
+
/** Numeric CID. */
|
|
139
|
+
data_cid?: string;
|
|
140
|
+
[key: string]: unknown;
|
|
141
|
+
}
|
|
142
|
+
interface GoogleMapsReviewsOptions {
|
|
143
|
+
/** Data ID (0xHEX:0xHEX). */
|
|
144
|
+
data_id?: string;
|
|
145
|
+
/** Place ID (ChIJ...). */
|
|
146
|
+
place_id?: string;
|
|
147
|
+
/** Reviews per page (1-20). */
|
|
148
|
+
num?: number;
|
|
149
|
+
/** Pagination cursor from a prior response. */
|
|
150
|
+
next_page_token?: string;
|
|
151
|
+
/** Sort order. */
|
|
152
|
+
sort_by?: "relevance" | "newest" | "highest_rating" | "lowest_rating";
|
|
153
|
+
/** UI language (ISO 639-1, e.g. 'en'). */
|
|
154
|
+
hl?: string;
|
|
155
|
+
/** Country of the search (ISO 3166-1 alpha-2, e.g. 'us'). */
|
|
156
|
+
gl?: string;
|
|
157
|
+
/** Regional Google domain (e.g. 'google.co.uk'). */
|
|
158
|
+
google_domain?: string;
|
|
159
|
+
[key: string]: unknown;
|
|
160
|
+
}
|
|
161
|
+
interface GoogleShoppingOptions {
|
|
162
|
+
/** Product search query (1-500 characters). */
|
|
163
|
+
query: string;
|
|
164
|
+
/** Device to emulate. */
|
|
165
|
+
device?: "desktop" | "mobile";
|
|
166
|
+
/** Result offset. */
|
|
167
|
+
start?: number;
|
|
168
|
+
/** Minimum price filter. */
|
|
169
|
+
min_price?: number;
|
|
170
|
+
/** Maximum price filter. */
|
|
171
|
+
max_price?: number;
|
|
172
|
+
/** 0 = relevance, 1 = price ascending, 2 = price descending. */
|
|
173
|
+
sort_by?: number;
|
|
174
|
+
/** Only items with free shipping. */
|
|
175
|
+
free_shipping?: boolean;
|
|
176
|
+
/** Only items on sale. */
|
|
177
|
+
on_sale?: boolean;
|
|
178
|
+
/** Opaque Google Shopping filter token. */
|
|
179
|
+
shoprs?: string;
|
|
180
|
+
/** UI language (ISO 639-1, e.g. 'en'). */
|
|
181
|
+
hl?: string;
|
|
182
|
+
/** Country of the search (ISO 3166-1 alpha-2, e.g. 'us'). */
|
|
183
|
+
gl?: string;
|
|
184
|
+
/** Regional Google domain (e.g. 'google.co.uk'). */
|
|
185
|
+
google_domain?: string;
|
|
186
|
+
/** Canonical location name; auto-encoded to a UULE string. */
|
|
187
|
+
location?: string;
|
|
188
|
+
/** Pre-encoded UULE location string (takes priority over location). */
|
|
189
|
+
uule?: string;
|
|
190
|
+
[key: string]: unknown;
|
|
191
|
+
}
|
|
192
|
+
interface GoogleShoppingProductOptions {
|
|
193
|
+
/** Durable product catalog id. */
|
|
194
|
+
catalog_id?: string;
|
|
195
|
+
/** Product query; required when catalog_id is set. */
|
|
196
|
+
query?: string;
|
|
197
|
+
/** Immersive product page token. */
|
|
198
|
+
immersive_product_page_token?: string;
|
|
199
|
+
/** Alias for immersive_product_page_token. */
|
|
200
|
+
page_token?: string;
|
|
201
|
+
/** Product id. */
|
|
202
|
+
product_id?: string;
|
|
203
|
+
/** Device to emulate. */
|
|
204
|
+
device?: "desktop" | "mobile" | "tablet";
|
|
205
|
+
/** Regional Google domain (e.g. 'google.co.uk'). */
|
|
206
|
+
google_domain?: string;
|
|
207
|
+
/** Seller sort order. */
|
|
208
|
+
sort_by?: "base_price" | "total_price" | "promotion" | "seller_rating";
|
|
209
|
+
/** Load all available stores. */
|
|
210
|
+
load_all_stores?: boolean;
|
|
211
|
+
/** Fetch additional stores. */
|
|
212
|
+
more_stores?: boolean;
|
|
213
|
+
/** UI language (ISO 639-1, e.g. 'en'). */
|
|
214
|
+
hl?: string;
|
|
215
|
+
/** Country of the search (ISO 3166-1 alpha-2, e.g. 'us'). */
|
|
216
|
+
gl?: string;
|
|
217
|
+
/** Canonical location name; auto-encoded to a UULE string. */
|
|
218
|
+
location?: string;
|
|
219
|
+
/** Pre-encoded UULE location string (takes priority over location). */
|
|
220
|
+
uule?: string;
|
|
221
|
+
[key: string]: unknown;
|
|
222
|
+
}
|
|
223
|
+
interface GoogleShoppingStoresOptions {
|
|
224
|
+
/** Durable product catalog id. */
|
|
225
|
+
catalog_id: string;
|
|
226
|
+
/** Pagination cursor from shopping_product. */
|
|
227
|
+
next_page_token: string;
|
|
228
|
+
[key: string]: unknown;
|
|
229
|
+
}
|
|
230
|
+
interface GoogleFlightsOptions {
|
|
231
|
+
/** Departure IATA code(s); comma-separated allowed. */
|
|
232
|
+
departure_id: string;
|
|
233
|
+
/** Arrival IATA code(s); comma-separated allowed. */
|
|
234
|
+
arrival_id: string;
|
|
235
|
+
/** Outbound date (YYYY-MM-DD). */
|
|
236
|
+
outbound_date: string;
|
|
237
|
+
/** 1 = round trip, 2 = one way, 3 = multi-city. */
|
|
238
|
+
type?: number;
|
|
239
|
+
/** Return date (YYYY-MM-DD); required when type=1. */
|
|
240
|
+
return_date?: string;
|
|
241
|
+
/** Number of adults (1-9). */
|
|
242
|
+
adults?: number;
|
|
243
|
+
/** Number of children (0-9). */
|
|
244
|
+
children?: number;
|
|
245
|
+
/** Infants in seat (0-4). */
|
|
246
|
+
infants_in_seat?: number;
|
|
247
|
+
/** Infants on lap (0-4). */
|
|
248
|
+
infants_on_lap?: number;
|
|
249
|
+
/** 1 = economy, 2 = premium, 3 = business, 4 = first. */
|
|
250
|
+
travel_class?: number;
|
|
251
|
+
/** 0 = any, 1 = nonstop, 2 = <=1 stop, 3 = <=2 stops. */
|
|
252
|
+
stops?: number;
|
|
253
|
+
/** 1 = top, 2 = price, 3 = departure, 4 = arrival, 5 = duration, 6 = emissions. */
|
|
254
|
+
sort_by?: number;
|
|
255
|
+
/** Comma-separated airline codes/alliances to include. */
|
|
256
|
+
include_airlines?: string;
|
|
257
|
+
/** Comma-separated airline codes/alliances to exclude. */
|
|
258
|
+
exclude_airlines?: string;
|
|
259
|
+
/** UI language (ISO 639-1, e.g. 'en'). */
|
|
260
|
+
hl?: string;
|
|
261
|
+
/** Country of the search (ISO 3166-1 alpha-2, e.g. 'us'). */
|
|
262
|
+
gl?: string;
|
|
263
|
+
/** Currency code (ISO 4217, e.g. 'USD'). */
|
|
264
|
+
currency?: string;
|
|
265
|
+
[key: string]: unknown;
|
|
266
|
+
}
|
|
267
|
+
interface GoogleHotelsOptions {
|
|
268
|
+
/** Search query; use a '<City> hotels' form. */
|
|
269
|
+
query: string;
|
|
270
|
+
/** Check-in date (YYYY-MM-DD). */
|
|
271
|
+
check_in_date: string;
|
|
272
|
+
/** Check-out date (YYYY-MM-DD). */
|
|
273
|
+
check_out_date: string;
|
|
274
|
+
/** UI language (ISO 639-1, e.g. 'en'). */
|
|
275
|
+
hl?: string;
|
|
276
|
+
/** Country of the search (ISO 3166-1 alpha-2, e.g. 'us'). */
|
|
277
|
+
gl?: string;
|
|
278
|
+
/** Currency code (ISO 4217, e.g. 'USD'). */
|
|
279
|
+
currency?: string;
|
|
280
|
+
/** 3 = lowest price, 8 = highest rating, 13 = most reviewed. */
|
|
281
|
+
sort_by?: number;
|
|
282
|
+
/** Minimum nightly price. */
|
|
283
|
+
min_price?: number;
|
|
284
|
+
/** Maximum nightly price. */
|
|
285
|
+
max_price?: number;
|
|
286
|
+
/** 7 = 3.5+, 8 = 4.0+, 9 = 4.5+. */
|
|
287
|
+
rating?: number;
|
|
288
|
+
/** Comma-separated star ratings (2-5). */
|
|
289
|
+
hotel_class?: string;
|
|
290
|
+
/** Comma-separated amenity ids. */
|
|
291
|
+
amenities?: string;
|
|
292
|
+
/** Comma-separated property-type ids (e.g. '12' for vacation rentals). */
|
|
293
|
+
property_types?: string;
|
|
294
|
+
/** Only properties with free cancellation. */
|
|
295
|
+
free_cancellation?: boolean;
|
|
296
|
+
/** Only eco-certified properties. */
|
|
297
|
+
eco_certified?: boolean;
|
|
298
|
+
/** Only properties with special offers. */
|
|
299
|
+
special_offers?: boolean;
|
|
300
|
+
/** Pagination cursor from a prior response. */
|
|
301
|
+
next_page_token?: string;
|
|
302
|
+
/** Number of properties to return (1-20). */
|
|
303
|
+
limit?: number;
|
|
304
|
+
[key: string]: unknown;
|
|
305
|
+
}
|
|
306
|
+
interface GoogleHotelsDetailOptions {
|
|
307
|
+
/** Property detail token from a hotels listing. */
|
|
308
|
+
detail_token: string;
|
|
309
|
+
/** Check-in date (YYYY-MM-DD). */
|
|
310
|
+
check_in_date: string;
|
|
311
|
+
/** Check-out date (YYYY-MM-DD). */
|
|
312
|
+
check_out_date: string;
|
|
313
|
+
/** Currency code (ISO 4217, e.g. 'USD'). */
|
|
314
|
+
currency?: string;
|
|
315
|
+
/** Country of the search (ISO 3166-1 alpha-2, e.g. 'us'). */
|
|
316
|
+
gl?: string;
|
|
317
|
+
/** UI language (ISO 639-1, e.g. 'en'). */
|
|
318
|
+
hl?: string;
|
|
319
|
+
[key: string]: unknown;
|
|
320
|
+
}
|
|
321
|
+
interface GoogleNewsOptions {
|
|
322
|
+
/** Keyword search. */
|
|
323
|
+
query?: string;
|
|
324
|
+
/** Browse a news topic. */
|
|
325
|
+
topic_token?: string;
|
|
326
|
+
/** Browse a topic section. */
|
|
327
|
+
section_token?: string;
|
|
328
|
+
/** Fetch full coverage of a story. */
|
|
329
|
+
story_token?: string;
|
|
330
|
+
/** Browse a publication. */
|
|
331
|
+
publication_token?: string;
|
|
332
|
+
/** Knowledge Graph entity id. */
|
|
333
|
+
kgmid?: string;
|
|
334
|
+
/** UI language (ISO 639-1, e.g. 'en'). */
|
|
335
|
+
hl?: string;
|
|
336
|
+
/** Country of the search (ISO 3166-1 alpha-2, e.g. 'us'). */
|
|
337
|
+
gl?: string;
|
|
338
|
+
/** Regional Google domain (e.g. 'google.co.uk'). */
|
|
339
|
+
google_domain?: string;
|
|
340
|
+
/** Sort order: 0 = relevance, 1 = date (only with query or kgmid). */
|
|
341
|
+
so?: number;
|
|
342
|
+
[key: string]: unknown;
|
|
343
|
+
}
|
|
344
|
+
interface GoogleTrendsOptions {
|
|
345
|
+
/** Search term(s); comma-separated for comparisons. */
|
|
346
|
+
query: string;
|
|
347
|
+
/** Location code (e.g. 'US', 'GB', 'US-CA'). */
|
|
348
|
+
geo?: string;
|
|
349
|
+
/** UI language (ISO 639-1, e.g. 'en'). */
|
|
350
|
+
hl?: string;
|
|
351
|
+
/** Time range (e.g. 'today 12-m', 'now 7-d'). */
|
|
352
|
+
date?: string;
|
|
353
|
+
/** Timezone offset in minutes. */
|
|
354
|
+
tz?: string;
|
|
355
|
+
/** Which trends dataset to return. */
|
|
356
|
+
data_type?: "TIMESERIES" | "GEO_MAP" | "GEO_MAP_0" | "RELATED_QUERIES" | "RELATED_TOPICS";
|
|
357
|
+
/** Category id. */
|
|
358
|
+
cat?: string;
|
|
359
|
+
/** Google property filter. */
|
|
360
|
+
gprop?: "images" | "news" | "youtube" | "froogle";
|
|
361
|
+
/** Resolution for GEO_MAP data. */
|
|
362
|
+
region?: "COUNTRY" | "REGION" | "DMA" | "CITY";
|
|
363
|
+
[key: string]: unknown;
|
|
364
|
+
}
|
|
365
|
+
interface GoogleTrendingOptions {
|
|
366
|
+
/** Country code (e.g. 'US'). */
|
|
367
|
+
geo: string;
|
|
368
|
+
/** UI language (ISO 639-1, e.g. 'en'). */
|
|
369
|
+
hl?: string;
|
|
370
|
+
/** Trending window: 4, 24, 48, or 168. */
|
|
371
|
+
hours?: number;
|
|
372
|
+
/** Category id (0-20). */
|
|
373
|
+
cat?: number;
|
|
374
|
+
/** Sort order. */
|
|
375
|
+
sort?: "relevance" | "search_volume" | "recency" | "title";
|
|
376
|
+
/** Filter by trend status. */
|
|
377
|
+
status?: "all" | "active";
|
|
378
|
+
[key: string]: unknown;
|
|
42
379
|
}
|
|
43
380
|
declare class GoogleNamespace {
|
|
44
381
|
private client;
|
|
45
382
|
constructor(client: Scavio);
|
|
383
|
+
/** Google SERP search (includes the AI Overview when Google returns one). */
|
|
46
384
|
search(options: GoogleSearchOptions): Promise<Record<string, unknown>>;
|
|
385
|
+
/** Google AI Mode answer. */
|
|
386
|
+
aiMode(options: GoogleAiModeOptions): Promise<Record<string, unknown>>;
|
|
387
|
+
/** Google Maps local results. */
|
|
388
|
+
mapsSearch(options: GoogleMapsSearchOptions): Promise<Record<string, unknown>>;
|
|
389
|
+
/** Google Maps place details. Provide place_id or data_cid. */
|
|
390
|
+
mapsPlace(options: GoogleMapsPlaceOptions): Promise<Record<string, unknown>>;
|
|
391
|
+
/** Google Maps reviews. Provide data_id or place_id. */
|
|
392
|
+
mapsReviews(options: GoogleMapsReviewsOptions): Promise<Record<string, unknown>>;
|
|
393
|
+
/** Google Shopping search results. */
|
|
394
|
+
shopping(options: GoogleShoppingOptions): Promise<Record<string, unknown>>;
|
|
395
|
+
/** Google Shopping product. Pass catalog_id + query for full details and sellers. */
|
|
396
|
+
shoppingProduct(options: GoogleShoppingProductOptions): Promise<Record<string, unknown>>;
|
|
397
|
+
/** Google Shopping product sellers (continuation of shoppingProduct). */
|
|
398
|
+
shoppingStores(options: GoogleShoppingStoresOptions): Promise<Record<string, unknown>>;
|
|
399
|
+
/** Google Flights. */
|
|
400
|
+
flights(options: GoogleFlightsOptions): Promise<Record<string, unknown>>;
|
|
401
|
+
/** Google Hotels search. */
|
|
402
|
+
hotels(options: GoogleHotelsOptions): Promise<Record<string, unknown>>;
|
|
403
|
+
/** Google Hotels property details (from a hotels listing detail_token). */
|
|
404
|
+
hotelsDetail(options: GoogleHotelsDetailOptions): Promise<Record<string, unknown>>;
|
|
405
|
+
/** Google News. Provide query or a topic/story/publication token. */
|
|
406
|
+
news(options: GoogleNewsOptions): Promise<Record<string, unknown>>;
|
|
407
|
+
/** Google Trends data. */
|
|
408
|
+
trends(options: GoogleTrendsOptions): Promise<Record<string, unknown>>;
|
|
409
|
+
/** Google Trending Now for a country. */
|
|
410
|
+
trending(options: GoogleTrendingOptions): Promise<Record<string, unknown>>;
|
|
47
411
|
}
|
|
48
412
|
|
|
49
413
|
interface RedditSearchOptions {
|
|
414
|
+
/** Search query (1-500 characters). */
|
|
50
415
|
query: string;
|
|
51
|
-
type
|
|
52
|
-
|
|
416
|
+
/** Result type (server default 'posts'). */
|
|
417
|
+
type?: "posts" | "comments";
|
|
418
|
+
/** Sort order (server default 'new'). */
|
|
419
|
+
sort?: "new" | "relevance" | "hot" | "top" | "comments";
|
|
420
|
+
/** Pagination cursor from a prior response. */
|
|
53
421
|
cursor?: string;
|
|
422
|
+
[key: string]: unknown;
|
|
54
423
|
}
|
|
55
424
|
interface RedditPostOptions {
|
|
425
|
+
/** Full Reddit post URL. */
|
|
56
426
|
url: string;
|
|
427
|
+
[key: string]: unknown;
|
|
57
428
|
}
|
|
58
429
|
declare class RedditNamespace {
|
|
59
430
|
private client;
|
|
@@ -63,61 +434,107 @@ declare class RedditNamespace {
|
|
|
63
434
|
}
|
|
64
435
|
|
|
65
436
|
interface TikTokProfileOptions {
|
|
437
|
+
/** TikTok @username (without the @). */
|
|
66
438
|
username?: string;
|
|
439
|
+
/** TikTok sec_user_id. */
|
|
67
440
|
sec_user_id?: string;
|
|
441
|
+
[key: string]: unknown;
|
|
68
442
|
}
|
|
69
443
|
interface TikTokUserPostsOptions {
|
|
444
|
+
/** TikTok sec_user_id. */
|
|
70
445
|
sec_user_id: string;
|
|
446
|
+
/** Pagination cursor (default '0'). */
|
|
71
447
|
cursor?: string;
|
|
448
|
+
/** Results per page (1-30). */
|
|
72
449
|
count?: number;
|
|
73
|
-
|
|
450
|
+
/** '0' = latest, '1' = popular. */
|
|
451
|
+
sort_type?: "0" | "1";
|
|
452
|
+
[key: string]: unknown;
|
|
74
453
|
}
|
|
75
454
|
interface TikTokVideoOptions {
|
|
455
|
+
/** TikTok video id. */
|
|
76
456
|
video_id: string;
|
|
457
|
+
[key: string]: unknown;
|
|
77
458
|
}
|
|
78
459
|
interface TikTokVideoCommentsOptions {
|
|
460
|
+
/** TikTok video id. */
|
|
79
461
|
video_id: string;
|
|
462
|
+
/** Pagination cursor (default '0'). */
|
|
80
463
|
cursor?: string;
|
|
464
|
+
/** Results per page (1-50). */
|
|
81
465
|
count?: number;
|
|
466
|
+
[key: string]: unknown;
|
|
82
467
|
}
|
|
83
468
|
interface TikTokCommentRepliesOptions {
|
|
469
|
+
/** TikTok video id. */
|
|
84
470
|
video_id: string;
|
|
471
|
+
/** Parent comment id. */
|
|
85
472
|
comment_id: string;
|
|
473
|
+
/** Pagination cursor (default '0'). */
|
|
86
474
|
cursor?: string;
|
|
475
|
+
/** Results per page (1-50). */
|
|
87
476
|
count?: number;
|
|
477
|
+
[key: string]: unknown;
|
|
88
478
|
}
|
|
89
479
|
interface TikTokSearchVideosOptions {
|
|
480
|
+
/** Search keyword (1-500 characters). */
|
|
90
481
|
keyword: string;
|
|
482
|
+
/** Pagination cursor (default '0'). */
|
|
91
483
|
cursor?: string;
|
|
484
|
+
/** Results per page (1-30). */
|
|
92
485
|
count?: number;
|
|
93
|
-
|
|
94
|
-
|
|
486
|
+
/** '0' = relevance, '1' = most likes. */
|
|
487
|
+
sort_type?: "0" | "1";
|
|
488
|
+
/** Age filter in days: 0 = all time, 1, 7, 30, 90, 180. */
|
|
489
|
+
publish_time?: "0" | "1" | "7" | "30" | "90" | "180";
|
|
490
|
+
[key: string]: unknown;
|
|
95
491
|
}
|
|
96
492
|
interface TikTokSearchUsersOptions {
|
|
493
|
+
/** Search keyword (1-500 characters). */
|
|
97
494
|
keyword: string;
|
|
495
|
+
/** Pagination cursor (default '0'). */
|
|
98
496
|
cursor?: string;
|
|
497
|
+
/** Results per page (1-30). */
|
|
99
498
|
count?: number;
|
|
499
|
+
[key: string]: unknown;
|
|
100
500
|
}
|
|
101
501
|
interface TikTokHashtagOptions {
|
|
502
|
+
/** Hashtag name (without the #). */
|
|
102
503
|
hashtag_name?: string;
|
|
504
|
+
/** Hashtag id. */
|
|
103
505
|
hashtag_id?: string;
|
|
506
|
+
[key: string]: unknown;
|
|
104
507
|
}
|
|
105
508
|
interface TikTokHashtagVideosOptions {
|
|
509
|
+
/** Hashtag id. */
|
|
106
510
|
hashtag_id: string;
|
|
511
|
+
/** Pagination cursor (default '0'). */
|
|
107
512
|
cursor?: string;
|
|
513
|
+
/** Results per page (1-30). */
|
|
108
514
|
count?: number;
|
|
515
|
+
[key: string]: unknown;
|
|
109
516
|
}
|
|
110
517
|
interface TikTokUserFollowersOptions {
|
|
518
|
+
/** TikTok sec_user_id. */
|
|
111
519
|
sec_user_id: string;
|
|
520
|
+
/** Results per page (1-20). */
|
|
112
521
|
count?: number;
|
|
522
|
+
/** Pagination token from a prior response. */
|
|
113
523
|
page_token?: string;
|
|
524
|
+
/** Minimum timestamp cursor. */
|
|
114
525
|
min_time?: number;
|
|
526
|
+
[key: string]: unknown;
|
|
115
527
|
}
|
|
116
528
|
interface TikTokUserFollowingsOptions {
|
|
529
|
+
/** TikTok sec_user_id. */
|
|
117
530
|
sec_user_id: string;
|
|
531
|
+
/** Results per page (1-20). */
|
|
118
532
|
count?: number;
|
|
533
|
+
/** Pagination token from a prior response. */
|
|
119
534
|
page_token?: string;
|
|
535
|
+
/** Minimum timestamp cursor. */
|
|
120
536
|
min_time?: number;
|
|
537
|
+
[key: string]: unknown;
|
|
121
538
|
}
|
|
122
539
|
declare class TikTokNamespace {
|
|
123
540
|
private client;
|
|
@@ -136,44 +553,76 @@ declare class TikTokNamespace {
|
|
|
136
553
|
}
|
|
137
554
|
|
|
138
555
|
interface InstagramProfileOptions {
|
|
556
|
+
/** Instagram username (without the @). */
|
|
139
557
|
username?: string;
|
|
558
|
+
/** Instagram numeric user id. */
|
|
140
559
|
user_id?: string;
|
|
560
|
+
[key: string]: unknown;
|
|
141
561
|
}
|
|
142
562
|
interface InstagramUserFeedOptions {
|
|
563
|
+
/** Instagram username (without the @). */
|
|
143
564
|
username?: string;
|
|
565
|
+
/** Instagram numeric user id. */
|
|
144
566
|
user_id?: string;
|
|
567
|
+
/** Results per page (1-50). */
|
|
145
568
|
count?: number;
|
|
569
|
+
/** Pagination cursor from a prior response. */
|
|
146
570
|
cursor?: string;
|
|
571
|
+
[key: string]: unknown;
|
|
147
572
|
}
|
|
148
573
|
interface InstagramStoriesOptions {
|
|
574
|
+
/** Instagram username (without the @). */
|
|
149
575
|
username?: string;
|
|
576
|
+
/** Instagram numeric user id. */
|
|
150
577
|
user_id?: string;
|
|
578
|
+
[key: string]: unknown;
|
|
151
579
|
}
|
|
152
580
|
interface InstagramPostOptions {
|
|
581
|
+
/** Full Instagram post URL. */
|
|
153
582
|
url?: string;
|
|
583
|
+
/** Instagram media id. */
|
|
154
584
|
media_id?: string;
|
|
585
|
+
/** Instagram shortcode (from the post URL). */
|
|
155
586
|
shortcode?: string;
|
|
587
|
+
[key: string]: unknown;
|
|
156
588
|
}
|
|
157
589
|
interface InstagramPostCommentsOptions {
|
|
590
|
+
/** Instagram shortcode (from the post URL). */
|
|
158
591
|
shortcode?: string;
|
|
592
|
+
/** Full Instagram post URL. */
|
|
159
593
|
url?: string;
|
|
594
|
+
/** Pagination cursor from a prior response. */
|
|
160
595
|
cursor?: string;
|
|
161
|
-
|
|
596
|
+
/** Comment sort order. */
|
|
597
|
+
sort_order?: "popular" | "newest";
|
|
598
|
+
[key: string]: unknown;
|
|
162
599
|
}
|
|
163
600
|
interface InstagramCommentRepliesOptions {
|
|
601
|
+
/** Instagram media id. */
|
|
164
602
|
media_id: string;
|
|
603
|
+
/** Parent comment id. */
|
|
165
604
|
comment_id: string;
|
|
605
|
+
/** Pagination cursor from a prior response. */
|
|
166
606
|
cursor?: string;
|
|
607
|
+
[key: string]: unknown;
|
|
167
608
|
}
|
|
168
609
|
interface InstagramSearchOptions {
|
|
610
|
+
/** Search keyword (1-500 characters). */
|
|
169
611
|
keyword: string;
|
|
612
|
+
/** Pagination cursor from a prior response. */
|
|
170
613
|
cursor?: string;
|
|
614
|
+
[key: string]: unknown;
|
|
171
615
|
}
|
|
172
616
|
interface InstagramFollowOptions {
|
|
617
|
+
/** Instagram username (without the @). */
|
|
173
618
|
username?: string;
|
|
619
|
+
/** Instagram numeric user id. */
|
|
174
620
|
user_id?: string;
|
|
621
|
+
/** Results per page (1-100). */
|
|
175
622
|
count?: number;
|
|
623
|
+
/** Pagination cursor from a prior response. */
|
|
176
624
|
cursor?: string;
|
|
625
|
+
[key: string]: unknown;
|
|
177
626
|
}
|
|
178
627
|
declare class InstagramNamespace {
|
|
179
628
|
private client;
|
|
@@ -193,24 +642,42 @@ declare class InstagramNamespace {
|
|
|
193
642
|
}
|
|
194
643
|
|
|
195
644
|
interface WalmartSearchOptions {
|
|
645
|
+
/** Product search query (1-500 characters). */
|
|
196
646
|
query: string;
|
|
647
|
+
/** Walmart domain. */
|
|
197
648
|
domain?: string;
|
|
198
|
-
|
|
199
|
-
|
|
649
|
+
/** Device to emulate. */
|
|
650
|
+
device?: "desktop" | "mobile" | "tablet";
|
|
651
|
+
/** Result sort order. */
|
|
652
|
+
sort_by?: "best_match" | "price_low" | "price_high" | "best_seller";
|
|
653
|
+
/** Starting page (1-indexed). */
|
|
200
654
|
start_page?: number;
|
|
655
|
+
/** Minimum price filter (USD). */
|
|
201
656
|
min_price?: number;
|
|
657
|
+
/** Maximum price filter (USD). */
|
|
202
658
|
max_price?: number;
|
|
203
|
-
|
|
204
|
-
|
|
659
|
+
/** Delivery speed filter. */
|
|
660
|
+
fulfillment_speed?: "today" | "tomorrow" | "2_days" | "anytime";
|
|
661
|
+
/** Fulfillment type filter. */
|
|
662
|
+
fulfillment_type?: "in_store";
|
|
663
|
+
/** ZIP code for localized results. */
|
|
205
664
|
delivery_zip?: string;
|
|
665
|
+
/** Store id for in-store availability. */
|
|
206
666
|
store_id?: string;
|
|
667
|
+
[key: string]: unknown;
|
|
207
668
|
}
|
|
208
669
|
interface WalmartProductOptions {
|
|
670
|
+
/** Walmart product id. */
|
|
209
671
|
product_id: string;
|
|
672
|
+
/** Walmart domain. */
|
|
210
673
|
domain?: string;
|
|
211
|
-
|
|
674
|
+
/** Device to emulate. */
|
|
675
|
+
device?: "desktop" | "mobile" | "tablet";
|
|
676
|
+
/** ZIP code for localized pricing. */
|
|
212
677
|
delivery_zip?: string;
|
|
678
|
+
/** Store id for in-store availability. */
|
|
213
679
|
store_id?: string;
|
|
680
|
+
[key: string]: unknown;
|
|
214
681
|
}
|
|
215
682
|
declare class WalmartNamespace {
|
|
216
683
|
private client;
|
|
@@ -220,18 +687,42 @@ declare class WalmartNamespace {
|
|
|
220
687
|
}
|
|
221
688
|
|
|
222
689
|
interface YouTubeSearchOptions {
|
|
690
|
+
/** Search query (1-500 characters). Sent to the API as 'search'. */
|
|
223
691
|
query: string;
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
692
|
+
/** Filter by upload date. */
|
|
693
|
+
upload_date?: "last_hour" | "today" | "this_week" | "this_month" | "this_year";
|
|
694
|
+
/** Filter by result type. */
|
|
695
|
+
type?: "video" | "channel" | "playlist";
|
|
696
|
+
/** short (<4 min), medium (4-20 min), long (>20 min). */
|
|
697
|
+
duration?: "short" | "medium" | "long";
|
|
698
|
+
/** Sort order. */
|
|
699
|
+
sort_by?: "relevance" | "date" | "view_count" | "rating";
|
|
700
|
+
/** HD videos only. */
|
|
228
701
|
hd?: boolean;
|
|
702
|
+
/** Videos with subtitles/CC only. */
|
|
229
703
|
subtitles?: boolean;
|
|
704
|
+
/** Creative Commons licensed only. */
|
|
230
705
|
creative_commons?: boolean;
|
|
706
|
+
/** Live videos only. */
|
|
231
707
|
live?: boolean;
|
|
708
|
+
/** HDR videos only. */
|
|
709
|
+
hdr?: boolean;
|
|
710
|
+
/** Videos with location metadata only. */
|
|
711
|
+
location?: boolean;
|
|
712
|
+
/** VR180 videos only. */
|
|
713
|
+
vr180?: boolean;
|
|
714
|
+
/** 4K videos only. Sent to the API as '4k'. */
|
|
715
|
+
fourK?: boolean;
|
|
716
|
+
/** 360-degree videos only. Sent to the API as '360'. */
|
|
717
|
+
video_360?: boolean;
|
|
718
|
+
/** 3D videos only. Sent to the API as '3d'. */
|
|
719
|
+
video_3d?: boolean;
|
|
720
|
+
[key: string]: unknown;
|
|
232
721
|
}
|
|
233
722
|
interface YouTubeMetadataOptions {
|
|
723
|
+
/** YouTube video id (e.g. 'dQw4w9WgXcQ'). */
|
|
234
724
|
video_id: string;
|
|
725
|
+
[key: string]: unknown;
|
|
235
726
|
}
|
|
236
727
|
declare class YouTubeNamespace {
|
|
237
728
|
private client;
|
|
@@ -245,6 +736,12 @@ interface ScavioConfig {
|
|
|
245
736
|
baseUrl?: string;
|
|
246
737
|
timeout?: number;
|
|
247
738
|
maxRequestsPerSecond?: number;
|
|
739
|
+
/**
|
|
740
|
+
* Additional retry attempts after the first request on transient failures
|
|
741
|
+
* (HTTP 429/500/502/503/504 and network/timeout errors). Defaults to 2.
|
|
742
|
+
* Set to 0 to disable retries.
|
|
743
|
+
*/
|
|
744
|
+
maxRetries?: number;
|
|
248
745
|
}
|
|
249
746
|
declare class Scavio {
|
|
250
747
|
readonly google: GoogleNamespace;
|
|
@@ -257,6 +754,7 @@ declare class Scavio {
|
|
|
257
754
|
private readonly apiKey;
|
|
258
755
|
private readonly baseUrl;
|
|
259
756
|
private readonly timeout;
|
|
757
|
+
private readonly maxRetries;
|
|
260
758
|
private readonly rateLimiter;
|
|
261
759
|
constructor(config?: ScavioConfig);
|
|
262
760
|
/** @internal */
|
|
@@ -273,21 +771,43 @@ declare class ScavioError extends Error {
|
|
|
273
771
|
declare class MissingAPIKeyError extends ScavioError {
|
|
274
772
|
constructor();
|
|
275
773
|
}
|
|
276
|
-
|
|
774
|
+
/** The request could not reach the API (DNS, connection reset, TLS, ...). */
|
|
775
|
+
declare class ScavioConnectionError extends ScavioError {
|
|
277
776
|
constructor(message?: string);
|
|
278
777
|
}
|
|
279
|
-
|
|
778
|
+
/** The request did not complete within the configured timeout. */
|
|
779
|
+
declare class ScavioTimeoutError extends ScavioError {
|
|
280
780
|
constructor(message?: string);
|
|
281
781
|
}
|
|
782
|
+
declare class InvalidAPIKeyError extends ScavioError {
|
|
783
|
+
readonly statusCode = 401;
|
|
784
|
+
readonly responseBody?: Record<string, unknown>;
|
|
785
|
+
constructor(message?: string, responseBody?: Record<string, unknown>);
|
|
786
|
+
}
|
|
787
|
+
declare class InsufficientCreditsError extends ScavioError {
|
|
788
|
+
readonly statusCode = 402;
|
|
789
|
+
readonly responseBody?: Record<string, unknown>;
|
|
790
|
+
constructor(message?: string, responseBody?: Record<string, unknown>);
|
|
791
|
+
}
|
|
282
792
|
declare class BadRequestError extends ScavioError {
|
|
283
|
-
|
|
793
|
+
readonly statusCode = 400;
|
|
794
|
+
readonly responseBody?: Record<string, unknown>;
|
|
795
|
+
constructor(message?: string, responseBody?: Record<string, unknown>);
|
|
796
|
+
}
|
|
797
|
+
declare class NotFoundError extends ScavioError {
|
|
798
|
+
readonly statusCode = 404;
|
|
799
|
+
readonly responseBody?: Record<string, unknown>;
|
|
800
|
+
constructor(message?: string, responseBody?: Record<string, unknown>);
|
|
284
801
|
}
|
|
285
802
|
declare class RateLimitError extends ScavioError {
|
|
286
|
-
|
|
803
|
+
readonly statusCode = 429;
|
|
804
|
+
readonly responseBody?: Record<string, unknown>;
|
|
805
|
+
constructor(message?: string, responseBody?: Record<string, unknown>);
|
|
287
806
|
}
|
|
288
807
|
declare class ScavioAPIError extends ScavioError {
|
|
289
808
|
readonly statusCode: number;
|
|
290
|
-
|
|
809
|
+
readonly responseBody?: Record<string, unknown>;
|
|
810
|
+
constructor(statusCode: number, message: string, responseBody?: Record<string, unknown>);
|
|
291
811
|
}
|
|
292
812
|
|
|
293
|
-
export { type AmazonProductOptions, type AmazonSearchOptions, BadRequestError, type GoogleSearchOptions, type InstagramCommentRepliesOptions, type InstagramFollowOptions, type InstagramPostCommentsOptions, type InstagramPostOptions, type InstagramProfileOptions, type InstagramSearchOptions, type InstagramStoriesOptions, type InstagramUserFeedOptions, InsufficientCreditsError, InvalidAPIKeyError, MissingAPIKeyError, RateLimitError, type RedditPostOptions, type RedditSearchOptions, Scavio, ScavioAPIError, type ScavioConfig, ScavioError, type TikTokCommentRepliesOptions, type TikTokHashtagOptions, type TikTokHashtagVideosOptions, type TikTokProfileOptions, type TikTokSearchUsersOptions, type TikTokSearchVideosOptions, type TikTokUserFollowersOptions, type TikTokUserFollowingsOptions, type TikTokUserPostsOptions, type TikTokVideoCommentsOptions, type TikTokVideoOptions, type WalmartProductOptions, type WalmartSearchOptions, type YouTubeMetadataOptions, type YouTubeSearchOptions };
|
|
813
|
+
export { type AmazonProductOptions, type AmazonSearchOptions, BadRequestError, type GoogleAiModeOptions, type GoogleFlightsOptions, type GoogleHotelsDetailOptions, type GoogleHotelsOptions, type GoogleMapsPlaceOptions, type GoogleMapsReviewsOptions, type GoogleMapsSearchOptions, type GoogleNewsOptions, type GoogleSearchOptions, type GoogleShoppingOptions, type GoogleShoppingProductOptions, type GoogleShoppingStoresOptions, type GoogleTrendingOptions, type GoogleTrendsOptions, type InstagramCommentRepliesOptions, type InstagramFollowOptions, type InstagramPostCommentsOptions, type InstagramPostOptions, type InstagramProfileOptions, type InstagramSearchOptions, type InstagramStoriesOptions, type InstagramUserFeedOptions, InsufficientCreditsError, InvalidAPIKeyError, MissingAPIKeyError, NotFoundError, RateLimitError, type RedditPostOptions, type RedditSearchOptions, Scavio, ScavioAPIError, type ScavioConfig, ScavioConnectionError, ScavioError, ScavioTimeoutError, type TikTokCommentRepliesOptions, type TikTokHashtagOptions, type TikTokHashtagVideosOptions, type TikTokProfileOptions, type TikTokSearchUsersOptions, type TikTokSearchVideosOptions, type TikTokUserFollowersOptions, type TikTokUserFollowingsOptions, type TikTokUserPostsOptions, type TikTokVideoCommentsOptions, type TikTokVideoOptions, type WalmartProductOptions, type WalmartSearchOptions, type YouTubeMetadataOptions, type YouTubeSearchOptions };
|