scrapebadger 0.69.1 → 0.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index.js → index.cjs} +162 -11
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +165 -8
- package/dist/index.d.ts +165 -8
- package/dist/index.mjs +160 -9
- package/dist/index.mjs.map +1 -1
- package/dist/twitter/{index.js → index.cjs} +2 -2
- package/dist/twitter/index.cjs.map +1 -0
- package/package.json +8 -8
- package/dist/index.js.map +0 -1
- package/dist/twitter/index.js.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { EventEmitter } from 'events';
|
|
|
3
3
|
import WebSocket from 'ws';
|
|
4
4
|
|
|
5
5
|
// src/internal/version.ts
|
|
6
|
-
var SDK_VERSION = "0.
|
|
6
|
+
var SDK_VERSION = "0.72.0";
|
|
7
7
|
|
|
8
8
|
// src/internal/exceptions.ts
|
|
9
9
|
var ScrapeBadgerError = class _ScrapeBadgerError extends Error {
|
|
@@ -3525,6 +3525,7 @@ var ScholarClient = class {
|
|
|
3525
3525
|
};
|
|
3526
3526
|
|
|
3527
3527
|
// src/google/search.ts
|
|
3528
|
+
var FULL_SEARCH_ONLY = ["mode", "ai_overview", "expand_related_questions"];
|
|
3528
3529
|
var SearchClient2 = class {
|
|
3529
3530
|
constructor(client) {
|
|
3530
3531
|
this.client = client;
|
|
@@ -3533,17 +3534,59 @@ var SearchClient2 = class {
|
|
|
3533
3534
|
* Search Google and get a structured SERP response with organic results,
|
|
3534
3535
|
* knowledge graph, People Also Ask, related searches, AI overview, and
|
|
3535
3536
|
* pagination.
|
|
3537
|
+
*
|
|
3538
|
+
* The response (untyped, `Record<string, unknown>`) holds, when Google
|
|
3539
|
+
* shows them:
|
|
3540
|
+
* - `search_information`: total_results, time_taken, query_displayed,
|
|
3541
|
+
* organic_results_state (`"no_results"` on an explicit Google
|
|
3542
|
+
* no-results answer, `"Results for relaxed query"` when Google drops
|
|
3543
|
+
* quotes).
|
|
3544
|
+
* - `organic_results`: position, title, link, snippet, displayed_link,
|
|
3545
|
+
* plus `date`, `sitelinks`, `rich_snippet` and `read_more_link`.
|
|
3546
|
+
* - `related_questions`: question, rank, `type` (`"ai_overview"` or
|
|
3547
|
+
* `null`), and `text_blocks` / `references` with
|
|
3548
|
+
* `expand_related_questions`.
|
|
3549
|
+
* - `ai_overview`: `text_blocks` (paragraph, heading and list blocks; list
|
|
3550
|
+
* blocks carry `list_items`) with `reference_indexes` (0-based into
|
|
3551
|
+
* `references`), and `references` (title, link, source, snippet, logo).
|
|
3552
|
+
* - `shopping_results`: position, category, title, price, extracted_price,
|
|
3553
|
+
* original_price, extracted_original_price, source, rating, reviews,
|
|
3554
|
+
* delivery, extensions, thumbnail, product_id, catalog_id, product_link,
|
|
3555
|
+
* scrapebadger_product_detail_link.
|
|
3556
|
+
* - `perspectives`, `discussions_and_forums`, `short_videos`,
|
|
3557
|
+
* `things_to_know`, `ads`, `knowledge_graph`, `people_also_search_for`,
|
|
3558
|
+
* `related_searches`, `local_results`, `inline_videos`, `pagination`.
|
|
3559
|
+
*
|
|
3560
|
+
* A full-mode query with a `site:` operator is answered from Google's Web
|
|
3561
|
+
* tab: organic results, related searches and pagination only, rich blocks
|
|
3562
|
+
* empty (pass `ai_overview: true` for the full page).
|
|
3563
|
+
*
|
|
3564
|
+
* @example
|
|
3565
|
+
* ```typescript
|
|
3566
|
+
* // People Also Ask answers for the first two questions
|
|
3567
|
+
* const serp = await client.google.search.search({
|
|
3568
|
+
* q: "are noise cancelling headphones worth it",
|
|
3569
|
+
* expand_related_questions: 2,
|
|
3570
|
+
* });
|
|
3571
|
+
* ```
|
|
3536
3572
|
*/
|
|
3537
3573
|
async search(params) {
|
|
3538
3574
|
return this.client.request("/v1/google/search", { params: { ...params } });
|
|
3539
3575
|
}
|
|
3540
3576
|
/**
|
|
3541
|
-
*
|
|
3577
|
+
* Google Light Search — organic results + related searches only.
|
|
3578
|
+
*
|
|
3579
|
+
* Calls the dedicated `/v1/google/light/search` endpoint, billed at the
|
|
3580
|
+
* Light rate (half of full {@link search}; query `/public/pricing` for the
|
|
3581
|
+
* live rate). Skips ads, Knowledge Graph, AI Overview, People Also Ask,
|
|
3582
|
+
* local pack, news, inline videos, and shopping blocks. Has a 12-second
|
|
3583
|
+
* processing budget; past it the API returns `503` with
|
|
3584
|
+
* `Retry-After: 60`. Light cannot be upgraded to full Search, so
|
|
3585
|
+
* `ai_overview` is not sent; AI Overview and People Also Ask answers
|
|
3586
|
+
* (`expand_related_questions`) need {@link search}.
|
|
3542
3587
|
*
|
|
3543
|
-
*
|
|
3544
|
-
*
|
|
3545
|
-
* Credit cost is configured per-endpoint by admins — query
|
|
3546
|
-
* `/public/pricing` for the live rate.
|
|
3588
|
+
* Returns `{ search_information, organic_results, related_searches,
|
|
3589
|
+
* pagination }`.
|
|
3547
3590
|
*
|
|
3548
3591
|
* @example
|
|
3549
3592
|
* ```typescript
|
|
@@ -3551,9 +3594,9 @@ var SearchClient2 = class {
|
|
|
3551
3594
|
* ```
|
|
3552
3595
|
*/
|
|
3553
3596
|
async light(params) {
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
});
|
|
3597
|
+
const light = { ...params };
|
|
3598
|
+
for (const key of FULL_SEARCH_ONLY) delete light[key];
|
|
3599
|
+
return this.client.request("/v1/google/light/search", { params: light });
|
|
3557
3600
|
}
|
|
3558
3601
|
};
|
|
3559
3602
|
|
|
@@ -3752,6 +3795,10 @@ var GoogleClient = class {
|
|
|
3752
3795
|
async googleFlightsCalendarCheapestFarePerDate(params = {}) {
|
|
3753
3796
|
return this._gen.request("/v1/google/flights/calendar", { params });
|
|
3754
3797
|
}
|
|
3798
|
+
/** Google Light web search. Generated from the OpenAPI spec; returns the raw response object. */
|
|
3799
|
+
async googleLightWebSearch(params = {}) {
|
|
3800
|
+
return this._gen.request("/v1/google/light/search", { params });
|
|
3801
|
+
}
|
|
3755
3802
|
// --- END generated by sdk/codegen/facade ---
|
|
3756
3803
|
};
|
|
3757
3804
|
|
|
@@ -4575,6 +4622,26 @@ var AsosClient = class {
|
|
|
4575
4622
|
}
|
|
4576
4623
|
};
|
|
4577
4624
|
|
|
4625
|
+
// src/autoscout24/client.ts
|
|
4626
|
+
var Autoscout24Client = class {
|
|
4627
|
+
client;
|
|
4628
|
+
constructor(client) {
|
|
4629
|
+
this.client = client;
|
|
4630
|
+
}
|
|
4631
|
+
/** List search filters. Generated from the OpenAPI spec; returns the raw response object. */
|
|
4632
|
+
async listSearchFilters(params = {}) {
|
|
4633
|
+
return this.client.request("/v1/autoscout24/filters", { params });
|
|
4634
|
+
}
|
|
4635
|
+
/** List markets. Generated from the OpenAPI spec; returns the raw response object. */
|
|
4636
|
+
async listMarkets(params = {}) {
|
|
4637
|
+
return this.client.request("/v1/autoscout24/markets", { params });
|
|
4638
|
+
}
|
|
4639
|
+
/** Search vehicles. Generated from the OpenAPI spec; returns the raw response object. */
|
|
4640
|
+
async searchVehicles(params = {}) {
|
|
4641
|
+
return this.client.request("/v1/autoscout24/search", { params });
|
|
4642
|
+
}
|
|
4643
|
+
};
|
|
4644
|
+
|
|
4578
4645
|
// src/instagram/users.ts
|
|
4579
4646
|
var UsersClient4 = class {
|
|
4580
4647
|
client;
|
|
@@ -4977,6 +5044,18 @@ var AccountClient = class {
|
|
|
4977
5044
|
async getAccountInfo(params = {}) {
|
|
4978
5045
|
return this.client.request("/v1/account/me", { params });
|
|
4979
5046
|
}
|
|
5047
|
+
/** Get the webhook signing secret. Generated from the OpenAPI spec; returns the raw response object. */
|
|
5048
|
+
async getTheWebhookSigningSecret(params = {}) {
|
|
5049
|
+
return this.client.request("/v1/account/webhook-secret", { params });
|
|
5050
|
+
}
|
|
5051
|
+
/** Rotate the webhook signing secret. Generated from the OpenAPI spec; returns the raw response object. */
|
|
5052
|
+
async rotateTheWebhookSigningSecret(body, params = {}) {
|
|
5053
|
+
return this.client.request("/v1/account/webhook-secret/rotate", {
|
|
5054
|
+
method: "POST",
|
|
5055
|
+
params,
|
|
5056
|
+
body
|
|
5057
|
+
});
|
|
5058
|
+
}
|
|
4980
5059
|
};
|
|
4981
5060
|
|
|
4982
5061
|
// src/agent/client.ts
|
|
@@ -6539,6 +6618,10 @@ var FacebookClient = class {
|
|
|
6539
6618
|
async listLocations(params = {}) {
|
|
6540
6619
|
return this.client.request("/v1/facebook/marketplace/locations", { params });
|
|
6541
6620
|
}
|
|
6621
|
+
/** Resolve a town/postcode to a Marketplace location. Generated from the OpenAPI spec; returns the raw response object. */
|
|
6622
|
+
async resolveATownPostcodeToAMarketplaceLocation(params = {}) {
|
|
6623
|
+
return this.client.request("/v1/facebook/marketplace/locations/resolve", { params });
|
|
6624
|
+
}
|
|
6542
6625
|
/** Search Marketplace. Generated from the OpenAPI spec; returns the raw response object. */
|
|
6543
6626
|
async searchMarketplace(params = {}) {
|
|
6544
6627
|
return this.client.request("/v1/facebook/marketplace/search", { params });
|
|
@@ -7319,6 +7402,38 @@ var BookingClient = class {
|
|
|
7319
7402
|
}
|
|
7320
7403
|
};
|
|
7321
7404
|
|
|
7405
|
+
// src/brave/client.ts
|
|
7406
|
+
var BraveClient = class {
|
|
7407
|
+
client;
|
|
7408
|
+
constructor(client) {
|
|
7409
|
+
this.client = client;
|
|
7410
|
+
}
|
|
7411
|
+
/** Autocomplete. Generated from the OpenAPI spec; returns the raw response object. */
|
|
7412
|
+
async autocomplete(params = {}) {
|
|
7413
|
+
return this.client.request("/v1/brave/autocomplete", { params });
|
|
7414
|
+
}
|
|
7415
|
+
/** Image search. Generated from the OpenAPI spec; returns the raw response object. */
|
|
7416
|
+
async imageSearch(params = {}) {
|
|
7417
|
+
return this.client.request("/v1/brave/images", { params });
|
|
7418
|
+
}
|
|
7419
|
+
/** List supported locales. Generated from the OpenAPI spec; returns the raw response object. */
|
|
7420
|
+
async listSupportedLocales(params = {}) {
|
|
7421
|
+
return this.client.request("/v1/brave/locales", { params });
|
|
7422
|
+
}
|
|
7423
|
+
/** News search. Generated from the OpenAPI spec; returns the raw response object. */
|
|
7424
|
+
async newsSearch(params = {}) {
|
|
7425
|
+
return this.client.request("/v1/brave/news", { params });
|
|
7426
|
+
}
|
|
7427
|
+
/** Web search. Generated from the OpenAPI spec; returns the raw response object. */
|
|
7428
|
+
async webSearch(params = {}) {
|
|
7429
|
+
return this.client.request("/v1/brave/search", { params });
|
|
7430
|
+
}
|
|
7431
|
+
/** Video search. Generated from the OpenAPI spec; returns the raw response object. */
|
|
7432
|
+
async videoSearch(params = {}) {
|
|
7433
|
+
return this.client.request("/v1/brave/videos", { params });
|
|
7434
|
+
}
|
|
7435
|
+
};
|
|
7436
|
+
|
|
7322
7437
|
// src/baidu/client.ts
|
|
7323
7438
|
var BaiduClient = class {
|
|
7324
7439
|
client;
|
|
@@ -7390,6 +7505,18 @@ var BaiduClient = class {
|
|
|
7390
7505
|
}
|
|
7391
7506
|
};
|
|
7392
7507
|
|
|
7508
|
+
// src/batch/client.ts
|
|
7509
|
+
var BatchClient = class {
|
|
7510
|
+
client;
|
|
7511
|
+
constructor(client) {
|
|
7512
|
+
this.client = client;
|
|
7513
|
+
}
|
|
7514
|
+
/** Submit a batch of async requests. Generated from the OpenAPI spec; returns the raw response object. */
|
|
7515
|
+
async submitABatchOfAsyncRequests(body, params = {}) {
|
|
7516
|
+
return this.client.request("/v1/batch", { method: "POST", params, body });
|
|
7517
|
+
}
|
|
7518
|
+
};
|
|
7519
|
+
|
|
7393
7520
|
// src/bestbuy/client.ts
|
|
7394
7521
|
var BestbuyClient = class {
|
|
7395
7522
|
client;
|
|
@@ -10550,6 +10677,18 @@ var GeminiClient = class {
|
|
|
10550
10677
|
// --- END generated by sdk/codegen/facade ---
|
|
10551
10678
|
};
|
|
10552
10679
|
|
|
10680
|
+
// src/github/client.ts
|
|
10681
|
+
var GithubClient = class {
|
|
10682
|
+
client;
|
|
10683
|
+
constructor(client) {
|
|
10684
|
+
this.client = client;
|
|
10685
|
+
}
|
|
10686
|
+
/** Get profile. Generated from the OpenAPI spec; returns the raw response object. */
|
|
10687
|
+
async getProfile(username, params = {}) {
|
|
10688
|
+
return this.client.request(`/v1/github/profiles/${username}`, { params });
|
|
10689
|
+
}
|
|
10690
|
+
};
|
|
10691
|
+
|
|
10553
10692
|
// src/client.ts
|
|
10554
10693
|
var ScrapeBadger = class {
|
|
10555
10694
|
baseClient;
|
|
@@ -10573,6 +10712,8 @@ var ScrapeBadger = class {
|
|
|
10573
10712
|
app_store;
|
|
10574
10713
|
/** Asos API client. (Generated from the OpenAPI spec.) */
|
|
10575
10714
|
asos;
|
|
10715
|
+
/** Autoscout24 API client. (Generated from the OpenAPI spec.) */
|
|
10716
|
+
autoscout24;
|
|
10576
10717
|
/** Instagram scraper API client — users, media, search, hashtags, locations, audio */
|
|
10577
10718
|
instagram;
|
|
10578
10719
|
/** Redfin scraper API client — search, property, agent, autocomplete, markets (redfin.com, US) */
|
|
@@ -10613,8 +10754,12 @@ var ScrapeBadger = class {
|
|
|
10613
10754
|
bing;
|
|
10614
10755
|
/** Booking API client. (Generated from the OpenAPI spec.) */
|
|
10615
10756
|
booking;
|
|
10757
|
+
/** Brave API client. (Generated from the OpenAPI spec.) */
|
|
10758
|
+
brave;
|
|
10616
10759
|
/** Baidu scraper API client — search, news, images, autocomplete (baidu.com, China's #1 search engine) */
|
|
10617
10760
|
baidu;
|
|
10761
|
+
/** Batch API client. (Generated from the OpenAPI spec.) */
|
|
10762
|
+
batch;
|
|
10618
10763
|
/** Bestbuy API client. (Generated from the OpenAPI spec.) */
|
|
10619
10764
|
bestbuy;
|
|
10620
10765
|
/** Naver scraper API client — 55 endpoints (search, places, shopping, stores, content, reviews, products, shopping live; naver.com, South Korea) */
|
|
@@ -10649,6 +10794,8 @@ var ScrapeBadger = class {
|
|
|
10649
10794
|
copilot;
|
|
10650
10795
|
/** Gemini scraper API client — ask, brand visibility (the real gemini.google.com, anonymous) */
|
|
10651
10796
|
gemini;
|
|
10797
|
+
/** Github API client. (Generated from the OpenAPI spec.) */
|
|
10798
|
+
github;
|
|
10652
10799
|
/**
|
|
10653
10800
|
* Create a new ScrapeBadger client.
|
|
10654
10801
|
*
|
|
@@ -10693,6 +10840,7 @@ var ScrapeBadger = class {
|
|
|
10693
10840
|
this.apartments = new ApartmentsClient(this.baseClient);
|
|
10694
10841
|
this.app_store = new AppStoreClient(this.baseClient);
|
|
10695
10842
|
this.asos = new AsosClient(this.baseClient);
|
|
10843
|
+
this.autoscout24 = new Autoscout24Client(this.baseClient);
|
|
10696
10844
|
this.instagram = new InstagramClient(this.baseClient);
|
|
10697
10845
|
this.redfin = new RedfinClient(this.baseClient);
|
|
10698
10846
|
this.account = new AccountClient(this.baseClient);
|
|
@@ -10713,7 +10861,9 @@ var ScrapeBadger = class {
|
|
|
10713
10861
|
this.duckduckgo = new DuckDuckGoClient(this.baseClient);
|
|
10714
10862
|
this.bing = new BingClient(this.baseClient);
|
|
10715
10863
|
this.booking = new BookingClient(this.baseClient);
|
|
10864
|
+
this.brave = new BraveClient(this.baseClient);
|
|
10716
10865
|
this.baidu = new BaiduClient(this.baseClient);
|
|
10866
|
+
this.batch = new BatchClient(this.baseClient);
|
|
10717
10867
|
this.bestbuy = new BestbuyClient(this.baseClient);
|
|
10718
10868
|
this.naver = new NaverClient(this.baseClient);
|
|
10719
10869
|
this.yahoo = new YahooClient(this.baseClient);
|
|
@@ -10731,6 +10881,7 @@ var ScrapeBadger = class {
|
|
|
10731
10881
|
this.chatgpt = new ChatGPTClient(this.baseClient);
|
|
10732
10882
|
this.copilot = new CopilotClient(this.baseClient);
|
|
10733
10883
|
this.gemini = new GeminiClient(this.baseClient);
|
|
10884
|
+
this.github = new GithubClient(this.baseClient);
|
|
10734
10885
|
}
|
|
10735
10886
|
};
|
|
10736
10887
|
|