scrapebadger 0.34.0 → 0.35.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.mjs CHANGED
@@ -8240,6 +8240,112 @@ var ChatGPTClient = class {
8240
8240
  }
8241
8241
  };
8242
8242
 
8243
+ // src/gemini/ask.ts
8244
+ var AskClient2 = class {
8245
+ client;
8246
+ constructor(client) {
8247
+ this.client = client;
8248
+ }
8249
+ /**
8250
+ * Ask Gemini a question and get the answer with its sources.
8251
+ *
8252
+ * @param params - Ask parameters.
8253
+ * @param params.prompt - The prompt to send (max 4096 characters).
8254
+ * @param params.country - ISO-3166 alpha-2 egress country (default: "US").
8255
+ * @param params.web_search - "auto", "force", or "off" (default: "auto").
8256
+ * @returns The answer, its citations, and the full retrieved search set.
8257
+ *
8258
+ * @example
8259
+ * ```typescript
8260
+ * const result = await client.gemini.ask.ask({
8261
+ * prompt: "what is the best CRM for a 10-person startup?",
8262
+ * country: "GB",
8263
+ * web_search: "force",
8264
+ * });
8265
+ * console.log(result.web_search_triggered, result.model);
8266
+ * for (const source of result.search_results) {
8267
+ * console.log(`${source.cited ? "*" : " "} ${source.url}`);
8268
+ * }
8269
+ * ```
8270
+ */
8271
+ async ask(params) {
8272
+ return this.client.request("/v1/gemini/ask", {
8273
+ params: {
8274
+ prompt: params.prompt,
8275
+ country: params.country,
8276
+ web_search: params.web_search
8277
+ }
8278
+ });
8279
+ }
8280
+ };
8281
+
8282
+ // src/gemini/brand.ts
8283
+ var BrandClient2 = class {
8284
+ client;
8285
+ constructor(client) {
8286
+ this.client = client;
8287
+ }
8288
+ /**
8289
+ * Analyse how a brand shows up in Gemini's answer to a prompt.
8290
+ *
8291
+ * @param params - Brand-visibility parameters.
8292
+ * @param params.prompt - The prompt to send (max 4096 characters).
8293
+ * @param params.brand - The brand name to look for in the answer.
8294
+ * @param params.domain - The brand's domain, used to detect brand citations.
8295
+ * @param params.aliases - Other spellings that should count as mentions.
8296
+ * @param params.competitors - Competitors to measure share of voice against.
8297
+ * @param params.country - ISO-3166 alpha-2 egress country (default: "US").
8298
+ * @param params.web_search - "auto", "force", or "off" (default: "force").
8299
+ * @returns The brand analysis plus the answer and its citations.
8300
+ *
8301
+ * @example
8302
+ * ```typescript
8303
+ * const result = await client.gemini.brand.visibility({
8304
+ * prompt: "which proxy provider should I use?",
8305
+ * brand: "ScrapeBadger",
8306
+ * domain: "scrapebadger.com",
8307
+ * aliases: ["Scrape Badger"],
8308
+ * competitors: ["Bright Data", "Oxylabs"],
8309
+ * country: "DE",
8310
+ * });
8311
+ * console.log(`position score: ${result.position_score}`);
8312
+ * for (const competitor of result.competitors) {
8313
+ * console.log(`${competitor.name}: ${competitor.mention_count}`);
8314
+ * }
8315
+ * ```
8316
+ */
8317
+ async visibility(params) {
8318
+ return this.client.request("/v1/gemini/brand-visibility", {
8319
+ params: {
8320
+ prompt: params.prompt,
8321
+ brand: params.brand,
8322
+ domain: params.domain,
8323
+ aliases: params.aliases?.length ? params.aliases.join(",") : void 0,
8324
+ competitors: params.competitors?.length ? params.competitors.join(",") : void 0,
8325
+ country: params.country,
8326
+ web_search: params.web_search
8327
+ }
8328
+ });
8329
+ }
8330
+ };
8331
+
8332
+ // src/gemini/client.ts
8333
+ var GeminiClient = class {
8334
+ /** Client for asking Gemini a question */
8335
+ ask;
8336
+ /** Client for AEO/GEO brand-visibility analysis */
8337
+ brand;
8338
+ /**
8339
+ * Create a new Gemini client.
8340
+ *
8341
+ * @param client - The base HTTP client for making requests.
8342
+ */
8343
+ constructor(client) {
8344
+ this.ask = new AskClient2(client);
8345
+ this.brand = new BrandClient2(client);
8346
+ }
8347
+ };
8348
+
8243
8349
  // src/client.ts
8244
8350
  var ScrapeBadger = class {
8245
8351
  baseClient;
@@ -8297,6 +8403,8 @@ var ScrapeBadger = class {
8297
8403
  linkedin;
8298
8404
  /** ChatGPT scraper API client — ask, brand visibility, models (the real chatgpt.com, anonymous) */
8299
8405
  chatgpt;
8406
+ /** Gemini scraper API client — ask, brand visibility (the real gemini.google.com, anonymous) */
8407
+ gemini;
8300
8408
  /**
8301
8409
  * Create a new ScrapeBadger client.
8302
8410
  *
@@ -8358,9 +8466,10 @@ var ScrapeBadger = class {
8358
8466
  this.depop = new DepopClient(this.baseClient);
8359
8467
  this.linkedin = new LinkedInClient(this.baseClient);
8360
8468
  this.chatgpt = new ChatGPTClient(this.baseClient);
8469
+ this.gemini = new GeminiClient(this.baseClient);
8361
8470
  }
8362
8471
  };
8363
8472
 
8364
- export { AccountRestrictedError, AmazonClient, ListingsClient as AmazonListingsClient, ProductsClient2 as AmazonProductsClient, ReferenceClient2 as AmazonReferenceClient, SearchClient5 as AmazonSearchClient, SellersClient as AmazonSellersClient, ApartmentsClient, AuthenticationError, BaiduClient, BingClient, MediaClient3 as BingMediaClient, NewsClient2 as BingNewsClient, ReferenceClient8 as BingReferenceClient, SearchClient11 as BingSearchClient, AskClient as ChatGPTAskClient, BrandClient as ChatGPTBrandClient, ChatGPTClient, ReferenceClient16 as ChatGPTReferenceClient, CommunitiesClient, ConflictError, DepopClient, DuckDuckGoClient, MediaClient2 as DuckDuckGoMediaClient, ReferenceClient7 as DuckDuckGoReferenceClient, SearchClient10 as DuckDuckGoSearchClient, CategoriesClient as EbayCategoriesClient, EbayClient, ItemsClient2 as EbayItemsClient, ReferenceClient5 as EbayReferenceClient, SearchClient8 as EbaySearchClient, SellersClient2 as EbaySellersClient, GeoClient, 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, ScholarClient as GoogleScholarClient, SearchClient2 as GoogleSearchClient, ShoppingClient as GoogleShoppingClient, ShortsClient as GoogleShortsClient, TrendsClient2 as GoogleTrendsClient, VideosClient as GoogleVideosClient, ImmobiliareClient, AudioClient as InstagramAudioClient, InstagramClient, HashtagsClient as InstagramHashtagsClient, LocationsClient as InstagramLocationsClient, MediaClient as InstagramMediaClient, SearchClient4 as InstagramSearchClient, UsersClient4 as InstagramUsersClient, InsufficientCreditsError, AdsClient2 as LeboncoinAdsClient, LeboncoinClient, ReferenceClient13 as LeboncoinReferenceClient, SearchClient16 as LeboncoinSearchClient, SellersClient4 as LeboncoinSellersClient, LinkedInClient, ListsClient, BrokersClient as LoopNetBrokersClient, LoopNetClient, ListingsClient2 as LoopNetListingsClient, ReferenceClient15 as LoopNetReferenceClient, SearchClient18 as LoopNetSearchClient, NotFoundError, RateLimitError, RealtorClient, PropertiesClient as RealtorPropertiesClient, ReferenceClient12 as RealtorReferenceClient, SearchClient15 as RealtorSearchClient, RedditClient, PostsClient as RedditPostsClient, SearchClient3 as RedditSearchClient, SubredditsClient as RedditSubredditsClient, UsersClient3 as RedditUsersClient, RedfinClient, ScrapeBadger, ScrapeBadgerError, ServerError, ShopeeClient, ProductsClient3 as ShopeeProductsClient, ReferenceClient3 as ShopeeReferenceClient, ReviewsClient as ShopeeReviewsClient, SearchClient6 as ShopeeSearchClient, SpacesClient, StreamClient, AdsClient as TikTokAdsClient, TikTokClient, HashtagsClient2 as TikTokHashtagsClient, MusicClient as TikTokMusicClient, ReferenceClient4 as TikTokReferenceClient, SearchClient7 as TikTokSearchClient, TrendingClient as TikTokTrendingClient, UsersClient5 as TikTokUsersClient, VideosClient2 as TikTokVideosClient, TimeoutError, TrendsClient, TweetsClient, TwitterClient, UsersClient, ValidationError, VintedClient, ItemsClient as VintedItemsClient, ReferenceClient as VintedReferenceClient, SearchClient as VintedSearchClient, UsersClient2 as VintedUsersClient, WalmartClient, ProductsClient4 as WalmartProductsClient, ReferenceClient6 as WalmartReferenceClient, SearchClient9 as WalmartSearchClient, SellersClient3 as WalmartSellersClient, StoresClient as WalmartStoresClient, WebClient, WebSocketStreamError, YahooClient, MediaClient4 as YahooMediaClient, NewsClient3 as YahooNewsClient, ReferenceClient9 as YahooReferenceClient, SearchClient12 as YahooSearchClient, YandexClient, ImagesClient2 as YandexImagesClient, ReferenceClient10 as YandexReferenceClient, SearchClient13 as YandexSearchClient, ChannelsClient as YoutubeChannelsClient, YoutubeClient, CommunityClient as YoutubeCommunityClient, MusicClient2 as YoutubeMusicClient, PlaylistsClient as YoutubePlaylistsClient, ReferenceClient11 as YoutubeReferenceClient, SearchClient14 as YoutubeSearchClient, ShortsClient2 as YoutubeShortsClient, TrendingClient2 as YoutubeTrendingClient, VideosClient3 as YoutubeVideosClient, AgentClient as ZillowAgentClient, ZillowClient, PropertiesClient2 as ZillowPropertiesClient, ReferenceClient14 as ZillowReferenceClient, SearchClient17 as ZillowSearchClient, collectAll, verifyWebhookSignature };
8473
+ export { AccountRestrictedError, AmazonClient, ListingsClient as AmazonListingsClient, ProductsClient2 as AmazonProductsClient, ReferenceClient2 as AmazonReferenceClient, SearchClient5 as AmazonSearchClient, SellersClient as AmazonSellersClient, ApartmentsClient, AuthenticationError, BaiduClient, BingClient, MediaClient3 as BingMediaClient, NewsClient2 as BingNewsClient, ReferenceClient8 as BingReferenceClient, SearchClient11 as BingSearchClient, AskClient as ChatGPTAskClient, BrandClient as ChatGPTBrandClient, ChatGPTClient, ReferenceClient16 as ChatGPTReferenceClient, CommunitiesClient, ConflictError, DepopClient, DuckDuckGoClient, MediaClient2 as DuckDuckGoMediaClient, ReferenceClient7 as DuckDuckGoReferenceClient, SearchClient10 as DuckDuckGoSearchClient, CategoriesClient as EbayCategoriesClient, EbayClient, ItemsClient2 as EbayItemsClient, ReferenceClient5 as EbayReferenceClient, SearchClient8 as EbaySearchClient, SellersClient2 as EbaySellersClient, AskClient2 as GeminiAskClient, BrandClient2 as GeminiBrandClient, GeminiClient, GeoClient, 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, ScholarClient as GoogleScholarClient, SearchClient2 as GoogleSearchClient, ShoppingClient as GoogleShoppingClient, ShortsClient as GoogleShortsClient, TrendsClient2 as GoogleTrendsClient, VideosClient as GoogleVideosClient, ImmobiliareClient, AudioClient as InstagramAudioClient, InstagramClient, HashtagsClient as InstagramHashtagsClient, LocationsClient as InstagramLocationsClient, MediaClient as InstagramMediaClient, SearchClient4 as InstagramSearchClient, UsersClient4 as InstagramUsersClient, InsufficientCreditsError, AdsClient2 as LeboncoinAdsClient, LeboncoinClient, ReferenceClient13 as LeboncoinReferenceClient, SearchClient16 as LeboncoinSearchClient, SellersClient4 as LeboncoinSellersClient, LinkedInClient, ListsClient, BrokersClient as LoopNetBrokersClient, LoopNetClient, ListingsClient2 as LoopNetListingsClient, ReferenceClient15 as LoopNetReferenceClient, SearchClient18 as LoopNetSearchClient, NotFoundError, RateLimitError, RealtorClient, PropertiesClient as RealtorPropertiesClient, ReferenceClient12 as RealtorReferenceClient, SearchClient15 as RealtorSearchClient, RedditClient, PostsClient as RedditPostsClient, SearchClient3 as RedditSearchClient, SubredditsClient as RedditSubredditsClient, UsersClient3 as RedditUsersClient, RedfinClient, ScrapeBadger, ScrapeBadgerError, ServerError, ShopeeClient, ProductsClient3 as ShopeeProductsClient, ReferenceClient3 as ShopeeReferenceClient, ReviewsClient as ShopeeReviewsClient, SearchClient6 as ShopeeSearchClient, SpacesClient, StreamClient, AdsClient as TikTokAdsClient, TikTokClient, HashtagsClient2 as TikTokHashtagsClient, MusicClient as TikTokMusicClient, ReferenceClient4 as TikTokReferenceClient, SearchClient7 as TikTokSearchClient, TrendingClient as TikTokTrendingClient, UsersClient5 as TikTokUsersClient, VideosClient2 as TikTokVideosClient, TimeoutError, TrendsClient, TweetsClient, TwitterClient, UsersClient, ValidationError, VintedClient, ItemsClient as VintedItemsClient, ReferenceClient as VintedReferenceClient, SearchClient as VintedSearchClient, UsersClient2 as VintedUsersClient, WalmartClient, ProductsClient4 as WalmartProductsClient, ReferenceClient6 as WalmartReferenceClient, SearchClient9 as WalmartSearchClient, SellersClient3 as WalmartSellersClient, StoresClient as WalmartStoresClient, WebClient, WebSocketStreamError, YahooClient, MediaClient4 as YahooMediaClient, NewsClient3 as YahooNewsClient, ReferenceClient9 as YahooReferenceClient, SearchClient12 as YahooSearchClient, YandexClient, ImagesClient2 as YandexImagesClient, ReferenceClient10 as YandexReferenceClient, SearchClient13 as YandexSearchClient, ChannelsClient as YoutubeChannelsClient, YoutubeClient, CommunityClient as YoutubeCommunityClient, MusicClient2 as YoutubeMusicClient, PlaylistsClient as YoutubePlaylistsClient, ReferenceClient11 as YoutubeReferenceClient, SearchClient14 as YoutubeSearchClient, ShortsClient2 as YoutubeShortsClient, TrendingClient2 as YoutubeTrendingClient, VideosClient3 as YoutubeVideosClient, AgentClient as ZillowAgentClient, ZillowClient, PropertiesClient2 as ZillowPropertiesClient, ReferenceClient14 as ZillowReferenceClient, SearchClient17 as ZillowSearchClient, collectAll, verifyWebhookSignature };
8365
8474
  //# sourceMappingURL=index.mjs.map
8366
8475
  //# sourceMappingURL=index.mjs.map