scrapebadger 0.4.0 → 0.7.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 +27 -291
- package/dist/index.d.cts +1904 -102
- package/dist/index.d.ts +1904 -102
- package/dist/index.js +838 -57
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +815 -58
- package/dist/index.mjs.map +1 -1
- package/dist/twitter/index.js +1 -1
- package/dist/twitter/index.js.map +1 -1
- package/dist/twitter/index.mjs +1 -1
- package/dist/twitter/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -6,100 +6,99 @@ import 'node:events';
|
|
|
6
6
|
* TypeScript types for web scraping API responses.
|
|
7
7
|
*/
|
|
8
8
|
interface ScrapeOptions {
|
|
9
|
+
/** Output format */
|
|
10
|
+
format?: "html" | "markdown" | "text";
|
|
9
11
|
/** Whether to render JavaScript */
|
|
10
12
|
renderJs?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
proxyCountry?: string;
|
|
15
|
-
/** Proxy type (datacenter, residential) */
|
|
16
|
-
proxyType?: "datacenter" | "residential" | "mobile" | "isp";
|
|
17
|
-
/** Reuse an existing session */
|
|
18
|
-
sessionId?: string;
|
|
19
|
-
/** Force a specific engine */
|
|
20
|
-
engine?: string;
|
|
21
|
-
/** Maximum credit cost */
|
|
22
|
-
maxCost?: number;
|
|
23
|
-
/** Custom HTTP headers */
|
|
24
|
-
headers?: Record<string, string>;
|
|
25
|
-
/** CSS selector to wait for */
|
|
13
|
+
/** Force a specific engine (auto, browser) */
|
|
14
|
+
engine?: "auto" | "browser";
|
|
15
|
+
/** CSS selector or XPath to wait for */
|
|
26
16
|
waitFor?: string;
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
/**
|
|
17
|
+
/** Timeout in ms for waitFor selector (1000-120000) */
|
|
18
|
+
waitTimeout?: number;
|
|
19
|
+
/** Additional ms to wait after page load (0-30000) */
|
|
20
|
+
waitAfterLoad?: number;
|
|
21
|
+
/** Browser actions to perform before extracting */
|
|
30
22
|
jsScenario?: Array<Record<string, unknown>>;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
23
|
+
/** Session ID for persistent cookies/state */
|
|
24
|
+
sessionId?: string;
|
|
25
|
+
/** Max retry attempts on blocking (0-10) */
|
|
26
|
+
retryCount?: number;
|
|
27
|
+
/** Auto-retry on blocking detection */
|
|
28
|
+
retryOnBlock?: boolean;
|
|
29
|
+
/** ISO country code for proxy geo-targeting */
|
|
30
|
+
country?: string;
|
|
31
|
+
/** Custom HTTP headers */
|
|
32
|
+
customHeaders?: Record<string, string>;
|
|
33
|
+
/** Capture full-page screenshot */
|
|
34
|
+
screenshot?: boolean;
|
|
35
|
+
/** Record browser session as video (+3 credits) */
|
|
36
|
+
video?: boolean;
|
|
37
|
+
/** Attempt anti-bot bypass */
|
|
38
|
+
antiBot?: boolean;
|
|
39
|
+
/** Allow auto-escalation to stronger engines */
|
|
40
|
+
escalate?: boolean;
|
|
41
|
+
/** Maximum credits budget */
|
|
42
|
+
maxCost?: number;
|
|
43
|
+
/** Run AI extraction on content */
|
|
44
|
+
aiExtract?: boolean;
|
|
45
|
+
/** Natural language prompt for AI extraction (max 2000 chars) */
|
|
46
|
+
aiPrompt?: string;
|
|
47
|
+
/**
|
|
48
|
+
* When true, the server streams the raw body as `text/html` with
|
|
49
|
+
* metadata in `X-Scrape-*` response headers instead of JSON-wrapping
|
|
50
|
+
* the content. Saves 300–1000 ms on large (>1 MB) pages. Incompatible
|
|
51
|
+
* with `aiExtract`, `screenshot`, `video`.
|
|
52
|
+
*/
|
|
53
|
+
rawContent?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* When true, the server skips the generic blocking-page + anti-bot /
|
|
56
|
+
* CAPTCHA regex scans on the response body. Saves ~1.3 s on large
|
|
57
|
+
* responses. Only safe for origins known not to use consumer WAFs
|
|
58
|
+
* (Cloudflare, DataDome, Akamai, Kasada). Default false — keep
|
|
59
|
+
* disabled for general-purpose scraping.
|
|
60
|
+
*/
|
|
61
|
+
skipBotDetection?: boolean;
|
|
67
62
|
}
|
|
68
63
|
interface ScrapeResult {
|
|
69
|
-
|
|
70
|
-
status_code: number;
|
|
64
|
+
success: boolean;
|
|
71
65
|
url: string;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
processing_time_ms?: number;
|
|
75
|
-
anti_bot_detected: boolean;
|
|
76
|
-
anti_bot_provider?: string;
|
|
77
|
-
captcha_solved: boolean;
|
|
78
|
-
session_id?: string;
|
|
79
|
-
session_reused: boolean;
|
|
80
|
-
}
|
|
81
|
-
interface ScreenshotResult {
|
|
82
|
-
image_data: string;
|
|
66
|
+
status_code: number;
|
|
67
|
+
content: string | null;
|
|
83
68
|
format: string;
|
|
84
|
-
|
|
69
|
+
engine_used: string;
|
|
85
70
|
credits_used: number;
|
|
71
|
+
duration_ms: number;
|
|
72
|
+
retries_used: number;
|
|
73
|
+
content_length: number;
|
|
74
|
+
screenshot_url: string | null;
|
|
75
|
+
video_url: string | null;
|
|
76
|
+
headers: Record<string, string>;
|
|
77
|
+
blocking_detected: boolean;
|
|
78
|
+
blocking_details: Record<string, unknown> | null;
|
|
79
|
+
antibot_systems: Array<Record<string, unknown>>;
|
|
80
|
+
captcha_systems: Array<Record<string, unknown>>;
|
|
81
|
+
anti_bot_solved: boolean;
|
|
82
|
+
solver_used: string | null;
|
|
83
|
+
ai_extraction: Record<string, unknown> | string | unknown[] | null;
|
|
84
|
+
ai_model: string | null;
|
|
85
|
+
ai_error: string | null;
|
|
86
|
+
}
|
|
87
|
+
interface DetectOptions {
|
|
88
|
+
/** Request timeout in ms (1000-60000) */
|
|
89
|
+
timeout?: number;
|
|
90
|
+
/** ISO country code for proxy geo-targeting */
|
|
91
|
+
country?: string;
|
|
86
92
|
}
|
|
87
|
-
interface
|
|
88
|
-
data: Record<string, unknown>;
|
|
93
|
+
interface DetectResult {
|
|
89
94
|
url: string;
|
|
95
|
+
antibot_systems: Array<Record<string, unknown>>;
|
|
96
|
+
captcha_systems: Array<Record<string, unknown>>;
|
|
97
|
+
is_blocked: boolean;
|
|
98
|
+
blocking_type: string | null;
|
|
99
|
+
recommendation: string | null;
|
|
90
100
|
credits_used: number;
|
|
91
|
-
|
|
92
|
-
interface BatchResult {
|
|
93
|
-
results: ScrapeResult[];
|
|
94
|
-
total: number;
|
|
95
|
-
successful: number;
|
|
96
|
-
failed: number;
|
|
97
|
-
}
|
|
98
|
-
interface SessionInfo {
|
|
99
|
-
session_id: string;
|
|
100
|
-
domain: string;
|
|
101
|
-
reused: boolean;
|
|
102
|
-
fingerprint_id?: string;
|
|
101
|
+
duration_ms: number;
|
|
103
102
|
}
|
|
104
103
|
|
|
105
104
|
/**
|
|
@@ -114,19 +113,24 @@ interface SessionInfo {
|
|
|
114
113
|
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
115
114
|
*
|
|
116
115
|
* // Simple scrape
|
|
117
|
-
* const result = await client.web.scrape("https://
|
|
116
|
+
* const result = await client.web.scrape("https://scrapebadger.com");
|
|
118
117
|
* console.log(result.content);
|
|
119
118
|
*
|
|
120
|
-
* //
|
|
121
|
-
* const
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* const data = await client.web.extract("https://example.com", {
|
|
125
|
-
* schema: { title: "css:h1" }
|
|
119
|
+
* // Scrape with JavaScript rendering
|
|
120
|
+
* const rendered = await client.web.scrape("https://scrapebadger.com", {
|
|
121
|
+
* renderJs: true,
|
|
122
|
+
* format: "markdown",
|
|
126
123
|
* });
|
|
127
124
|
*
|
|
128
|
-
* //
|
|
129
|
-
* const
|
|
125
|
+
* // AI extraction
|
|
126
|
+
* const extracted = await client.web.extract(
|
|
127
|
+
* "https://scrapebadger.com/pricing",
|
|
128
|
+
* "Extract all pricing plans with their features"
|
|
129
|
+
* );
|
|
130
|
+
*
|
|
131
|
+
* // Detect anti-bot systems
|
|
132
|
+
* const detection = await client.web.detect("https://scrapebadger.com");
|
|
133
|
+
* console.log(detection.antibot_systems);
|
|
130
134
|
* ```
|
|
131
135
|
*/
|
|
132
136
|
declare class WebClient {
|
|
@@ -134,28 +138,1822 @@ declare class WebClient {
|
|
|
134
138
|
constructor(client: BaseClient);
|
|
135
139
|
/**
|
|
136
140
|
* Scrape a web page.
|
|
141
|
+
*
|
|
142
|
+
* @param url - The URL to scrape
|
|
143
|
+
* @param options - Scrape configuration options
|
|
144
|
+
* @returns The scrape result including content, metadata, and credit usage
|
|
137
145
|
*/
|
|
138
146
|
scrape(url: string, options?: ScrapeOptions): Promise<ScrapeResult>;
|
|
139
147
|
/**
|
|
140
|
-
*
|
|
148
|
+
* Extract structured data from a web page using AI.
|
|
149
|
+
*
|
|
150
|
+
* Convenience wrapper around {@link scrape} that enables AI extraction
|
|
151
|
+
* with the given prompt and defaults to markdown format.
|
|
152
|
+
*
|
|
153
|
+
* @param url - The URL to extract data from
|
|
154
|
+
* @param prompt - Natural language prompt describing what to extract (max 2000 chars)
|
|
155
|
+
* @param options - Additional scrape options (aiExtract and aiPrompt are set automatically)
|
|
156
|
+
* @returns The scrape result with ai_extraction populated
|
|
157
|
+
*/
|
|
158
|
+
extract(url: string, prompt: string, options?: ScrapeOptions): Promise<ScrapeResult>;
|
|
159
|
+
/**
|
|
160
|
+
* Detect anti-bot systems on a URL.
|
|
161
|
+
*
|
|
162
|
+
* @param url - The URL to analyze
|
|
163
|
+
* @param options - Detection options
|
|
164
|
+
* @returns Detection results including identified anti-bot and captcha systems
|
|
165
|
+
*/
|
|
166
|
+
detect(url: string, options?: DetectOptions): Promise<DetectResult>;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* TypeScript types for Vinted API responses.
|
|
171
|
+
*
|
|
172
|
+
* This module contains all the data types used by the Vinted API client.
|
|
173
|
+
*/
|
|
174
|
+
/**
|
|
175
|
+
* A price with amount and currency.
|
|
176
|
+
*/
|
|
177
|
+
interface VintedPrice {
|
|
178
|
+
/** Price amount as a string (e.g. "12.50") */
|
|
179
|
+
amount: string;
|
|
180
|
+
/** ISO currency code (e.g. "EUR") */
|
|
181
|
+
currency_code: string;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* A photo attached to a Vinted item.
|
|
185
|
+
*/
|
|
186
|
+
interface VintedPhoto {
|
|
187
|
+
/** Unique photo identifier */
|
|
188
|
+
id: number;
|
|
189
|
+
/** Photo URL */
|
|
190
|
+
url: string;
|
|
191
|
+
/** Dominant color hex code */
|
|
192
|
+
dominant_color: string | null;
|
|
193
|
+
/** Whether this is the main/cover photo */
|
|
194
|
+
is_main: boolean;
|
|
195
|
+
/** Image width in pixels */
|
|
196
|
+
width: number | null;
|
|
197
|
+
/** Image height in pixels */
|
|
198
|
+
height: number | null;
|
|
199
|
+
/** Full resolution image URL */
|
|
200
|
+
full_size_url: string | null;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Brief user information shown on item listings.
|
|
204
|
+
*/
|
|
205
|
+
interface VintedUserSummary {
|
|
206
|
+
/** Unique user identifier */
|
|
207
|
+
id: number;
|
|
208
|
+
/** Username / login handle */
|
|
209
|
+
login: string;
|
|
210
|
+
/** Profile photo URL */
|
|
211
|
+
photo_url: string | null;
|
|
212
|
+
/** Whether the user is a business account */
|
|
213
|
+
business: boolean;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Seller summary with feedback and item stats.
|
|
217
|
+
*/
|
|
218
|
+
interface VintedSellerSummary extends VintedUserSummary {
|
|
219
|
+
/** Total number of feedback ratings */
|
|
220
|
+
feedback_count: number;
|
|
221
|
+
/** Overall feedback reputation score (0-1) */
|
|
222
|
+
feedback_reputation: number;
|
|
223
|
+
/** Number of items listed */
|
|
224
|
+
item_count: number;
|
|
225
|
+
/** Seller's location */
|
|
226
|
+
location: string | null;
|
|
227
|
+
/** Last activity timestamp (ISO format) */
|
|
228
|
+
last_seen: string | null;
|
|
229
|
+
/** Achievement badges */
|
|
230
|
+
badges: string[];
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* A Vinted item summary as returned in search results and listings.
|
|
234
|
+
*/
|
|
235
|
+
interface VintedItemSummary {
|
|
236
|
+
/** Unique item identifier */
|
|
237
|
+
id: number;
|
|
238
|
+
/** Item title */
|
|
239
|
+
title: string;
|
|
240
|
+
/** Item price */
|
|
241
|
+
price: VintedPrice;
|
|
242
|
+
/** Brand name */
|
|
243
|
+
brand_title: string;
|
|
244
|
+
/** Size label */
|
|
245
|
+
size_title: string;
|
|
246
|
+
/** Item condition status */
|
|
247
|
+
status: string;
|
|
248
|
+
/** Item URL on Vinted */
|
|
249
|
+
url: string;
|
|
250
|
+
/** Number of users who favorited this item */
|
|
251
|
+
favourite_count: number;
|
|
252
|
+
/** Number of views */
|
|
253
|
+
view_count: number;
|
|
254
|
+
/** Item owner summary */
|
|
255
|
+
user: VintedUserSummary;
|
|
256
|
+
/** Main photo */
|
|
257
|
+
photo: VintedPhoto;
|
|
258
|
+
/** All photos */
|
|
259
|
+
photos: VintedPhoto[];
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Full item detail with all metadata.
|
|
263
|
+
*/
|
|
264
|
+
interface VintedItemDetail extends VintedItemSummary {
|
|
265
|
+
/** Item description */
|
|
266
|
+
description: string;
|
|
267
|
+
/** Catalog category identifier */
|
|
268
|
+
catalog_id: number;
|
|
269
|
+
/** Primary color */
|
|
270
|
+
color1: string;
|
|
271
|
+
/** Seller details */
|
|
272
|
+
seller: VintedSellerSummary;
|
|
273
|
+
/** Category name */
|
|
274
|
+
category: string;
|
|
275
|
+
/** Upload timestamp (ISO format) */
|
|
276
|
+
upload_date: string;
|
|
277
|
+
/** Whether the item can be purchased */
|
|
278
|
+
can_buy: boolean;
|
|
279
|
+
/** Whether instant buy is enabled */
|
|
280
|
+
instant_buy: boolean;
|
|
281
|
+
/** Whether the listing is closed */
|
|
282
|
+
is_closed: boolean;
|
|
283
|
+
/** Whether the item is reserved */
|
|
284
|
+
is_reserved: boolean;
|
|
285
|
+
/** Whether the item is hidden */
|
|
286
|
+
is_hidden: boolean;
|
|
287
|
+
/** Size identifier */
|
|
288
|
+
size_id: number;
|
|
289
|
+
/** Status identifier */
|
|
290
|
+
status_id: number;
|
|
291
|
+
/** Brand identifier */
|
|
292
|
+
brand_id: number;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Full Vinted user profile.
|
|
296
|
+
*/
|
|
297
|
+
interface VintedUserProfile {
|
|
298
|
+
/** Unique user identifier */
|
|
299
|
+
id: number;
|
|
300
|
+
/** Username / login handle */
|
|
301
|
+
login: string;
|
|
302
|
+
/** Profile photo URL */
|
|
303
|
+
photo_url: string | null;
|
|
304
|
+
/** Whether the user is a business account */
|
|
305
|
+
business: boolean;
|
|
306
|
+
/** ISO country code */
|
|
307
|
+
country_code: string;
|
|
308
|
+
/** City name */
|
|
309
|
+
city: string;
|
|
310
|
+
/** Total feedback count */
|
|
311
|
+
feedback_count: number;
|
|
312
|
+
/** Overall feedback reputation (0-1) */
|
|
313
|
+
feedback_reputation: number;
|
|
314
|
+
/** Number of positive ratings */
|
|
315
|
+
positive_feedback_count: number;
|
|
316
|
+
/** Number of neutral ratings */
|
|
317
|
+
neutral_feedback_count: number;
|
|
318
|
+
/** Number of negative ratings */
|
|
319
|
+
negative_feedback_count: number;
|
|
320
|
+
/** Number of items listed */
|
|
321
|
+
item_count: number;
|
|
322
|
+
/** Number of followers */
|
|
323
|
+
followers_count: number;
|
|
324
|
+
/** Number of users this user follows */
|
|
325
|
+
following_count: number;
|
|
326
|
+
/** Whether the user is currently online */
|
|
327
|
+
is_online: boolean;
|
|
328
|
+
/** Whether the user is on holiday mode */
|
|
329
|
+
is_on_holiday: boolean;
|
|
330
|
+
/** Last login timestamp (Unix) */
|
|
331
|
+
last_loged_on_ts: string;
|
|
332
|
+
/** Full profile URL */
|
|
333
|
+
profile_url: string;
|
|
334
|
+
/** User locale */
|
|
335
|
+
locale: string;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* A Vinted brand.
|
|
339
|
+
*/
|
|
340
|
+
interface VintedBrand {
|
|
341
|
+
/** Unique brand identifier */
|
|
342
|
+
id: number;
|
|
343
|
+
/** Brand name */
|
|
344
|
+
title: string;
|
|
345
|
+
/** URL-friendly slug */
|
|
346
|
+
slug: string;
|
|
347
|
+
/** Number of items with this brand */
|
|
348
|
+
item_count: number;
|
|
349
|
+
/** Number of users who favorited this brand */
|
|
350
|
+
favourite_count: number;
|
|
351
|
+
/** Whether the brand is classified as luxury */
|
|
352
|
+
is_luxury: boolean;
|
|
353
|
+
/** Brand page URL */
|
|
354
|
+
url: string;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* A Vinted color option.
|
|
358
|
+
*/
|
|
359
|
+
interface VintedColor {
|
|
360
|
+
/** Unique color identifier */
|
|
361
|
+
id: number;
|
|
362
|
+
/** Color display name */
|
|
363
|
+
title: string;
|
|
364
|
+
/** Hex color code */
|
|
365
|
+
hex: string;
|
|
366
|
+
/** Internal color code */
|
|
367
|
+
code: string;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* A Vinted item condition status.
|
|
371
|
+
*/
|
|
372
|
+
interface VintedStatus {
|
|
373
|
+
/** Unique status identifier */
|
|
374
|
+
id: number;
|
|
375
|
+
/** Status display name */
|
|
376
|
+
title: string;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* A Vinted marketplace/country.
|
|
380
|
+
*/
|
|
381
|
+
interface VintedMarket {
|
|
382
|
+
/** Market code (e.g. "fr", "de") */
|
|
383
|
+
code: string;
|
|
384
|
+
/** Vinted domain for this market */
|
|
385
|
+
domain: string;
|
|
386
|
+
/** Country name */
|
|
387
|
+
country: string;
|
|
388
|
+
/** Currency code */
|
|
389
|
+
currency: string;
|
|
390
|
+
/** Market display name */
|
|
391
|
+
name: string;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Pagination metadata for list responses.
|
|
395
|
+
*/
|
|
396
|
+
interface VintedPagination {
|
|
397
|
+
/** Current page number */
|
|
398
|
+
current_page: number;
|
|
399
|
+
/** Total number of pages */
|
|
400
|
+
total_pages: number;
|
|
401
|
+
/** Total number of entries */
|
|
402
|
+
total_entries: number;
|
|
403
|
+
/** Items per page */
|
|
404
|
+
per_page: number;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Response from the search endpoint.
|
|
408
|
+
*/
|
|
409
|
+
interface SearchResponse {
|
|
410
|
+
/** List of matching items */
|
|
411
|
+
items: VintedItemSummary[];
|
|
412
|
+
/** Pagination metadata */
|
|
413
|
+
pagination: VintedPagination;
|
|
414
|
+
/** Market code used for this search */
|
|
415
|
+
market: string;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Response from the item detail endpoint.
|
|
419
|
+
*/
|
|
420
|
+
interface ItemDetailResponse {
|
|
421
|
+
/** Full item details */
|
|
422
|
+
item: VintedItemDetail;
|
|
423
|
+
/** Market code used */
|
|
424
|
+
market: string;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Response from the user profile endpoint.
|
|
428
|
+
*/
|
|
429
|
+
interface UserProfileResponse {
|
|
430
|
+
/** Full user profile */
|
|
431
|
+
user: VintedUserProfile;
|
|
432
|
+
/** Market code used */
|
|
433
|
+
market: string;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Response from the user items endpoint.
|
|
437
|
+
*/
|
|
438
|
+
interface UserItemsResponse {
|
|
439
|
+
/** List of user's items */
|
|
440
|
+
items: VintedItemSummary[];
|
|
441
|
+
/** Pagination metadata */
|
|
442
|
+
pagination: VintedPagination;
|
|
443
|
+
/** Market code used */
|
|
444
|
+
market: string;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Response from the brands endpoint.
|
|
448
|
+
*/
|
|
449
|
+
interface BrandsResponse {
|
|
450
|
+
/** List of brands */
|
|
451
|
+
brands: VintedBrand[];
|
|
452
|
+
/** Pagination metadata (null when no pagination) */
|
|
453
|
+
pagination: VintedPagination | null;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Response from the colors endpoint.
|
|
457
|
+
*/
|
|
458
|
+
interface ColorsResponse {
|
|
459
|
+
/** List of available colors */
|
|
460
|
+
colors: VintedColor[];
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Response from the statuses endpoint.
|
|
464
|
+
*/
|
|
465
|
+
interface StatusesResponse {
|
|
466
|
+
/** List of item condition statuses */
|
|
467
|
+
statuses: VintedStatus[];
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Response from the markets endpoint.
|
|
471
|
+
*/
|
|
472
|
+
interface MarketsResponse {
|
|
473
|
+
/** List of available markets */
|
|
474
|
+
markets: VintedMarket[];
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Parameters for searching Vinted items.
|
|
478
|
+
*/
|
|
479
|
+
interface VintedSearchParams {
|
|
480
|
+
/** Search query string */
|
|
481
|
+
query: string;
|
|
482
|
+
/** Market code (default: "fr") */
|
|
483
|
+
market?: string;
|
|
484
|
+
/** Page number */
|
|
485
|
+
page?: number;
|
|
486
|
+
/** Items per page */
|
|
487
|
+
per_page?: number;
|
|
488
|
+
/** Minimum price filter */
|
|
489
|
+
price_from?: number;
|
|
490
|
+
/** Maximum price filter */
|
|
491
|
+
price_to?: number;
|
|
492
|
+
/** Comma-separated brand IDs */
|
|
493
|
+
brand_ids?: string;
|
|
494
|
+
/** Comma-separated color IDs */
|
|
495
|
+
color_ids?: string;
|
|
496
|
+
/** Comma-separated status IDs */
|
|
497
|
+
status_ids?: string;
|
|
498
|
+
/** Sort order */
|
|
499
|
+
order?: "relevance" | "newest_first" | "price_low_to_high" | "price_high_to_low";
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* Vinted Search API client.
|
|
504
|
+
*
|
|
505
|
+
* Provides methods for searching Vinted item listings.
|
|
506
|
+
*/
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* Client for Vinted search endpoints.
|
|
510
|
+
*
|
|
511
|
+
* @example
|
|
512
|
+
* ```typescript
|
|
513
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
514
|
+
*
|
|
515
|
+
* // Basic search
|
|
516
|
+
* const results = await client.vinted.search.search({ query: "nike air max" });
|
|
517
|
+
* for (const item of results.items) {
|
|
518
|
+
* console.log(`${item.title} — ${item.price.amount} ${item.price.currency_code}`);
|
|
519
|
+
* }
|
|
520
|
+
*
|
|
521
|
+
* // Search with filters
|
|
522
|
+
* const filtered = await client.vinted.search.search({
|
|
523
|
+
* query: "adidas",
|
|
524
|
+
* market: "de",
|
|
525
|
+
* price_from: 10,
|
|
526
|
+
* price_to: 50,
|
|
527
|
+
* order: "price_low_to_high",
|
|
528
|
+
* });
|
|
529
|
+
* ```
|
|
530
|
+
*/
|
|
531
|
+
declare class SearchClient$1 {
|
|
532
|
+
private readonly client;
|
|
533
|
+
constructor(client: BaseClient);
|
|
534
|
+
/**
|
|
535
|
+
* Search for Vinted items.
|
|
536
|
+
*
|
|
537
|
+
* @param params - Search parameters including query, filters, and pagination.
|
|
538
|
+
* @returns Search results with items and pagination metadata.
|
|
539
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
540
|
+
* @throws ValidationError - If the search parameters are invalid.
|
|
541
|
+
*
|
|
542
|
+
* @example
|
|
543
|
+
* ```typescript
|
|
544
|
+
* const results = await client.vinted.search.search({
|
|
545
|
+
* query: "vintage jacket",
|
|
546
|
+
* market: "fr",
|
|
547
|
+
* page: 1,
|
|
548
|
+
* per_page: 20,
|
|
549
|
+
* order: "newest_first",
|
|
550
|
+
* });
|
|
551
|
+
* console.log(`Found ${results.pagination.total_entries} items`);
|
|
552
|
+
* ```
|
|
553
|
+
*/
|
|
554
|
+
search(params: VintedSearchParams): Promise<SearchResponse>;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Vinted Items API client.
|
|
559
|
+
*
|
|
560
|
+
* Provides methods for fetching individual Vinted item details.
|
|
561
|
+
*/
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Client for Vinted item endpoints.
|
|
565
|
+
*
|
|
566
|
+
* @example
|
|
567
|
+
* ```typescript
|
|
568
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
569
|
+
*
|
|
570
|
+
* const item = await client.vinted.items.get(123456789, { market: "fr" });
|
|
571
|
+
* console.log(`${item.item.title} — ${item.item.price.amount} ${item.item.price.currency_code}`);
|
|
572
|
+
* console.log(`Seller: ${item.item.seller.login}`);
|
|
573
|
+
* ```
|
|
574
|
+
*/
|
|
575
|
+
declare class ItemsClient {
|
|
576
|
+
private readonly client;
|
|
577
|
+
constructor(client: BaseClient);
|
|
578
|
+
/**
|
|
579
|
+
* Get a single item by ID.
|
|
580
|
+
*
|
|
581
|
+
* @param itemId - The Vinted item ID to fetch.
|
|
582
|
+
* @param options - Optional parameters.
|
|
583
|
+
* @param options.market - Market code (default: "fr").
|
|
584
|
+
* @returns The item detail response including full item data.
|
|
585
|
+
* @throws NotFoundError - If the item doesn't exist.
|
|
586
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
587
|
+
*
|
|
588
|
+
* @example
|
|
589
|
+
* ```typescript
|
|
590
|
+
* const response = await client.vinted.items.get(123456789);
|
|
591
|
+
* const { item } = response;
|
|
592
|
+
* console.log(`${item.title}: ${item.description}`);
|
|
593
|
+
* console.log(`Brand: ${item.brand_title}, Size: ${item.size_title}`);
|
|
594
|
+
* console.log(`Photos: ${item.photos.length}`);
|
|
595
|
+
* ```
|
|
596
|
+
*/
|
|
597
|
+
get(itemId: number, options?: {
|
|
598
|
+
market?: string;
|
|
599
|
+
}): Promise<ItemDetailResponse>;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Vinted Users API client.
|
|
604
|
+
*
|
|
605
|
+
* Provides methods for fetching Vinted user profiles and their item listings.
|
|
606
|
+
*/
|
|
607
|
+
|
|
608
|
+
/**
|
|
609
|
+
* Client for Vinted user endpoints.
|
|
610
|
+
*
|
|
611
|
+
* @example
|
|
612
|
+
* ```typescript
|
|
613
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
614
|
+
*
|
|
615
|
+
* // Get user profile
|
|
616
|
+
* const profile = await client.vinted.users.getProfile(12345);
|
|
617
|
+
* console.log(`${profile.user.login} — ${profile.user.item_count} items`);
|
|
618
|
+
*
|
|
619
|
+
* // Get user's items
|
|
620
|
+
* const items = await client.vinted.users.getItems(12345);
|
|
621
|
+
* for (const item of items.items) {
|
|
622
|
+
* console.log(`${item.title} — ${item.price.amount} ${item.price.currency_code}`);
|
|
623
|
+
* }
|
|
624
|
+
* ```
|
|
625
|
+
*/
|
|
626
|
+
declare class UsersClient {
|
|
627
|
+
private readonly client;
|
|
628
|
+
constructor(client: BaseClient);
|
|
629
|
+
/**
|
|
630
|
+
* Get a user's profile.
|
|
631
|
+
*
|
|
632
|
+
* @param userId - The Vinted user ID.
|
|
633
|
+
* @param options - Optional parameters.
|
|
634
|
+
* @param options.market - Market code (default: "fr").
|
|
635
|
+
* @returns The user profile response.
|
|
636
|
+
* @throws NotFoundError - If the user doesn't exist.
|
|
637
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
638
|
+
*
|
|
639
|
+
* @example
|
|
640
|
+
* ```typescript
|
|
641
|
+
* const response = await client.vinted.users.getProfile(12345);
|
|
642
|
+
* const { user } = response;
|
|
643
|
+
* console.log(`${user.login} from ${user.city}, ${user.country_code}`);
|
|
644
|
+
* console.log(`Reputation: ${user.feedback_reputation}`);
|
|
645
|
+
* console.log(`Items: ${user.item_count}, Followers: ${user.followers_count}`);
|
|
646
|
+
* ```
|
|
647
|
+
*/
|
|
648
|
+
getProfile(userId: number, options?: {
|
|
649
|
+
market?: string;
|
|
650
|
+
}): Promise<UserProfileResponse>;
|
|
651
|
+
/**
|
|
652
|
+
* Get items listed by a user.
|
|
653
|
+
*
|
|
654
|
+
* @param userId - The Vinted user ID.
|
|
655
|
+
* @param options - Optional parameters for pagination and market.
|
|
656
|
+
* @param options.market - Market code (default: "fr").
|
|
657
|
+
* @param options.page - Page number.
|
|
658
|
+
* @param options.per_page - Items per page.
|
|
659
|
+
* @returns The user's items with pagination metadata.
|
|
660
|
+
* @throws NotFoundError - If the user doesn't exist.
|
|
661
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
662
|
+
*
|
|
663
|
+
* @example
|
|
664
|
+
* ```typescript
|
|
665
|
+
* const response = await client.vinted.users.getItems(12345, {
|
|
666
|
+
* market: "de",
|
|
667
|
+
* page: 1,
|
|
668
|
+
* per_page: 20,
|
|
669
|
+
* });
|
|
670
|
+
* console.log(`Page ${response.pagination.current_page} of ${response.pagination.total_pages}`);
|
|
671
|
+
* for (const item of response.items) {
|
|
672
|
+
* console.log(`${item.title} — ${item.price.amount} ${item.price.currency_code}`);
|
|
673
|
+
* }
|
|
674
|
+
* ```
|
|
141
675
|
*/
|
|
142
|
-
|
|
676
|
+
getItems(userId: number, options?: {
|
|
677
|
+
market?: string;
|
|
678
|
+
page?: number;
|
|
679
|
+
per_page?: number;
|
|
680
|
+
}): Promise<UserItemsResponse>;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Vinted Reference Data API client.
|
|
685
|
+
*
|
|
686
|
+
* Provides methods for fetching brands, colors, statuses, and markets.
|
|
687
|
+
*/
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Client for Vinted reference data endpoints.
|
|
691
|
+
*
|
|
692
|
+
* @example
|
|
693
|
+
* ```typescript
|
|
694
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
695
|
+
*
|
|
696
|
+
* // Get available markets
|
|
697
|
+
* const markets = await client.vinted.reference.markets();
|
|
698
|
+
* for (const market of markets.markets) {
|
|
699
|
+
* console.log(`${market.name} (${market.code}) — ${market.currency}`);
|
|
700
|
+
* }
|
|
701
|
+
*
|
|
702
|
+
* // Search brands
|
|
703
|
+
* const brands = await client.vinted.reference.brands({ keyword: "nike" });
|
|
704
|
+
* for (const brand of brands.brands) {
|
|
705
|
+
* console.log(`${brand.title}: ${brand.item_count} items`);
|
|
706
|
+
* }
|
|
707
|
+
* ```
|
|
708
|
+
*/
|
|
709
|
+
declare class ReferenceClient {
|
|
710
|
+
private readonly client;
|
|
711
|
+
constructor(client: BaseClient);
|
|
143
712
|
/**
|
|
144
|
-
*
|
|
713
|
+
* Search for brands by keyword.
|
|
714
|
+
*
|
|
715
|
+
* @param options - Optional parameters.
|
|
716
|
+
* @param options.keyword - Brand name to search for.
|
|
717
|
+
* @param options.market - Market code (default: "fr").
|
|
718
|
+
* @param options.per_page - Number of results per page.
|
|
719
|
+
* @returns Brands matching the keyword.
|
|
720
|
+
*
|
|
721
|
+
* @example
|
|
722
|
+
* ```typescript
|
|
723
|
+
* const response = await client.vinted.reference.brands({
|
|
724
|
+
* keyword: "adidas",
|
|
725
|
+
* market: "de",
|
|
726
|
+
* per_page: 10,
|
|
727
|
+
* });
|
|
728
|
+
* for (const brand of response.brands) {
|
|
729
|
+
* console.log(`${brand.title} (${brand.slug}): ${brand.item_count} items`);
|
|
730
|
+
* }
|
|
731
|
+
* ```
|
|
145
732
|
*/
|
|
146
|
-
|
|
733
|
+
brands(options?: {
|
|
734
|
+
keyword?: string;
|
|
735
|
+
market?: string;
|
|
736
|
+
per_page?: number;
|
|
737
|
+
}): Promise<BrandsResponse>;
|
|
147
738
|
/**
|
|
148
|
-
*
|
|
739
|
+
* Get available colors for a market.
|
|
740
|
+
*
|
|
741
|
+
* @param options - Optional parameters.
|
|
742
|
+
* @param options.market - Market code (default: "fr").
|
|
743
|
+
* @returns List of available colors.
|
|
744
|
+
*
|
|
745
|
+
* @example
|
|
746
|
+
* ```typescript
|
|
747
|
+
* const response = await client.vinted.reference.colors({ market: "fr" });
|
|
748
|
+
* for (const color of response.colors) {
|
|
749
|
+
* console.log(`${color.title} (#${color.hex})`);
|
|
750
|
+
* }
|
|
751
|
+
* ```
|
|
149
752
|
*/
|
|
150
|
-
|
|
753
|
+
colors(options?: {
|
|
754
|
+
market?: string;
|
|
755
|
+
}): Promise<ColorsResponse>;
|
|
151
756
|
/**
|
|
152
|
-
*
|
|
757
|
+
* Get available item condition statuses for a market.
|
|
758
|
+
*
|
|
759
|
+
* @param options - Optional parameters.
|
|
760
|
+
* @param options.market - Market code (default: "fr").
|
|
761
|
+
* @returns List of item condition statuses.
|
|
762
|
+
*
|
|
763
|
+
* @example
|
|
764
|
+
* ```typescript
|
|
765
|
+
* const response = await client.vinted.reference.statuses({ market: "fr" });
|
|
766
|
+
* for (const status of response.statuses) {
|
|
767
|
+
* console.log(`${status.id}: ${status.title}`);
|
|
768
|
+
* }
|
|
769
|
+
* ```
|
|
153
770
|
*/
|
|
154
|
-
|
|
771
|
+
statuses(options?: {
|
|
772
|
+
market?: string;
|
|
773
|
+
}): Promise<StatusesResponse>;
|
|
155
774
|
/**
|
|
156
|
-
*
|
|
775
|
+
* Get all available Vinted markets.
|
|
776
|
+
*
|
|
777
|
+
* @returns List of all supported Vinted markets/countries.
|
|
778
|
+
*
|
|
779
|
+
* @example
|
|
780
|
+
* ```typescript
|
|
781
|
+
* const response = await client.vinted.reference.markets();
|
|
782
|
+
* for (const market of response.markets) {
|
|
783
|
+
* console.log(`${market.name}: ${market.domain} (${market.currency})`);
|
|
784
|
+
* }
|
|
785
|
+
* ```
|
|
157
786
|
*/
|
|
158
|
-
|
|
787
|
+
markets(): Promise<MarketsResponse>;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Vinted API client.
|
|
792
|
+
*
|
|
793
|
+
* Provides access to all Vinted API endpoints through specialized sub-clients.
|
|
794
|
+
*/
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* Vinted API client with access to all Vinted endpoints.
|
|
798
|
+
*
|
|
799
|
+
* Provides sub-clients for different resource types:
|
|
800
|
+
* - `search` - Search for items across Vinted marketplaces
|
|
801
|
+
* - `items` - Get individual item details
|
|
802
|
+
* - `users` - User profiles and their item listings
|
|
803
|
+
* - `reference` - Reference data (brands, colors, statuses, markets)
|
|
804
|
+
*
|
|
805
|
+
* @example
|
|
806
|
+
* ```typescript
|
|
807
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
808
|
+
*
|
|
809
|
+
* // Search items
|
|
810
|
+
* const results = await client.vinted.search.search({ query: "nike air max" });
|
|
811
|
+
*
|
|
812
|
+
* // Get item details
|
|
813
|
+
* const item = await client.vinted.items.get(123456789);
|
|
814
|
+
*
|
|
815
|
+
* // Get user profile
|
|
816
|
+
* const user = await client.vinted.users.getProfile(12345);
|
|
817
|
+
*
|
|
818
|
+
* // Get reference data
|
|
819
|
+
* const markets = await client.vinted.reference.markets();
|
|
820
|
+
* ```
|
|
821
|
+
*/
|
|
822
|
+
declare class VintedClient {
|
|
823
|
+
/** Client for item search operations */
|
|
824
|
+
readonly search: SearchClient$1;
|
|
825
|
+
/** Client for individual item operations */
|
|
826
|
+
readonly items: ItemsClient;
|
|
827
|
+
/** Client for user operations */
|
|
828
|
+
readonly users: UsersClient;
|
|
829
|
+
/** Client for reference data (brands, colors, statuses, markets) */
|
|
830
|
+
readonly reference: ReferenceClient;
|
|
831
|
+
/**
|
|
832
|
+
* Create a new Vinted client.
|
|
833
|
+
*
|
|
834
|
+
* @param client - The base HTTP client for making requests.
|
|
835
|
+
*/
|
|
836
|
+
constructor(client: BaseClient);
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
/**
|
|
840
|
+
* TypeScript parameter types for Google Scraper API sub-clients.
|
|
841
|
+
*
|
|
842
|
+
* Response types use `Record<string, unknown>` rather than strict interfaces
|
|
843
|
+
* because the Google API returns rich nested data that mirrors the server-side
|
|
844
|
+
* Pydantic models; users can cast to their own typed shapes as needed. All
|
|
845
|
+
* parameter types are strictly typed.
|
|
846
|
+
*/
|
|
847
|
+
type GoogleResponse = Record<string, unknown>;
|
|
848
|
+
interface GoogleSearchParams {
|
|
849
|
+
q: string;
|
|
850
|
+
gl?: string;
|
|
851
|
+
hl?: string;
|
|
852
|
+
num?: number;
|
|
853
|
+
start?: number;
|
|
854
|
+
domain?: string;
|
|
855
|
+
device?: "desktop" | "mobile";
|
|
856
|
+
location?: string;
|
|
857
|
+
lr?: string;
|
|
858
|
+
tbs?: string;
|
|
859
|
+
safe?: "off" | "medium" | "high";
|
|
860
|
+
uule?: string;
|
|
861
|
+
filter?: number;
|
|
862
|
+
nfpr?: number;
|
|
863
|
+
cr?: string;
|
|
864
|
+
ludocid?: string;
|
|
865
|
+
lsig?: string;
|
|
866
|
+
kgmid?: string;
|
|
867
|
+
si?: string;
|
|
868
|
+
ibp?: string;
|
|
869
|
+
uds?: string;
|
|
870
|
+
/**
|
|
871
|
+
* When true, chase Google's deferred AI Overview `page_token` with a
|
|
872
|
+
* follow-up fetch and merge the result back into `ai_overview`. Adds
|
|
873
|
+
* ~1s when the SERP actually defers the overview. Credit cost is
|
|
874
|
+
* configured per-endpoint by admins — query `/public/pricing` for the
|
|
875
|
+
* live rate.
|
|
876
|
+
*/
|
|
877
|
+
ai_overview?: boolean;
|
|
878
|
+
}
|
|
879
|
+
interface MapsSearchParams {
|
|
880
|
+
/** Search query. Required unless `place_id` or `ludocid` is supplied. */
|
|
881
|
+
q?: string;
|
|
882
|
+
/** GPS coords as `@lat,lng,zoom` (e.g. `@40.745,-74.008,14z`). */
|
|
883
|
+
ll?: string;
|
|
884
|
+
gl?: string;
|
|
885
|
+
hl?: string;
|
|
886
|
+
start?: number;
|
|
887
|
+
/** 1-indexed page number (alternative to `start`). */
|
|
888
|
+
page?: number;
|
|
889
|
+
/** Business-type slug (e.g. `restaurant`, `hotel`). */
|
|
890
|
+
type?: string;
|
|
891
|
+
/** Raw Google Maps `pb=` override for advanced queries. */
|
|
892
|
+
data?: string;
|
|
893
|
+
/** Google Place ID (`ChIJ...`) — direct-lookup a single place. */
|
|
894
|
+
place_id?: string;
|
|
895
|
+
/** Google Location Document ID (CID) — direct-lookup by CID. */
|
|
896
|
+
ludocid?: string;
|
|
897
|
+
}
|
|
898
|
+
interface MapsPlaceParams {
|
|
899
|
+
place_id?: string;
|
|
900
|
+
data_id?: string;
|
|
901
|
+
hl?: string;
|
|
902
|
+
gl?: string;
|
|
903
|
+
}
|
|
904
|
+
interface MapsReviewsParams {
|
|
905
|
+
data_id: string;
|
|
906
|
+
sort_by?: "qualityScore" | "newestFirst" | "ratingHigh" | "ratingLow";
|
|
907
|
+
hl?: string;
|
|
908
|
+
next_page_token?: string;
|
|
909
|
+
results?: number;
|
|
910
|
+
}
|
|
911
|
+
interface MapsPhotosParams {
|
|
912
|
+
data_id: string;
|
|
913
|
+
hl?: string;
|
|
914
|
+
next_page_token?: string;
|
|
915
|
+
}
|
|
916
|
+
interface MapsPostsParams {
|
|
917
|
+
/** Google Maps data ID (`0x...:0x...`). Required unless `place_id` is set. */
|
|
918
|
+
data_id?: string;
|
|
919
|
+
/** Google Place ID — alternative to `data_id`. */
|
|
920
|
+
place_id?: string;
|
|
921
|
+
hl?: string;
|
|
922
|
+
gl?: string;
|
|
923
|
+
next_page_token?: string;
|
|
924
|
+
}
|
|
925
|
+
interface NewsSearchParams {
|
|
926
|
+
/** Free-text keyword query. Pass this OR one of the token fields below. */
|
|
927
|
+
q?: string;
|
|
928
|
+
hl?: string;
|
|
929
|
+
gl?: string;
|
|
930
|
+
max_results?: number;
|
|
931
|
+
/** Google News topic token (from a previous response's `topic_token`). */
|
|
932
|
+
topic_token?: string;
|
|
933
|
+
/** Google News publication token — scopes results to a single publisher. */
|
|
934
|
+
publication_token?: string;
|
|
935
|
+
/** Google News story token — scopes results to a single story cluster. */
|
|
936
|
+
story_token?: string;
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* Canonical Google News topic codes. Any string is accepted at runtime —
|
|
940
|
+
* use `NewsTopic` for IDE autocomplete on the standard topics and fall
|
|
941
|
+
* back to a plain `string` when you know the topic code out-of-band.
|
|
942
|
+
*/
|
|
943
|
+
type NewsTopic = "WORLD" | "BUSINESS" | "TECHNOLOGY" | "ENTERTAINMENT" | "SPORTS" | "SCIENCE" | "HEALTH";
|
|
944
|
+
interface NewsTopicsParams {
|
|
945
|
+
topic: NewsTopic | (string & {});
|
|
946
|
+
hl?: string;
|
|
947
|
+
gl?: string;
|
|
948
|
+
max_results?: number;
|
|
949
|
+
}
|
|
950
|
+
interface NewsTrendingParams {
|
|
951
|
+
hl?: string;
|
|
952
|
+
gl?: string;
|
|
953
|
+
max_results?: number;
|
|
954
|
+
}
|
|
955
|
+
interface HotelsSearchParams {
|
|
956
|
+
q: string;
|
|
957
|
+
check_in: string;
|
|
958
|
+
check_out: string;
|
|
959
|
+
adults?: number;
|
|
960
|
+
currency?: string;
|
|
961
|
+
gl?: string;
|
|
962
|
+
}
|
|
963
|
+
interface HotelsDetailsParams {
|
|
964
|
+
property_token: string;
|
|
965
|
+
check_in: string;
|
|
966
|
+
check_out: string;
|
|
967
|
+
}
|
|
968
|
+
interface TrendsInterestParams {
|
|
969
|
+
q: string;
|
|
970
|
+
geo?: string;
|
|
971
|
+
date?: string;
|
|
972
|
+
}
|
|
973
|
+
interface TrendsRegionsParams {
|
|
974
|
+
q: string;
|
|
975
|
+
geo?: string;
|
|
976
|
+
}
|
|
977
|
+
interface TrendsRelatedParams {
|
|
978
|
+
q: string;
|
|
979
|
+
geo?: string;
|
|
980
|
+
}
|
|
981
|
+
interface TrendsTrendingParams {
|
|
982
|
+
geo?: string;
|
|
983
|
+
}
|
|
984
|
+
type TrendsCategory = "all" | "business" | "entertainment" | "health" | "sci_tech" | "sports" | "top_stories" | "b" | "e" | "m" | "t" | "s" | "h";
|
|
985
|
+
type TrendsTrendingStatus = "all" | "active";
|
|
986
|
+
type TrendsTrendingSort = "relevance" | "search_volume" | "title" | "recency";
|
|
987
|
+
interface TrendsTrendingNowParams {
|
|
988
|
+
/** Country code (e.g. "US", "LT", "GB"). */
|
|
989
|
+
geo?: string;
|
|
990
|
+
/** Look-back window in hours. Common: 4, 24, 48, 168. */
|
|
991
|
+
hours?: number;
|
|
992
|
+
/** Category filter. */
|
|
993
|
+
category?: TrendsCategory;
|
|
994
|
+
/** Trend state: "all" (default) or "active" (only non-zero search volume). */
|
|
995
|
+
status?: TrendsTrendingStatus;
|
|
996
|
+
/** Sort order: relevance / search_volume / title / recency. */
|
|
997
|
+
sort?: TrendsTrendingSort;
|
|
998
|
+
/** Language code (e.g. "en-US"). */
|
|
999
|
+
hl?: string;
|
|
1000
|
+
}
|
|
1001
|
+
type TrendsDataType = "TIMESERIES" | "GEO_MAP" | "GEO_MAP_0" | "RELATED_TOPICS" | "RELATED_QUERIES";
|
|
1002
|
+
interface TrendsSearchParams {
|
|
1003
|
+
/** Search term(s). Comma-separated (max 5) for TIMESERIES / GEO_MAP. */
|
|
1004
|
+
q: string;
|
|
1005
|
+
data_type?: TrendsDataType;
|
|
1006
|
+
geo?: string;
|
|
1007
|
+
date?: string;
|
|
1008
|
+
cat?: number;
|
|
1009
|
+
gprop?: string;
|
|
1010
|
+
region?: "COUNTRY" | "REGION" | "DMA" | "CITY";
|
|
1011
|
+
language?: string;
|
|
1012
|
+
tz?: string;
|
|
1013
|
+
}
|
|
1014
|
+
interface TrendsAutocompleteParams {
|
|
1015
|
+
/** Query prefix to resolve into Trends topics. */
|
|
1016
|
+
q: string;
|
|
1017
|
+
/** Language code (e.g. "en-US"). */
|
|
1018
|
+
hl?: string;
|
|
1019
|
+
/** Timezone offset in minutes. */
|
|
1020
|
+
tz?: string;
|
|
1021
|
+
}
|
|
1022
|
+
interface JobsSearchParams {
|
|
1023
|
+
q: string;
|
|
1024
|
+
/**
|
|
1025
|
+
* Data source.
|
|
1026
|
+
* - `"rpc"` (default, ~1-2 s): Google Careers batchexecute RPC —
|
|
1027
|
+
* structured JSON, scope = Google's own openings.
|
|
1028
|
+
* - `"serp"`: public Google Jobs SERP aggregator — 3rd-party listings
|
|
1029
|
+
* (LinkedIn, Indeed, Built In, ZipRecruiter, …).
|
|
1030
|
+
*/
|
|
1031
|
+
mode?: "rpc" | "serp";
|
|
1032
|
+
location?: string;
|
|
1033
|
+
gl?: string;
|
|
1034
|
+
/** Alias for gl. */
|
|
1035
|
+
country?: string;
|
|
1036
|
+
hl?: string;
|
|
1037
|
+
/** Alias for hl (accepts "en-US" etc). */
|
|
1038
|
+
language?: string;
|
|
1039
|
+
/** Google domain (google.com, google.co.uk, …). */
|
|
1040
|
+
domain?: string;
|
|
1041
|
+
job_type?: "FULLTIME" | "PARTTIME" | "CONTRACTOR" | "INTERN";
|
|
1042
|
+
date_posted?: "today" | "3days" | "week" | "month";
|
|
1043
|
+
/** Work arrangement — SERP mode only. */
|
|
1044
|
+
ltype?: "remote" | "hybrid" | "onsite" | "work_from_home";
|
|
1045
|
+
/** Raw Google chip filter string — SERP mode only. */
|
|
1046
|
+
chips?: string;
|
|
1047
|
+
/** Opaque Google filter token — SERP mode only. */
|
|
1048
|
+
uds?: string;
|
|
1049
|
+
/** UULE-encoded location — SERP mode only. */
|
|
1050
|
+
uule?: string;
|
|
1051
|
+
/** Search radius in miles — SERP mode only. */
|
|
1052
|
+
lrad?: string;
|
|
1053
|
+
/** Pagination token from prior response. */
|
|
1054
|
+
next_page_token?: string;
|
|
1055
|
+
}
|
|
1056
|
+
interface ShoppingSearchParams {
|
|
1057
|
+
q: string;
|
|
1058
|
+
gl?: string;
|
|
1059
|
+
hl?: string;
|
|
1060
|
+
domain?: string;
|
|
1061
|
+
/** Zero-based page index (each page ≈ 60 tiles). */
|
|
1062
|
+
page?: number;
|
|
1063
|
+
min_price?: number;
|
|
1064
|
+
max_price?: number;
|
|
1065
|
+
sort_by?: "price_low" | "price_high" | "rating" | "reviews";
|
|
1066
|
+
/** Free-shipping filter. */
|
|
1067
|
+
free_shipping?: boolean;
|
|
1068
|
+
/** On-sale filter. */
|
|
1069
|
+
on_sale?: boolean;
|
|
1070
|
+
safe?: "off" | "active";
|
|
1071
|
+
/** `1` disables auto-correction. */
|
|
1072
|
+
nfpr?: number;
|
|
1073
|
+
/** Language restrict (e.g. `lang_en`). */
|
|
1074
|
+
lr?: string;
|
|
1075
|
+
/** Raw Google tbs filter. */
|
|
1076
|
+
tbs?: string;
|
|
1077
|
+
/** Google internal shoprs helper token. */
|
|
1078
|
+
shoprs?: string;
|
|
1079
|
+
}
|
|
1080
|
+
/**
|
|
1081
|
+
* Params for `/v1/google/shopping/product` — Google Shopping product
|
|
1082
|
+
* detail page lookup.
|
|
1083
|
+
*/
|
|
1084
|
+
interface ShoppingProductParams {
|
|
1085
|
+
product_id: string;
|
|
1086
|
+
gl?: string;
|
|
1087
|
+
hl?: string;
|
|
1088
|
+
domain?: string;
|
|
1089
|
+
}
|
|
1090
|
+
/**
|
|
1091
|
+
* Params for `/v1/google/shopping/product/click` — resolve the direct
|
|
1092
|
+
* merchant URL for a Shopping product tile. Uses Google's "I'm Feeling
|
|
1093
|
+
* Lucky" redirect scoped to the card's `source` merchant via the
|
|
1094
|
+
* `site:` operator.
|
|
1095
|
+
*/
|
|
1096
|
+
interface ShoppingClickParams {
|
|
1097
|
+
title: string;
|
|
1098
|
+
source: string;
|
|
1099
|
+
q: string;
|
|
1100
|
+
product_id?: string;
|
|
1101
|
+
}
|
|
1102
|
+
/**
|
|
1103
|
+
* Params for `/v1/google/patents/search`. Backed by Google Patents'
|
|
1104
|
+
* `/xhr/query` JSON RPC — ~1 s regardless of filter complexity.
|
|
1105
|
+
*/
|
|
1106
|
+
interface PatentsSearchParams {
|
|
1107
|
+
/** Query string — supports Boolean logic (e.g. "quantum AND compute"). */
|
|
1108
|
+
q: string;
|
|
1109
|
+
page?: number;
|
|
1110
|
+
num?: number;
|
|
1111
|
+
sort?: "new" | "old";
|
|
1112
|
+
/** Comma-separated inventor names. */
|
|
1113
|
+
inventor?: string;
|
|
1114
|
+
/** Comma-separated assignee / company names. */
|
|
1115
|
+
assignee?: string;
|
|
1116
|
+
/** Patent-office country code (US, EP, WO, …). */
|
|
1117
|
+
country?: string;
|
|
1118
|
+
language?: "ENGLISH" | "GERMAN" | "CHINESE" | "FRENCH" | "JAPANESE" | "KOREAN" | "SPANISH";
|
|
1119
|
+
status?: "GRANT" | "APPLICATION";
|
|
1120
|
+
patent_type?: "PATENT" | "DESIGN";
|
|
1121
|
+
/** Filing/priority-date upper bound (YYYYMMDD). */
|
|
1122
|
+
before?: string;
|
|
1123
|
+
/** Filing/priority-date lower bound (YYYYMMDD). */
|
|
1124
|
+
after?: string;
|
|
1125
|
+
}
|
|
1126
|
+
interface PatentsDetailParams {
|
|
1127
|
+
/** Publication number (e.g. "US10000000B2", "EP3097156B1"). */
|
|
1128
|
+
patent_id: string;
|
|
1129
|
+
}
|
|
1130
|
+
interface ScholarSearchParams {
|
|
1131
|
+
q: string;
|
|
1132
|
+
hl?: string;
|
|
1133
|
+
as_ylo?: number;
|
|
1134
|
+
as_yhi?: number;
|
|
1135
|
+
as_sdt?: string;
|
|
1136
|
+
page?: number;
|
|
1137
|
+
num?: number;
|
|
1138
|
+
}
|
|
1139
|
+
interface ScholarProfilesParams {
|
|
1140
|
+
/** Author name query (e.g. "Geoffrey Hinton"). */
|
|
1141
|
+
mauthors: string;
|
|
1142
|
+
hl?: string;
|
|
1143
|
+
/** Next-page pagination token from a previous response. */
|
|
1144
|
+
after_author?: string;
|
|
1145
|
+
/** Previous-page pagination token. */
|
|
1146
|
+
before_author?: string;
|
|
1147
|
+
}
|
|
1148
|
+
interface ScholarAuthorParams {
|
|
1149
|
+
/** Scholar user ID (the `user` query parameter on a profile URL). */
|
|
1150
|
+
author_id: string;
|
|
1151
|
+
hl?: string;
|
|
1152
|
+
/** Articles pagination offset. */
|
|
1153
|
+
cstart?: number;
|
|
1154
|
+
/** Articles per page. */
|
|
1155
|
+
pagesize?: number;
|
|
1156
|
+
}
|
|
1157
|
+
interface ScholarAuthorCitationParams {
|
|
1158
|
+
author_id: string;
|
|
1159
|
+
hl?: string;
|
|
1160
|
+
}
|
|
1161
|
+
interface ScholarCiteParams {
|
|
1162
|
+
/** Cluster ID from a Scholar search result. */
|
|
1163
|
+
q: string;
|
|
1164
|
+
hl?: string;
|
|
1165
|
+
}
|
|
1166
|
+
interface AutocompleteParams {
|
|
1167
|
+
q: string;
|
|
1168
|
+
hl?: string;
|
|
1169
|
+
gl?: string;
|
|
1170
|
+
}
|
|
1171
|
+
interface ImagesSearchParams {
|
|
1172
|
+
q: string;
|
|
1173
|
+
gl?: string;
|
|
1174
|
+
hl?: string;
|
|
1175
|
+
/** Zero-based page index (each page ≈ 100 tiles). */
|
|
1176
|
+
page?: number;
|
|
1177
|
+
/** Max tiles to return (1-500, client-side cap). */
|
|
1178
|
+
results?: number;
|
|
1179
|
+
safe?: "off" | "active";
|
|
1180
|
+
/** Raw Google tbs filter (e.g. `qdr:d`). */
|
|
1181
|
+
tbs?: string;
|
|
1182
|
+
/** Size: `l`, `m`, `i`, `xXl`, `xxl`, `xxxl`. */
|
|
1183
|
+
imgsz?: string;
|
|
1184
|
+
/** Colour: `color`, `gray`, `transparent`, `red`, `orange`, … */
|
|
1185
|
+
imgcolor?: string;
|
|
1186
|
+
/** Type: `face`, `photo`, `clipart`, `lineart`, `animated`. */
|
|
1187
|
+
imgtype?: string;
|
|
1188
|
+
}
|
|
1189
|
+
interface VideosSearchParams {
|
|
1190
|
+
q: string;
|
|
1191
|
+
gl?: string;
|
|
1192
|
+
hl?: string;
|
|
1193
|
+
/** Zero-based page index (each page ≈ 10 tiles). */
|
|
1194
|
+
page?: number;
|
|
1195
|
+
/** Google domain (`google.com`, `google.co.uk`, …). */
|
|
1196
|
+
domain?: string;
|
|
1197
|
+
/** City-level geo-targeting. */
|
|
1198
|
+
location?: string;
|
|
1199
|
+
/** Language restrict (e.g. `lang_en`). */
|
|
1200
|
+
lr?: string;
|
|
1201
|
+
/** UULE-encoded location. */
|
|
1202
|
+
uule?: string;
|
|
1203
|
+
/** `1` disables auto-correction. */
|
|
1204
|
+
nfpr?: number;
|
|
1205
|
+
safe?: "off" | "active";
|
|
1206
|
+
/** Time/duration chip: `qdr:d/w/m`, `dur:s/m/l`. */
|
|
1207
|
+
tbs?: string;
|
|
1208
|
+
}
|
|
1209
|
+
interface FinanceQuoteParams {
|
|
1210
|
+
/** Ticker, optionally with exchange — `AAPL`, `AAPL:NASDAQ`, `BTC-USD`, `EURUSD`. */
|
|
1211
|
+
q: string;
|
|
1212
|
+
hl?: string;
|
|
1213
|
+
gl?: string;
|
|
1214
|
+
}
|
|
1215
|
+
interface AiModeSearchParams {
|
|
1216
|
+
q: string;
|
|
1217
|
+
gl?: string;
|
|
1218
|
+
hl?: string;
|
|
1219
|
+
}
|
|
1220
|
+
/**
|
|
1221
|
+
* Params for `/v1/google/lens/search`. Response carries `lens_results`
|
|
1222
|
+
* (Scrapingdog parity — each item has `title`, `source`,
|
|
1223
|
+
* `source_favicon`, `thumbnail`, optional `tag` price chip and
|
|
1224
|
+
* `in_stock`) plus `related_searches` chips. Legacy `results` alias
|
|
1225
|
+
* retained for backwards compat.
|
|
1226
|
+
*/
|
|
1227
|
+
interface LensSearchParams {
|
|
1228
|
+
/** Public URL of the image to search visually. */
|
|
1229
|
+
url: string;
|
|
1230
|
+
/** Optional text refinement (e.g. `"pizza"`) to bias Lens. */
|
|
1231
|
+
query?: string;
|
|
1232
|
+
/** ISO country code — Scrapingdog-parity alias for `gl`. */
|
|
1233
|
+
country?: string;
|
|
1234
|
+
/** Language code — Scrapingdog-parity alias for `hl`. */
|
|
1235
|
+
language?: string;
|
|
1236
|
+
gl?: string;
|
|
1237
|
+
hl?: string;
|
|
1238
|
+
/** Bias towards shoppable product matches. */
|
|
1239
|
+
product?: boolean;
|
|
1240
|
+
/** Include the visual-matches carousel (default: true). */
|
|
1241
|
+
visual_matches?: boolean;
|
|
1242
|
+
/** Restrict to exact-match results only. */
|
|
1243
|
+
exact_matches?: boolean;
|
|
1244
|
+
}
|
|
1245
|
+
/**
|
|
1246
|
+
* Params for `/v1/google/products/detail`. Backed by Google's
|
|
1247
|
+
* `/async/oapv` RPC — full product payload (title, brand, price, rating,
|
|
1248
|
+
* specs) in ~2s via warm-session curl_cffi.
|
|
1249
|
+
*/
|
|
1250
|
+
interface ProductsDetailParams {
|
|
1251
|
+
/** Google Shopping `gpcid`. Search results expose this on each tile. */
|
|
1252
|
+
product_id: string;
|
|
1253
|
+
/** Original search query — required, used to build the oapv context blob. */
|
|
1254
|
+
q: string;
|
|
1255
|
+
gl?: string;
|
|
1256
|
+
hl?: string;
|
|
1257
|
+
/** Extra IDs Google surfaces on Shopping tiles. Improves routing accuracy. */
|
|
1258
|
+
catalog_id?: string;
|
|
1259
|
+
image_docid?: string;
|
|
1260
|
+
headline_offer_docid?: string;
|
|
1261
|
+
mid?: string;
|
|
1262
|
+
/** When true, also fetches `/async/piu_ps` for the merchant offers list. */
|
|
1263
|
+
include_offers?: boolean;
|
|
1264
|
+
/** When true, also fetches `/async/toy_v` for size/colour variants. */
|
|
1265
|
+
include_variants?: boolean;
|
|
1266
|
+
}
|
|
1267
|
+
interface ShortsSearchParams {
|
|
1268
|
+
q: string;
|
|
1269
|
+
gl?: string;
|
|
1270
|
+
hl?: string;
|
|
1271
|
+
domain?: string;
|
|
1272
|
+
/** Max tiles to return (1-60 cap). */
|
|
1273
|
+
num?: number;
|
|
1274
|
+
/** Pagination offset. */
|
|
1275
|
+
start?: number;
|
|
1276
|
+
safe?: "off" | "active";
|
|
1277
|
+
/** `1` disables auto-correction. */
|
|
1278
|
+
nfpr?: number;
|
|
1279
|
+
/** Raw Google tbs filter (e.g. `qdr:d`). */
|
|
1280
|
+
tbs?: string;
|
|
1281
|
+
}
|
|
1282
|
+
type FlightsTripType = "round_trip" | "one_way" | "multi_city";
|
|
1283
|
+
type FlightsTravelClass = "economy" | "premium_economy" | "business" | "first";
|
|
1284
|
+
type FlightsStopsFilter = "any" | "nonstop" | "one_stop" | "two_stops";
|
|
1285
|
+
interface FlightsSearchParams {
|
|
1286
|
+
/** Departure airport IATA code (e.g. "JFK") or location ID. */
|
|
1287
|
+
departure_id: string;
|
|
1288
|
+
/** Arrival airport IATA code (e.g. "LHR") or location ID. */
|
|
1289
|
+
arrival_id: string;
|
|
1290
|
+
/** Outbound date in YYYY-MM-DD format. */
|
|
1291
|
+
outbound_date: string;
|
|
1292
|
+
/** Return date (required for round_trip). */
|
|
1293
|
+
return_date?: string;
|
|
1294
|
+
trip_type?: FlightsTripType;
|
|
1295
|
+
/** Adult passengers (1-9). */
|
|
1296
|
+
adults?: number;
|
|
1297
|
+
/** Children passengers (0-8). */
|
|
1298
|
+
children?: number;
|
|
1299
|
+
/** Infants in seat (0-4). */
|
|
1300
|
+
infants_in_seat?: number;
|
|
1301
|
+
/** Infants on lap (0-4). */
|
|
1302
|
+
infants_on_lap?: number;
|
|
1303
|
+
travel_class?: FlightsTravelClass;
|
|
1304
|
+
/** ISO-4217 currency code (default "USD"). */
|
|
1305
|
+
currency?: string;
|
|
1306
|
+
gl?: string;
|
|
1307
|
+
hl?: string;
|
|
1308
|
+
stops?: FlightsStopsFilter;
|
|
1309
|
+
/** Upper price filter. */
|
|
1310
|
+
max_price?: number;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
/**
|
|
1314
|
+
* Google AI Mode API client (udm=50 generative answers).
|
|
1315
|
+
*/
|
|
1316
|
+
|
|
1317
|
+
/**
|
|
1318
|
+
* Client for Google AI Mode.
|
|
1319
|
+
*/
|
|
1320
|
+
declare class AiModeClient {
|
|
1321
|
+
private readonly client;
|
|
1322
|
+
constructor(client: BaseClient);
|
|
1323
|
+
search(params: AiModeSearchParams): Promise<GoogleResponse>;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
/**
|
|
1327
|
+
* Google Autocomplete API client.
|
|
1328
|
+
*
|
|
1329
|
+
* Returns up to 10 search suggestions. Suggestions that resolve to
|
|
1330
|
+
* Knowledge-Graph entities (companies, people, movies, stocks, local
|
|
1331
|
+
* businesses, …) additionally carry `entity_name` and `thumbnail` —
|
|
1332
|
+
* the same enrichment Google's own search-box surfaces.
|
|
1333
|
+
*/
|
|
1334
|
+
|
|
1335
|
+
/**
|
|
1336
|
+
* Client for Google Autocomplete (search suggestions).
|
|
1337
|
+
*/
|
|
1338
|
+
declare class AutocompleteClient {
|
|
1339
|
+
private readonly client;
|
|
1340
|
+
constructor(client: BaseClient);
|
|
1341
|
+
/**
|
|
1342
|
+
* Get Google autocomplete suggestions for a query.
|
|
1343
|
+
*
|
|
1344
|
+
* @example
|
|
1345
|
+
* ```typescript
|
|
1346
|
+
* const res = await client.google.autocomplete.get({ q: "apple" });
|
|
1347
|
+
* for (const s of res.suggestions) {
|
|
1348
|
+
* console.log(s.value, s.entity_name, s.thumbnail);
|
|
1349
|
+
* }
|
|
1350
|
+
* ```
|
|
1351
|
+
*/
|
|
1352
|
+
get(params: AutocompleteParams): Promise<GoogleResponse>;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
/**
|
|
1356
|
+
* Google Finance API client.
|
|
1357
|
+
*
|
|
1358
|
+
* Powered by the same `mKsvE` batchexecute RPC the Google Finance SPA
|
|
1359
|
+
* uses internally. Returns price / change / change% / previous_close /
|
|
1360
|
+
* after-hours / market hours / timezone / currency / country /
|
|
1361
|
+
* alternate exchange listings in ~1 s.
|
|
1362
|
+
*/
|
|
1363
|
+
|
|
1364
|
+
/**
|
|
1365
|
+
* Client for Google Finance quotes.
|
|
1366
|
+
*
|
|
1367
|
+
* @example
|
|
1368
|
+
* ```typescript
|
|
1369
|
+
* const quote = await client.google.finance.quote({ q: "AAPL:NASDAQ" });
|
|
1370
|
+
* console.log(quote.price, quote.currency, quote.after_hours);
|
|
1371
|
+
* ```
|
|
1372
|
+
*/
|
|
1373
|
+
declare class FinanceClient {
|
|
1374
|
+
private readonly client;
|
|
1375
|
+
constructor(client: BaseClient);
|
|
1376
|
+
quote(params: FinanceQuoteParams): Promise<GoogleResponse>;
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* Google Flights API client — one-way, round-trip, multi-city.
|
|
1381
|
+
*/
|
|
1382
|
+
|
|
1383
|
+
/**
|
|
1384
|
+
* Client for Google Flights search.
|
|
1385
|
+
*
|
|
1386
|
+
* Supports one-way, round-trip, and multi-city itineraries with
|
|
1387
|
+
* passenger configuration, cabin class, stops filter, and max-price.
|
|
1388
|
+
* Returns Google's Best flights recommendations plus the full Other
|
|
1389
|
+
* flights result set, with per-offer pricing, duration, stops,
|
|
1390
|
+
* layovers, carbon emissions, and price insights (low / typical /
|
|
1391
|
+
* high + typical price range) when Google shows them.
|
|
1392
|
+
*
|
|
1393
|
+
* @example
|
|
1394
|
+
* ```typescript
|
|
1395
|
+
* const flights = await client.google.flights.search({
|
|
1396
|
+
* departure_id: "JFK",
|
|
1397
|
+
* arrival_id: "LHR",
|
|
1398
|
+
* outbound_date: "2026-06-15",
|
|
1399
|
+
* return_date: "2026-06-22",
|
|
1400
|
+
* adults: 2,
|
|
1401
|
+
* });
|
|
1402
|
+
* for (const offer of flights.best_flights) {
|
|
1403
|
+
* console.log(offer.price, offer.currency, offer.total_duration_minutes);
|
|
1404
|
+
* }
|
|
1405
|
+
* if (flights.price_insights) {
|
|
1406
|
+
* console.log("Price level:", flights.price_insights.price_level);
|
|
1407
|
+
* }
|
|
1408
|
+
* ```
|
|
1409
|
+
*/
|
|
1410
|
+
declare class FlightsClient {
|
|
1411
|
+
private readonly client;
|
|
1412
|
+
constructor(client: BaseClient);
|
|
1413
|
+
/** Search Google Flights for available itineraries. */
|
|
1414
|
+
search(params: FlightsSearchParams): Promise<GoogleResponse>;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
/**
|
|
1418
|
+
* Google Hotels API client — search, property details.
|
|
1419
|
+
*/
|
|
1420
|
+
|
|
1421
|
+
/**
|
|
1422
|
+
* Client for Google Hotels endpoints.
|
|
1423
|
+
*
|
|
1424
|
+
* @example
|
|
1425
|
+
* ```typescript
|
|
1426
|
+
* const hotels = await client.google.hotels.search({
|
|
1427
|
+
* q: "Paris",
|
|
1428
|
+
* check_in: "2026-05-01",
|
|
1429
|
+
* check_out: "2026-05-05",
|
|
1430
|
+
* adults: 2,
|
|
1431
|
+
* });
|
|
1432
|
+
* ```
|
|
1433
|
+
*/
|
|
1434
|
+
declare class HotelsClient {
|
|
1435
|
+
private readonly client;
|
|
1436
|
+
constructor(client: BaseClient);
|
|
1437
|
+
search(params: HotelsSearchParams): Promise<GoogleResponse>;
|
|
1438
|
+
details(params: HotelsDetailsParams): Promise<GoogleResponse>;
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
/**
|
|
1442
|
+
* Google Images API client.
|
|
1443
|
+
*
|
|
1444
|
+
* Returns up to 100 tiles per page with `title`, `source`, `link`
|
|
1445
|
+
* (referrer page), `thumbnail`, `image` (inline preview), `original`
|
|
1446
|
+
* (full-res URL), `original_width` / `original_height`,
|
|
1447
|
+
* `original_size` (e.g. `"635KB"`), plus licensability flags.
|
|
1448
|
+
*/
|
|
1449
|
+
|
|
1450
|
+
/**
|
|
1451
|
+
* Client for Google Images search.
|
|
1452
|
+
*
|
|
1453
|
+
* @example
|
|
1454
|
+
* ```typescript
|
|
1455
|
+
* const res = await client.google.images.search({
|
|
1456
|
+
* q: "golden retriever",
|
|
1457
|
+
* imgsz: "l",
|
|
1458
|
+
* imgcolor: "color",
|
|
1459
|
+
* });
|
|
1460
|
+
* for (const img of res.results) {
|
|
1461
|
+
* console.log(img.rank, img.title, img.original);
|
|
1462
|
+
* }
|
|
1463
|
+
* ```
|
|
1464
|
+
*/
|
|
1465
|
+
declare class ImagesClient {
|
|
1466
|
+
private readonly client;
|
|
1467
|
+
constructor(client: BaseClient);
|
|
1468
|
+
search(params: ImagesSearchParams): Promise<GoogleResponse>;
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* Google Jobs API client.
|
|
1473
|
+
*/
|
|
1474
|
+
|
|
1475
|
+
/**
|
|
1476
|
+
* Client for Google Jobs search.
|
|
1477
|
+
*
|
|
1478
|
+
* @example
|
|
1479
|
+
* ```typescript
|
|
1480
|
+
* const jobs = await client.google.jobs.search({
|
|
1481
|
+
* q: "software engineer",
|
|
1482
|
+
* location: "San Francisco, CA",
|
|
1483
|
+
* job_type: "FULLTIME",
|
|
1484
|
+
* });
|
|
1485
|
+
* ```
|
|
1486
|
+
*/
|
|
1487
|
+
declare class JobsClient {
|
|
1488
|
+
private readonly client;
|
|
1489
|
+
constructor(client: BaseClient);
|
|
1490
|
+
search(params: JobsSearchParams): Promise<GoogleResponse>;
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
/**
|
|
1494
|
+
* Google Lens API client (visual image search).
|
|
1495
|
+
*/
|
|
1496
|
+
|
|
1497
|
+
/**
|
|
1498
|
+
* Client for Google Lens visual search by image URL.
|
|
1499
|
+
*
|
|
1500
|
+
* Response carries `lens_results` (Scrapingdog-parity alias) with
|
|
1501
|
+
* `title`, `source`, `source_favicon`, `thumbnail`, optional `tag`
|
|
1502
|
+
* price chip and `in_stock`, plus `related_searches` chips. Legacy
|
|
1503
|
+
* `results` alias retained for backwards compat.
|
|
1504
|
+
*
|
|
1505
|
+
* @example
|
|
1506
|
+
* ```typescript
|
|
1507
|
+
* const out = await client.google.lens.search({
|
|
1508
|
+
* url: "https://example.com/photo.jpg",
|
|
1509
|
+
* product: true, // bias towards shoppable matches
|
|
1510
|
+
* });
|
|
1511
|
+
* for (const match of out.lens_results) {
|
|
1512
|
+
* console.log(match.title, match.tag);
|
|
1513
|
+
* }
|
|
1514
|
+
* ```
|
|
1515
|
+
*/
|
|
1516
|
+
declare class LensClient {
|
|
1517
|
+
private readonly client;
|
|
1518
|
+
constructor(client: BaseClient);
|
|
1519
|
+
search(params: LensSearchParams): Promise<GoogleResponse>;
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
/**
|
|
1523
|
+
* Google Maps API client — search, place details, reviews, photos, posts.
|
|
1524
|
+
*/
|
|
1525
|
+
|
|
1526
|
+
/**
|
|
1527
|
+
* Client for Google Maps endpoints.
|
|
1528
|
+
*
|
|
1529
|
+
* @example
|
|
1530
|
+
* ```typescript
|
|
1531
|
+
* const places = await client.google.maps.search({ q: "coffee shops sf" });
|
|
1532
|
+
* const detail = await client.google.maps.place({ data_id: "0x...:0x..." });
|
|
1533
|
+
* const reviews = await client.google.maps.reviews({
|
|
1534
|
+
* data_id: "0x...:0x...",
|
|
1535
|
+
* sort_by: "newestFirst",
|
|
1536
|
+
* });
|
|
1537
|
+
* ```
|
|
1538
|
+
*/
|
|
1539
|
+
declare class MapsClient {
|
|
1540
|
+
private readonly client;
|
|
1541
|
+
constructor(client: BaseClient);
|
|
1542
|
+
/**
|
|
1543
|
+
* Search Maps for places by text query, place_id, or ludocid.
|
|
1544
|
+
*
|
|
1545
|
+
* Returns up to 20 results per page with full details (place_id,
|
|
1546
|
+
* data_id, GPS, rating, reviews, address, phone, website, extensions,
|
|
1547
|
+
* weekly hours, thumbnail) in a single call.
|
|
1548
|
+
*/
|
|
1549
|
+
search(params: MapsSearchParams): Promise<GoogleResponse>;
|
|
1550
|
+
/**
|
|
1551
|
+
* Get full place detail by `place_id` or `data_id`.
|
|
1552
|
+
*
|
|
1553
|
+
* Returns title, address, phone, website, GPS, rating, reviews_count,
|
|
1554
|
+
* rating_summary (per-star distribution), categories, extensions
|
|
1555
|
+
* (service_options, accessibility, offerings, payments), weekly
|
|
1556
|
+
* operating hours, popular_times graph, provider_id,
|
|
1557
|
+
* permanently_closed, thumbnail, and photo list.
|
|
1558
|
+
*/
|
|
1559
|
+
place(params: MapsPlaceParams): Promise<GoogleResponse>;
|
|
1560
|
+
/**
|
|
1561
|
+
* Get reviews for a place (paginated, optional topic filter).
|
|
1562
|
+
*
|
|
1563
|
+
* Pass the `next_page_token` from `response.pagination.next` for
|
|
1564
|
+
* subsequent pages, or use `topic_id` from `response.topics[].id`
|
|
1565
|
+
* to scope to a specific review topic.
|
|
1566
|
+
*/
|
|
1567
|
+
reviews(params: MapsReviewsParams): Promise<GoogleResponse>;
|
|
1568
|
+
/**
|
|
1569
|
+
* Get photos for a place with place-specific categories.
|
|
1570
|
+
*
|
|
1571
|
+
* Returns place-specific categories (Menu, Vibe, Comfort food, dish
|
|
1572
|
+
* names) and photo URLs from all CDN families. Use `category_id` to
|
|
1573
|
+
* scope to a category, or `page_size: 200` to fetch all photos in
|
|
1574
|
+
* one call (Google caps at ~120 photos per response).
|
|
1575
|
+
*/
|
|
1576
|
+
photos(params: MapsPhotosParams): Promise<GoogleResponse>;
|
|
1577
|
+
/** Get business posts (promotional updates, announcements) for a place. */
|
|
1578
|
+
posts(params: MapsPostsParams): Promise<GoogleResponse>;
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
/**
|
|
1582
|
+
* Google News API client — search, topics, trending.
|
|
1583
|
+
*/
|
|
1584
|
+
|
|
1585
|
+
/**
|
|
1586
|
+
* Client for Google News endpoints.
|
|
1587
|
+
*
|
|
1588
|
+
* @example
|
|
1589
|
+
* ```typescript
|
|
1590
|
+
* const articles = await client.google.news.search({ q: "openai" });
|
|
1591
|
+
* const tech = await client.google.news.topics({ topic: "TECHNOLOGY" });
|
|
1592
|
+
* const trending = await client.google.news.trending();
|
|
1593
|
+
* ```
|
|
1594
|
+
*/
|
|
1595
|
+
declare class NewsClient {
|
|
1596
|
+
private readonly client;
|
|
1597
|
+
constructor(client: BaseClient);
|
|
1598
|
+
/**
|
|
1599
|
+
* Search Google News. One of `q`, `topic_token`, `publication_token`,
|
|
1600
|
+
* or `story_token` is required (or pass no params for the trending
|
|
1601
|
+
* home feed). Returns `menu_links`, `news_results`, `related_topics`.
|
|
1602
|
+
*/
|
|
1603
|
+
search(params?: NewsSearchParams): Promise<GoogleResponse>;
|
|
1604
|
+
topics(params: NewsTopicsParams): Promise<GoogleResponse>;
|
|
1605
|
+
trending(params?: NewsTrendingParams): Promise<GoogleResponse>;
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
/**
|
|
1609
|
+
* Google Patents API client — search, detail.
|
|
1610
|
+
*/
|
|
1611
|
+
|
|
1612
|
+
/**
|
|
1613
|
+
* Client for Google Patents endpoints.
|
|
1614
|
+
*
|
|
1615
|
+
* @example
|
|
1616
|
+
* ```typescript
|
|
1617
|
+
* const results = await client.google.patents.search({
|
|
1618
|
+
* q: "distributed lock",
|
|
1619
|
+
* assignee: "Google",
|
|
1620
|
+
* });
|
|
1621
|
+
* ```
|
|
1622
|
+
*/
|
|
1623
|
+
declare class PatentsClient {
|
|
1624
|
+
private readonly client;
|
|
1625
|
+
constructor(client: BaseClient);
|
|
1626
|
+
search(params: PatentsSearchParams): Promise<GoogleResponse>;
|
|
1627
|
+
/**
|
|
1628
|
+
* Get rich patent document details by patent number.
|
|
1629
|
+
*
|
|
1630
|
+
* Response includes full abstract + every claim + complete description,
|
|
1631
|
+
* plus structured `cpc_classifications` (code + description), split
|
|
1632
|
+
* `backward_citations` / `forward_citations` (with `primary_examiner`
|
|
1633
|
+
* flag), `non_patent_citations`, `concepts` (research fields),
|
|
1634
|
+
* `legal_events` (prosecution history), `figures` (full-res URLs),
|
|
1635
|
+
* every `inventor`, and the full `assignees_original` history.
|
|
1636
|
+
*/
|
|
1637
|
+
detail(params: PatentsDetailParams): Promise<GoogleResponse>;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
/**
|
|
1641
|
+
* Google Products API client (immersive product detail).
|
|
1642
|
+
*/
|
|
1643
|
+
|
|
1644
|
+
/**
|
|
1645
|
+
* Client for Google's immersive product detail endpoint.
|
|
1646
|
+
*/
|
|
1647
|
+
declare class ProductsClient {
|
|
1648
|
+
private readonly client;
|
|
1649
|
+
constructor(client: BaseClient);
|
|
1650
|
+
detail(params: ProductsDetailParams): Promise<GoogleResponse>;
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
/**
|
|
1654
|
+
* Google Scholar API client.
|
|
1655
|
+
*/
|
|
1656
|
+
|
|
1657
|
+
/**
|
|
1658
|
+
* Client for Google Scholar — search, author profiles, citation charts,
|
|
1659
|
+
* and citation formats.
|
|
1660
|
+
*
|
|
1661
|
+
* Search results carry doc `id`, `type` badge, wrapped `inline_links`
|
|
1662
|
+
* (versions + cited_by + related), PDF `resources`, and author objects
|
|
1663
|
+
* with `author_id` for pipe-through into {@link ScholarClient.author}.
|
|
1664
|
+
* The author endpoint returns structured `interests_detailed`,
|
|
1665
|
+
* publications with per-article `citation_id` + nested `cited_by`, and
|
|
1666
|
+
* lifetime + since-year citation stats.
|
|
1667
|
+
*
|
|
1668
|
+
* @example
|
|
1669
|
+
* ```typescript
|
|
1670
|
+
* const papers = await client.google.scholar.search({
|
|
1671
|
+
* q: "transformer neural networks",
|
|
1672
|
+
* as_ylo: 2020,
|
|
1673
|
+
* });
|
|
1674
|
+
* const first = papers.scholar_results[0];
|
|
1675
|
+
* // Pipe a profiled author into the author endpoint:
|
|
1676
|
+
* if (first.authors[0].author_id) {
|
|
1677
|
+
* const profile = await client.google.scholar.author({
|
|
1678
|
+
* author_id: first.authors[0].author_id,
|
|
1679
|
+
* });
|
|
1680
|
+
* }
|
|
1681
|
+
* ```
|
|
1682
|
+
*/
|
|
1683
|
+
declare class ScholarClient {
|
|
1684
|
+
private readonly client;
|
|
1685
|
+
constructor(client: BaseClient);
|
|
1686
|
+
/**
|
|
1687
|
+
* Search Google Scholar. Returns each result with doc `id`, `type`
|
|
1688
|
+
* badge, wrapped `inline_links`, PDF `resources`, and structured
|
|
1689
|
+
* authors. Envelope includes `scholar_results` alias,
|
|
1690
|
+
* `related_searches`, and matched `profiles` cards.
|
|
1691
|
+
*/
|
|
1692
|
+
search(params: ScholarSearchParams): Promise<GoogleResponse>;
|
|
1693
|
+
/** Search Google Scholar for author profiles by name. */
|
|
1694
|
+
profiles(params: ScholarProfilesParams): Promise<GoogleResponse>;
|
|
1695
|
+
/**
|
|
1696
|
+
* Full Scholar author profile: structured `interests_detailed`,
|
|
1697
|
+
* publications (with per-article `citation_id` + nested
|
|
1698
|
+
* `cited_by{value, link, citation_id}`), stats, and co-authors.
|
|
1699
|
+
*/
|
|
1700
|
+
author(params: ScholarAuthorParams): Promise<GoogleResponse>;
|
|
1701
|
+
/** Citations-per-year chart for a Scholar author. */
|
|
1702
|
+
authorCitation(params: ScholarAuthorCitationParams): Promise<GoogleResponse>;
|
|
1703
|
+
/**
|
|
1704
|
+
* MLA / APA / Chicago / Harvard / Vancouver citation formats plus
|
|
1705
|
+
* BibTeX / RIS / EndNote / RefWorks export links for a paper.
|
|
1706
|
+
*/
|
|
1707
|
+
cite(params: ScholarCiteParams): Promise<GoogleResponse>;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
/**
|
|
1711
|
+
* Google Web Search (SERP) API client.
|
|
1712
|
+
*/
|
|
1713
|
+
|
|
1714
|
+
/**
|
|
1715
|
+
* Client for Google Web Search.
|
|
1716
|
+
*
|
|
1717
|
+
* @example
|
|
1718
|
+
* ```typescript
|
|
1719
|
+
* const serp = await client.google.search.search({ q: "python 3.13" });
|
|
1720
|
+
* for (const r of serp.organic_results as any[]) {
|
|
1721
|
+
* console.log(r.title, r.link);
|
|
1722
|
+
* }
|
|
1723
|
+
* ```
|
|
1724
|
+
*/
|
|
1725
|
+
declare class SearchClient {
|
|
1726
|
+
private readonly client;
|
|
1727
|
+
constructor(client: BaseClient);
|
|
1728
|
+
/**
|
|
1729
|
+
* Search Google and get a structured SERP response with organic results,
|
|
1730
|
+
* knowledge graph, People Also Ask, related searches, AI overview, and
|
|
1731
|
+
* pagination.
|
|
1732
|
+
*/
|
|
1733
|
+
search(params: GoogleSearchParams): Promise<GoogleResponse>;
|
|
1734
|
+
/**
|
|
1735
|
+
* Lightweight Google Search — organic results + related searches only.
|
|
1736
|
+
*
|
|
1737
|
+
* ~40% faster than {@link search}. Skips ads, Knowledge Graph, AI
|
|
1738
|
+
* Overview, local pack, news, inline videos, and shopping blocks.
|
|
1739
|
+
* Credit cost is configured per-endpoint by admins — query
|
|
1740
|
+
* `/public/pricing` for the live rate.
|
|
1741
|
+
*
|
|
1742
|
+
* @example
|
|
1743
|
+
* ```typescript
|
|
1744
|
+
* const lite = await client.google.search.light({ q: "python 3.13" });
|
|
1745
|
+
* ```
|
|
1746
|
+
*/
|
|
1747
|
+
light(params: GoogleSearchParams): Promise<GoogleResponse>;
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
/**
|
|
1751
|
+
* Google Shopping API client — search and product detail.
|
|
1752
|
+
*/
|
|
1753
|
+
|
|
1754
|
+
/**
|
|
1755
|
+
* Client for Google Shopping endpoints.
|
|
1756
|
+
*
|
|
1757
|
+
* Each search tile now carries Google's native `gpcid`, `catalog_id`,
|
|
1758
|
+
* `headline_offer_docid`, `image_docid`, and `mid`, so callers can pipe a
|
|
1759
|
+
* tile directly into `client.google.products.detail()` for full specs
|
|
1760
|
+
* plus merchant offers via the fast `/async/oapv` RPC (~2s).
|
|
1761
|
+
*
|
|
1762
|
+
* @example
|
|
1763
|
+
* ```typescript
|
|
1764
|
+
* const products = await client.google.shopping.search({ q: "laptop" });
|
|
1765
|
+
* const first = (products.results as any[])[0];
|
|
1766
|
+
* const detail = await client.google.products.detail({
|
|
1767
|
+
* product_id: first.gpcid,
|
|
1768
|
+
* q: "laptop",
|
|
1769
|
+
* include_offers: true, // real merchant URLs from /async/piu_ps
|
|
1770
|
+
* });
|
|
1771
|
+
* ```
|
|
1772
|
+
*/
|
|
1773
|
+
declare class ShoppingClient {
|
|
1774
|
+
private readonly client;
|
|
1775
|
+
constructor(client: BaseClient);
|
|
1776
|
+
/** Search Google Shopping for products. */
|
|
1777
|
+
search(params: ShoppingSearchParams): Promise<GoogleResponse>;
|
|
1778
|
+
/** Fetch the Google Shopping product detail page by `product_id`. */
|
|
1779
|
+
product(params: ShoppingProductParams): Promise<GoogleResponse>;
|
|
1780
|
+
/**
|
|
1781
|
+
* Resolve the direct merchant URL for a Shopping product tile via
|
|
1782
|
+
* Google's "I'm Feeling Lucky" redirect (scoped to the card's `source`
|
|
1783
|
+
* merchant via the `site:` operator). You only pay for the call when
|
|
1784
|
+
* you actually want the merchant link — no bulk enrichment of every
|
|
1785
|
+
* tile.
|
|
1786
|
+
*/
|
|
1787
|
+
click(params: ShoppingClickParams): Promise<GoogleResponse>;
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
/**
|
|
1791
|
+
* Google Shorts API client — short-form vertical video results.
|
|
1792
|
+
*/
|
|
1793
|
+
|
|
1794
|
+
/**
|
|
1795
|
+
* Client for Google Shorts search (`udm=39`).
|
|
1796
|
+
*
|
|
1797
|
+
* Returns a carousel of short-form videos — YouTube Shorts plus
|
|
1798
|
+
* TikToks, Instagram Reels, Facebook Reels, and other platforms.
|
|
1799
|
+
* Every tile carries `title`, `link`, `source` (platform),
|
|
1800
|
+
* `account_name`, `thumbnail`, `image` (inline preview),
|
|
1801
|
+
* `duration`, and `video_id` (YouTube only).
|
|
1802
|
+
*
|
|
1803
|
+
* @example
|
|
1804
|
+
* ```typescript
|
|
1805
|
+
* const shorts = await client.google.shorts.search({ q: "cooking hacks" });
|
|
1806
|
+
* for (const v of shorts.short_videos_results) {
|
|
1807
|
+
* console.log(v.rank, v.title, v.source, v.account_name);
|
|
1808
|
+
* }
|
|
1809
|
+
* ```
|
|
1810
|
+
*/
|
|
1811
|
+
declare class ShortsClient {
|
|
1812
|
+
private readonly client;
|
|
1813
|
+
constructor(client: BaseClient);
|
|
1814
|
+
search(params: ShortsSearchParams): Promise<GoogleResponse>;
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
/**
|
|
1818
|
+
* Google Trends API client — interest, regions, related, trending.
|
|
1819
|
+
*/
|
|
1820
|
+
|
|
1821
|
+
/**
|
|
1822
|
+
* Client for Google Trends endpoints.
|
|
1823
|
+
*
|
|
1824
|
+
* @example
|
|
1825
|
+
* ```typescript
|
|
1826
|
+
* const interest = await client.google.trends.interest({
|
|
1827
|
+
* q: "python,javascript",
|
|
1828
|
+
* date: "today 12-m",
|
|
1829
|
+
* });
|
|
1830
|
+
* ```
|
|
1831
|
+
*/
|
|
1832
|
+
declare class TrendsClient {
|
|
1833
|
+
private readonly client;
|
|
1834
|
+
constructor(client: BaseClient);
|
|
1835
|
+
interest(params: TrendsInterestParams): Promise<GoogleResponse>;
|
|
1836
|
+
regions(params: TrendsRegionsParams): Promise<GoogleResponse>;
|
|
1837
|
+
related(params: TrendsRelatedParams): Promise<GoogleResponse>;
|
|
1838
|
+
trending(params?: TrendsTrendingParams): Promise<GoogleResponse>;
|
|
1839
|
+
/**
|
|
1840
|
+
* Current trending searches with the full Google Trends UI filter set
|
|
1841
|
+
* — `geo`, `hours`, `category`, `status`, `sort`, `hl`.
|
|
1842
|
+
*/
|
|
1843
|
+
trendingNow(params?: TrendsTrendingNowParams): Promise<GoogleResponse>;
|
|
1844
|
+
/**
|
|
1845
|
+
* Unified Google Trends query — pick the response shape via
|
|
1846
|
+
* `data_type` (TIMESERIES | GEO_MAP | GEO_MAP_0 | RELATED_TOPICS |
|
|
1847
|
+
* RELATED_QUERIES).
|
|
1848
|
+
*/
|
|
1849
|
+
search(params: TrendsSearchParams): Promise<GoogleResponse>;
|
|
1850
|
+
/**
|
|
1851
|
+
* Return categorized Knowledge Graph topic entities (`mid`, `type`,
|
|
1852
|
+
* direct link into Trends explore) for a query prefix. Distinct from
|
|
1853
|
+
* Google Search autocomplete.
|
|
1854
|
+
*/
|
|
1855
|
+
autocomplete(params: TrendsAutocompleteParams): Promise<GoogleResponse>;
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
/**
|
|
1859
|
+
* Google Videos API client.
|
|
1860
|
+
*
|
|
1861
|
+
* Returns up to 10 tiles per page with `title`, `link`
|
|
1862
|
+
* (YouTube / Vimeo / etc.), `displayed_link`, `snippet`, `thumbnail`,
|
|
1863
|
+
* `image` (inline base-64), `favicon`, `duration`, `channel`,
|
|
1864
|
+
* `source` (platform), `date`, `video_id`, and raw `extensions`.
|
|
1865
|
+
*/
|
|
1866
|
+
|
|
1867
|
+
/**
|
|
1868
|
+
* Client for Google Videos search.
|
|
1869
|
+
*
|
|
1870
|
+
* @example
|
|
1871
|
+
* ```typescript
|
|
1872
|
+
* const res = await client.google.videos.search({ q: "python tutorial" });
|
|
1873
|
+
* for (const v of res.results) {
|
|
1874
|
+
* console.log(v.rank, v.title, v.duration, v.channel);
|
|
1875
|
+
* }
|
|
1876
|
+
* ```
|
|
1877
|
+
*/
|
|
1878
|
+
declare class VideosClient {
|
|
1879
|
+
private readonly client;
|
|
1880
|
+
constructor(client: BaseClient);
|
|
1881
|
+
search(params: VideosSearchParams): Promise<GoogleResponse>;
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
/**
|
|
1885
|
+
* Google Scraper API aggregator — exposes all 16 Google product sub-clients.
|
|
1886
|
+
*/
|
|
1887
|
+
|
|
1888
|
+
/**
|
|
1889
|
+
* Google Scraper API client with access to all 19 Google product APIs.
|
|
1890
|
+
*
|
|
1891
|
+
* @example
|
|
1892
|
+
* ```typescript
|
|
1893
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
1894
|
+
*
|
|
1895
|
+
* const serp = await client.google.search.search({ q: "python 3.13" });
|
|
1896
|
+
* const places = await client.google.maps.search({ q: "coffee shops sf" });
|
|
1897
|
+
* const products = await client.google.shopping.search({ q: "laptop" });
|
|
1898
|
+
*
|
|
1899
|
+
* // Per-product merchant URL enrichment
|
|
1900
|
+
* const enriched = await client.google.shopping.click({
|
|
1901
|
+
* title: (products.results as any[])[0].title,
|
|
1902
|
+
* source: (products.results as any[])[0].source,
|
|
1903
|
+
* });
|
|
1904
|
+
* console.log(enriched.merchant_url);
|
|
1905
|
+
*
|
|
1906
|
+
* // New in v0.3: Shorts, Flights, and Scholar depth
|
|
1907
|
+
* const shorts = await client.google.shorts.search({ q: "cooking hacks" });
|
|
1908
|
+
* const flights = await client.google.flights.search({
|
|
1909
|
+
* departure_id: "JFK",
|
|
1910
|
+
* arrival_id: "LHR",
|
|
1911
|
+
* outbound_date: "2026-06-15",
|
|
1912
|
+
* return_date: "2026-06-22",
|
|
1913
|
+
* });
|
|
1914
|
+
* const profiles = await client.google.scholar.profiles({
|
|
1915
|
+
* mauthors: "Geoffrey Hinton",
|
|
1916
|
+
* });
|
|
1917
|
+
* ```
|
|
1918
|
+
*/
|
|
1919
|
+
declare class GoogleClient {
|
|
1920
|
+
/** Google Web Search (SERP) — with optional deferred AI Overview follow-up. */
|
|
1921
|
+
readonly search: SearchClient;
|
|
1922
|
+
/** Google Maps — places, reviews, photos, posts. */
|
|
1923
|
+
readonly maps: MapsClient;
|
|
1924
|
+
/** Google News — articles, topics, trending. */
|
|
1925
|
+
readonly news: NewsClient;
|
|
1926
|
+
/** Google Hotels — search and property details. */
|
|
1927
|
+
readonly hotels: HotelsClient;
|
|
1928
|
+
/** Google Trends — interest, regions, related, trending, topic autocomplete. */
|
|
1929
|
+
readonly trends: TrendsClient;
|
|
1930
|
+
/** Google Jobs. */
|
|
1931
|
+
readonly jobs: JobsClient;
|
|
1932
|
+
/** Google Shopping — search, details, click enrichment. */
|
|
1933
|
+
readonly shopping: ShoppingClient;
|
|
1934
|
+
/** Google Patents — search and document details. */
|
|
1935
|
+
readonly patents: PatentsClient;
|
|
1936
|
+
/** Google Scholar — search, profiles, author, author citation, cite formats. */
|
|
1937
|
+
readonly scholar: ScholarClient;
|
|
1938
|
+
/** Google Autocomplete — search suggestions. */
|
|
1939
|
+
readonly autocomplete: AutocompleteClient;
|
|
1940
|
+
/** Google Images. */
|
|
1941
|
+
readonly images: ImagesClient;
|
|
1942
|
+
/** Google Videos. */
|
|
1943
|
+
readonly videos: VideosClient;
|
|
1944
|
+
/** Google Finance — stock and index quotes. */
|
|
1945
|
+
readonly finance: FinanceClient;
|
|
1946
|
+
/** Google AI Mode — generative answer responses. */
|
|
1947
|
+
readonly aiMode: AiModeClient;
|
|
1948
|
+
/** Google Lens — visual image search. */
|
|
1949
|
+
readonly lens: LensClient;
|
|
1950
|
+
/** Google Shorts — short-form vertical video results (udm=39). */
|
|
1951
|
+
readonly shorts: ShortsClient;
|
|
1952
|
+
/** Google Flights — one-way, round-trip, and multi-city itineraries. */
|
|
1953
|
+
readonly flights: FlightsClient;
|
|
1954
|
+
/** Google Products — immersive product detail. */
|
|
1955
|
+
readonly products: ProductsClient;
|
|
1956
|
+
constructor(client: BaseClient);
|
|
159
1957
|
}
|
|
160
1958
|
|
|
161
1959
|
/**
|
|
@@ -202,6 +2000,10 @@ declare class ScrapeBadger {
|
|
|
202
2000
|
readonly twitter: TwitterClient;
|
|
203
2001
|
/** Web scraping API client */
|
|
204
2002
|
readonly web: WebClient;
|
|
2003
|
+
/** Vinted scraper API client */
|
|
2004
|
+
readonly vinted: VintedClient;
|
|
2005
|
+
/** Google Scraper API client — 19 Google product APIs */
|
|
2006
|
+
readonly google: GoogleClient;
|
|
205
2007
|
/**
|
|
206
2008
|
* Create a new ScrapeBadger client.
|
|
207
2009
|
*
|
|
@@ -230,4 +2032,4 @@ declare class ScrapeBadger {
|
|
|
230
2032
|
constructor(config?: Partial<ScrapeBadgerConfig>);
|
|
231
2033
|
}
|
|
232
2034
|
|
|
233
|
-
export { type
|
|
2035
|
+
export { type AiModeSearchParams, type AutocompleteParams, type DetectOptions, type DetectResult, type FinanceQuoteParams, type FlightsSearchParams, type FlightsStopsFilter, type FlightsTravelClass, type FlightsTripType, AiModeClient as GoogleAiModeClient, AutocompleteClient as GoogleAutocompleteClient, GoogleClient, FinanceClient as GoogleFinanceClient, FlightsClient as GoogleFlightsClient, HotelsClient as GoogleHotelsClient, ImagesClient as GoogleImagesClient, JobsClient as GoogleJobsClient, LensClient as GoogleLensClient, MapsClient as GoogleMapsClient, NewsClient as GoogleNewsClient, PatentsClient as GooglePatentsClient, ProductsClient as GoogleProductsClient, type GoogleResponse, ScholarClient as GoogleScholarClient, SearchClient as GoogleSearchClient, type GoogleSearchParams, ShoppingClient as GoogleShoppingClient, ShortsClient as GoogleShortsClient, TrendsClient as GoogleTrendsClient, VideosClient as GoogleVideosClient, type HotelsDetailsParams, type HotelsSearchParams, type ImagesSearchParams, type JobsSearchParams, type LensSearchParams, type MapsPhotosParams, type MapsPlaceParams, type MapsPostsParams, type MapsReviewsParams, type MapsSearchParams, type NewsSearchParams, type NewsTopicsParams, type NewsTrendingParams, type PatentsDetailParams, type PatentsSearchParams, type ProductsDetailParams, type ScholarAuthorCitationParams, type ScholarAuthorParams, type ScholarCiteParams, type ScholarProfilesParams, type ScholarSearchParams, ScrapeBadger, ScrapeBadgerConfig, type ScrapeOptions, type ScrapeResult, type ShoppingClickParams, type ShoppingProductParams, type ShoppingSearchParams, type ShortsSearchParams, type TrendsAutocompleteParams, type TrendsInterestParams, type TrendsRegionsParams, type TrendsRelatedParams, type TrendsTrendingParams, TwitterClient, type VideosSearchParams, type VintedBrand, type BrandsResponse as VintedBrandsResponse, VintedClient, type VintedColor, type ColorsResponse as VintedColorsResponse, type VintedItemDetail, type ItemDetailResponse as VintedItemDetailResponse, type VintedItemSummary, ItemsClient as VintedItemsClient, type VintedMarket, type MarketsResponse as VintedMarketsResponse, type VintedPagination, type VintedPhoto, type VintedPrice, ReferenceClient as VintedReferenceClient, SearchClient$1 as VintedSearchClient, type VintedSearchParams, type SearchResponse as VintedSearchResponse, type VintedSellerSummary, type VintedStatus, type StatusesResponse as VintedStatusesResponse, type UserItemsResponse as VintedUserItemsResponse, type VintedUserProfile, type UserProfileResponse as VintedUserProfileResponse, type VintedUserSummary, UsersClient as VintedUsersClient, WebClient };
|