scrapebadger 0.29.0 → 0.30.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 CHANGED
@@ -5705,8 +5705,227 @@ var EbayClient = class {
5705
5705
  }
5706
5706
  };
5707
5707
 
5708
- // src/youtube/search.ts
5708
+ // src/walmart/search.ts
5709
5709
  var SearchClient9 = class {
5710
+ constructor(client) {
5711
+ this.client = client;
5712
+ }
5713
+ /**
5714
+ * Search walmart.com.
5715
+ *
5716
+ * @param query - Search keywords, e.g. `"laptop"`.
5717
+ * @param params - Optional page (1-10), sort, price and facet filters.
5718
+ * @returns A page of ~40-60 organic products.
5719
+ *
5720
+ * @remarks
5721
+ * Results dry up after page 10 regardless of `total_results_reported`; bound
5722
+ * a crawl with `max_page`. Sponsored ad tiles are dropped, sponsored
5723
+ * *products* are returned and flagged `is_sponsored`.
5724
+ */
5725
+ async search(query, params = {}) {
5726
+ return this.client.request("/v1/walmart/search", {
5727
+ params: {
5728
+ query,
5729
+ page: params.page,
5730
+ sort: params.sort,
5731
+ min_price: params.min_price,
5732
+ max_price: params.max_price,
5733
+ facet: params.facet
5734
+ }
5735
+ });
5736
+ }
5737
+ /**
5738
+ * Browse a Walmart category. Same result shape as {@link search}.
5739
+ *
5740
+ * @param path - Browse path, e.g. `"electronics/3944"`, or a `/cp/...` path.
5741
+ * @param params - Optional page (1-11), price and facet filters.
5742
+ *
5743
+ * @remarks
5744
+ * No `sort`: Walmart's browse pages ignore it (verified). Sort on
5745
+ * {@link search} instead.
5746
+ */
5747
+ async category(path, params = {}) {
5748
+ return this.client.request("/v1/walmart/category", {
5749
+ params: {
5750
+ path,
5751
+ page: params.page,
5752
+ min_price: params.min_price,
5753
+ max_price: params.max_price,
5754
+ facet: params.facet
5755
+ }
5756
+ });
5757
+ }
5758
+ /**
5759
+ * Walmart's current deals, rollbacks and clearance.
5760
+ *
5761
+ * @param params - Optional page (1-11) and price filters.
5762
+ */
5763
+ async deals(params = {}) {
5764
+ return this.client.request("/v1/walmart/deals", {
5765
+ params: {
5766
+ page: params.page,
5767
+ min_price: params.min_price,
5768
+ max_price: params.max_price
5769
+ }
5770
+ });
5771
+ }
5772
+ /**
5773
+ * Walmart search-box suggestions — the cheapest call in this API.
5774
+ *
5775
+ * @param query - Partial search term, e.g. `"lapt"`.
5776
+ */
5777
+ async autocomplete(query) {
5778
+ return this.client.request("/v1/walmart/autocomplete", {
5779
+ params: { query }
5780
+ });
5781
+ }
5782
+ };
5783
+
5784
+ // src/walmart/products.ts
5785
+ var ProductsClient4 = class {
5786
+ constructor(client) {
5787
+ this.client = client;
5788
+ }
5789
+ /**
5790
+ * Get full product detail.
5791
+ *
5792
+ * @param itemId - Walmart `usItemId`, e.g. `"5689919121"`.
5793
+ * @throws NotFoundError - If the item doesn't exist.
5794
+ *
5795
+ * @remarks
5796
+ * Only the numeric id is needed — the SEO slug is decorative and ignored by
5797
+ * Walmart's router. Prices and availability are store-specific; the resolved
5798
+ * store is on `location`.
5799
+ */
5800
+ async get(itemId) {
5801
+ return this.client.request(`/v1/walmart/products/${itemId}`);
5802
+ }
5803
+ /**
5804
+ * Get paginated customer reviews with the full star histogram.
5805
+ *
5806
+ * @param itemId - Walmart `usItemId`.
5807
+ * @param params - Optional page (1-100) and sort.
5808
+ * @returns Reviews plus the rating breakdown, aspects, and the most-helpful
5809
+ * positive and negative reviews.
5810
+ *
5811
+ * @remarks 10 reviews per page — Walmart's page size, not adjustable.
5812
+ */
5813
+ async reviews(itemId, params = {}) {
5814
+ return this.client.request(
5815
+ `/v1/walmart/products/${itemId}/reviews`,
5816
+ { params: { page: params.page, sort: params.sort } }
5817
+ );
5818
+ }
5819
+ };
5820
+
5821
+ // src/walmart/sellers.ts
5822
+ var SellersClient3 = class {
5823
+ constructor(client) {
5824
+ this.client = client;
5825
+ }
5826
+ /**
5827
+ * Get a marketplace seller's profile — contact details, address, rating,
5828
+ * policies.
5829
+ *
5830
+ * @param sellerId - Numeric catalog seller id, e.g. `"101040442"`. This is
5831
+ * the `seller.catalog_seller_id` on a product — NOT the 32-char hex
5832
+ * `seller_id`, which 404s as a storefront URL.
5833
+ *
5834
+ * @remarks
5835
+ * No page parameter and no product list: adding `?page=` makes Walmart's own
5836
+ * SSR throw. Use {@link products} for the catalogue.
5837
+ */
5838
+ async get(sellerId) {
5839
+ return this.client.request(`/v1/walmart/sellers/${sellerId}`);
5840
+ }
5841
+ /**
5842
+ * List a marketplace seller's catalogue.
5843
+ *
5844
+ * @param sellerId - Numeric catalog seller id.
5845
+ * @param query - Search term scoping the catalogue. REQUIRED — this goes
5846
+ * through search with a `retailer_id` facet, and the facet alone returns
5847
+ * zero results.
5848
+ * @param params - Optional page (1-10) and sort.
5849
+ */
5850
+ async products(sellerId, query, params = {}) {
5851
+ return this.client.request(
5852
+ `/v1/walmart/sellers/${sellerId}/products`,
5853
+ { params: { query, page: params.page, sort: params.sort } }
5854
+ );
5855
+ }
5856
+ };
5857
+
5858
+ // src/walmart/stores.ts
5859
+ var StoresClient = class {
5860
+ constructor(client) {
5861
+ this.client = client;
5862
+ }
5863
+ /**
5864
+ * Get store detail plus every store around it.
5865
+ *
5866
+ * @param storeId - Walmart store number, e.g. `"100"`.
5867
+ * @returns The store's address, geo, phone, opening hours and per-department
5868
+ * services (each with its own hours and phone), plus ~30 nearby stores.
5869
+ */
5870
+ async get(storeId) {
5871
+ return this.client.request(`/v1/walmart/stores/${storeId}`);
5872
+ }
5873
+ };
5874
+
5875
+ // src/walmart/reference.ts
5876
+ var ReferenceClient6 = class {
5877
+ constructor(client) {
5878
+ this.client = client;
5879
+ }
5880
+ /**
5881
+ * Get the supported Walmart markets.
5882
+ *
5883
+ * @remarks
5884
+ * Only walmart.com (US) is supported — walmart.ca and walmart.com.mx run on
5885
+ * different platforms with different payload shapes, so they are not claimed
5886
+ * here rather than shipped broken.
5887
+ */
5888
+ async markets() {
5889
+ return this.client.request("/v1/walmart/markets");
5890
+ }
5891
+ /**
5892
+ * Check the health of the Walmart scraper service.
5893
+ *
5894
+ * @returns The raw health payload from the scraper service.
5895
+ */
5896
+ async health() {
5897
+ return this.client.request("/v1/walmart/health");
5898
+ }
5899
+ };
5900
+
5901
+ // src/walmart/client.ts
5902
+ var WalmartClient = class {
5903
+ /** Client for search, category browse, deals and autocomplete */
5904
+ search;
5905
+ /** Client for product detail and reviews */
5906
+ products;
5907
+ /** Client for marketplace seller profile and catalogue */
5908
+ sellers;
5909
+ /** Client for store detail and nearby stores */
5910
+ stores;
5911
+ /** Client for reference data (markets) and service health */
5912
+ reference;
5913
+ /**
5914
+ * Create a new Walmart client.
5915
+ *
5916
+ * @param client - The base HTTP client for making requests.
5917
+ */
5918
+ constructor(client) {
5919
+ this.search = new SearchClient9(client);
5920
+ this.products = new ProductsClient4(client);
5921
+ this.sellers = new SellersClient3(client);
5922
+ this.stores = new StoresClient(client);
5923
+ this.reference = new ReferenceClient6(client);
5924
+ }
5925
+ };
5926
+
5927
+ // src/youtube/search.ts
5928
+ var SearchClient10 = class {
5710
5929
  client;
5711
5930
  constructor(client) {
5712
5931
  this.client = client;
@@ -6231,7 +6450,7 @@ var MusicClient2 = class {
6231
6450
  };
6232
6451
 
6233
6452
  // src/youtube/reference.ts
6234
- var ReferenceClient6 = class {
6453
+ var ReferenceClient7 = class {
6235
6454
  client;
6236
6455
  constructor(client) {
6237
6456
  this.client = client;
@@ -6299,7 +6518,7 @@ var YoutubeClient = class {
6299
6518
  * @param client - The base HTTP client for making requests.
6300
6519
  */
6301
6520
  constructor(client) {
6302
- this.search = new SearchClient9(client);
6521
+ this.search = new SearchClient10(client);
6303
6522
  this.videos = new VideosClient3(client);
6304
6523
  this.channels = new ChannelsClient(client);
6305
6524
  this.playlists = new PlaylistsClient(client);
@@ -6307,12 +6526,12 @@ var YoutubeClient = class {
6307
6526
  this.shorts = new ShortsClient2(client);
6308
6527
  this.trending = new TrendingClient2(client);
6309
6528
  this.music = new MusicClient2(client);
6310
- this.reference = new ReferenceClient6(client);
6529
+ this.reference = new ReferenceClient7(client);
6311
6530
  }
6312
6531
  };
6313
6532
 
6314
6533
  // src/realtor/search.ts
6315
- var SearchClient10 = class {
6534
+ var SearchClient11 = class {
6316
6535
  client;
6317
6536
  constructor(client) {
6318
6537
  this.client = client;
@@ -6386,7 +6605,7 @@ var PropertiesClient = class {
6386
6605
  };
6387
6606
 
6388
6607
  // src/realtor/reference.ts
6389
- var ReferenceClient7 = class {
6608
+ var ReferenceClient8 = class {
6390
6609
  client;
6391
6610
  constructor(client) {
6392
6611
  this.client = client;
@@ -6415,14 +6634,14 @@ var RealtorClient = class {
6415
6634
  * @param client - The base HTTP client for making requests.
6416
6635
  */
6417
6636
  constructor(client) {
6418
- this.search = new SearchClient10(client);
6637
+ this.search = new SearchClient11(client);
6419
6638
  this.properties = new PropertiesClient(client);
6420
- this.reference = new ReferenceClient7(client);
6639
+ this.reference = new ReferenceClient8(client);
6421
6640
  }
6422
6641
  };
6423
6642
 
6424
6643
  // src/leboncoin/search.ts
6425
- var SearchClient11 = class {
6644
+ var SearchClient12 = class {
6426
6645
  client;
6427
6646
  constructor(client) {
6428
6647
  this.client = client;
@@ -6491,7 +6710,7 @@ var AdsClient2 = class {
6491
6710
  };
6492
6711
 
6493
6712
  // src/leboncoin/sellers.ts
6494
- var SellersClient3 = class {
6713
+ var SellersClient4 = class {
6495
6714
  client;
6496
6715
  constructor(client) {
6497
6716
  this.client = client;
@@ -6524,7 +6743,7 @@ var SellersClient3 = class {
6524
6743
  };
6525
6744
 
6526
6745
  // src/leboncoin/reference.ts
6527
- var ReferenceClient8 = class {
6746
+ var ReferenceClient9 = class {
6528
6747
  client;
6529
6748
  constructor(client) {
6530
6749
  this.client = client;
@@ -6595,15 +6814,15 @@ var LeboncoinClient = class {
6595
6814
  * @param client - The base HTTP client for making requests.
6596
6815
  */
6597
6816
  constructor(client) {
6598
- this.search = new SearchClient11(client);
6817
+ this.search = new SearchClient12(client);
6599
6818
  this.ads = new AdsClient2(client);
6600
- this.sellers = new SellersClient3(client);
6601
- this.reference = new ReferenceClient8(client);
6819
+ this.sellers = new SellersClient4(client);
6820
+ this.reference = new ReferenceClient9(client);
6602
6821
  }
6603
6822
  };
6604
6823
 
6605
6824
  // src/zillow/search.ts
6606
- var SearchClient12 = class {
6825
+ var SearchClient13 = class {
6607
6826
  client;
6608
6827
  constructor(client) {
6609
6828
  this.client = client;
@@ -6707,7 +6926,7 @@ var AgentClient = class {
6707
6926
  };
6708
6927
 
6709
6928
  // src/zillow/reference.ts
6710
- var ReferenceClient9 = class {
6929
+ var ReferenceClient10 = class {
6711
6930
  client;
6712
6931
  constructor(client) {
6713
6932
  this.client = client;
@@ -6738,10 +6957,10 @@ var ZillowClient = class {
6738
6957
  * @param client - The base HTTP client for making requests.
6739
6958
  */
6740
6959
  constructor(client) {
6741
- this.search = new SearchClient12(client);
6960
+ this.search = new SearchClient13(client);
6742
6961
  this.properties = new PropertiesClient2(client);
6743
6962
  this.agent = new AgentClient(client);
6744
- this.reference = new ReferenceClient9(client);
6963
+ this.reference = new ReferenceClient10(client);
6745
6964
  }
6746
6965
  };
6747
6966
 
@@ -6876,7 +7095,7 @@ var ImmobiliareClient = class {
6876
7095
  };
6877
7096
 
6878
7097
  // src/loopnet/search.ts
6879
- var SearchClient13 = class {
7098
+ var SearchClient14 = class {
6880
7099
  client;
6881
7100
  constructor(client) {
6882
7101
  this.client = client;
@@ -6957,7 +7176,7 @@ var BrokersClient = class {
6957
7176
  };
6958
7177
 
6959
7178
  // src/loopnet/reference.ts
6960
- var ReferenceClient10 = class {
7179
+ var ReferenceClient11 = class {
6961
7180
  client;
6962
7181
  constructor(client) {
6963
7182
  this.client = client;
@@ -7000,10 +7219,10 @@ var LoopNetClient = class {
7000
7219
  * @param client - The base HTTP client for making requests.
7001
7220
  */
7002
7221
  constructor(client) {
7003
- this.search = new SearchClient13(client);
7222
+ this.search = new SearchClient14(client);
7004
7223
  this.listings = new ListingsClient2(client);
7005
7224
  this.brokers = new BrokersClient(client);
7006
- this.reference = new ReferenceClient10(client);
7225
+ this.reference = new ReferenceClient11(client);
7007
7226
  }
7008
7227
  };
7009
7228
 
@@ -7364,7 +7583,7 @@ var BrandClient = class {
7364
7583
  };
7365
7584
 
7366
7585
  // src/chatgpt/reference.ts
7367
- var ReferenceClient11 = class {
7586
+ var ReferenceClient12 = class {
7368
7587
  client;
7369
7588
  constructor(client) {
7370
7589
  this.client = client;
@@ -7410,7 +7629,7 @@ var ChatGPTClient = class {
7410
7629
  constructor(client) {
7411
7630
  this.ask = new AskClient(client);
7412
7631
  this.brand = new BrandClient(client);
7413
- this.reference = new ReferenceClient11(client);
7632
+ this.reference = new ReferenceClient12(client);
7414
7633
  }
7415
7634
  };
7416
7635
 
@@ -7441,6 +7660,8 @@ var ScrapeBadger = class {
7441
7660
  tiktok;
7442
7661
  /** eBay scraper API client — 12 endpoints across 18 markets */
7443
7662
  ebay;
7663
+ /** Walmart scraper API client — 11 endpoints (walmart.com, US-only) */
7664
+ walmart;
7444
7665
  /** YouTube scraper API client — 39 endpoints */
7445
7666
  youtube;
7446
7667
  /** Realtor scraper API client — 4 endpoints across 2 markets (us, ca) */
@@ -7505,6 +7726,7 @@ var ScrapeBadger = class {
7505
7726
  this.shopee = new ShopeeClient(this.baseClient);
7506
7727
  this.tiktok = new TikTokClient(this.baseClient);
7507
7728
  this.ebay = new EbayClient(this.baseClient);
7729
+ this.walmart = new WalmartClient(this.baseClient);
7508
7730
  this.youtube = new YoutubeClient(this.baseClient);
7509
7731
  this.realtor = new RealtorClient(this.baseClient);
7510
7732
  this.leboncoin = new LeboncoinClient(this.baseClient);
@@ -7529,7 +7751,7 @@ exports.AuthenticationError = AuthenticationError;
7529
7751
  exports.ChatGPTAskClient = AskClient;
7530
7752
  exports.ChatGPTBrandClient = BrandClient;
7531
7753
  exports.ChatGPTClient = ChatGPTClient;
7532
- exports.ChatGPTReferenceClient = ReferenceClient11;
7754
+ exports.ChatGPTReferenceClient = ReferenceClient12;
7533
7755
  exports.CommunitiesClient = CommunitiesClient;
7534
7756
  exports.ConflictError = ConflictError;
7535
7757
  exports.DepopClient = DepopClient;
@@ -7570,22 +7792,22 @@ exports.InstagramUsersClient = UsersClient4;
7570
7792
  exports.InsufficientCreditsError = InsufficientCreditsError;
7571
7793
  exports.LeboncoinAdsClient = AdsClient2;
7572
7794
  exports.LeboncoinClient = LeboncoinClient;
7573
- exports.LeboncoinReferenceClient = ReferenceClient8;
7574
- exports.LeboncoinSearchClient = SearchClient11;
7575
- exports.LeboncoinSellersClient = SellersClient3;
7795
+ exports.LeboncoinReferenceClient = ReferenceClient9;
7796
+ exports.LeboncoinSearchClient = SearchClient12;
7797
+ exports.LeboncoinSellersClient = SellersClient4;
7576
7798
  exports.LinkedInClient = LinkedInClient;
7577
7799
  exports.ListsClient = ListsClient;
7578
7800
  exports.LoopNetBrokersClient = BrokersClient;
7579
7801
  exports.LoopNetClient = LoopNetClient;
7580
7802
  exports.LoopNetListingsClient = ListingsClient2;
7581
- exports.LoopNetReferenceClient = ReferenceClient10;
7582
- exports.LoopNetSearchClient = SearchClient13;
7803
+ exports.LoopNetReferenceClient = ReferenceClient11;
7804
+ exports.LoopNetSearchClient = SearchClient14;
7583
7805
  exports.NotFoundError = NotFoundError;
7584
7806
  exports.RateLimitError = RateLimitError;
7585
7807
  exports.RealtorClient = RealtorClient;
7586
7808
  exports.RealtorPropertiesClient = PropertiesClient;
7587
- exports.RealtorReferenceClient = ReferenceClient7;
7588
- exports.RealtorSearchClient = SearchClient10;
7809
+ exports.RealtorReferenceClient = ReferenceClient8;
7810
+ exports.RealtorSearchClient = SearchClient11;
7589
7811
  exports.RedditClient = RedditClient;
7590
7812
  exports.RedditPostsClient = PostsClient;
7591
7813
  exports.RedditSearchClient = SearchClient3;
@@ -7622,6 +7844,12 @@ exports.VintedItemsClient = ItemsClient;
7622
7844
  exports.VintedReferenceClient = ReferenceClient;
7623
7845
  exports.VintedSearchClient = SearchClient;
7624
7846
  exports.VintedUsersClient = UsersClient2;
7847
+ exports.WalmartClient = WalmartClient;
7848
+ exports.WalmartProductsClient = ProductsClient4;
7849
+ exports.WalmartReferenceClient = ReferenceClient6;
7850
+ exports.WalmartSearchClient = SearchClient9;
7851
+ exports.WalmartSellersClient = SellersClient3;
7852
+ exports.WalmartStoresClient = StoresClient;
7625
7853
  exports.WebClient = WebClient;
7626
7854
  exports.WebSocketStreamError = WebSocketStreamError;
7627
7855
  exports.YoutubeChannelsClient = ChannelsClient;
@@ -7629,16 +7857,16 @@ exports.YoutubeClient = YoutubeClient;
7629
7857
  exports.YoutubeCommunityClient = CommunityClient;
7630
7858
  exports.YoutubeMusicClient = MusicClient2;
7631
7859
  exports.YoutubePlaylistsClient = PlaylistsClient;
7632
- exports.YoutubeReferenceClient = ReferenceClient6;
7633
- exports.YoutubeSearchClient = SearchClient9;
7860
+ exports.YoutubeReferenceClient = ReferenceClient7;
7861
+ exports.YoutubeSearchClient = SearchClient10;
7634
7862
  exports.YoutubeShortsClient = ShortsClient2;
7635
7863
  exports.YoutubeTrendingClient = TrendingClient2;
7636
7864
  exports.YoutubeVideosClient = VideosClient3;
7637
7865
  exports.ZillowAgentClient = AgentClient;
7638
7866
  exports.ZillowClient = ZillowClient;
7639
7867
  exports.ZillowPropertiesClient = PropertiesClient2;
7640
- exports.ZillowReferenceClient = ReferenceClient9;
7641
- exports.ZillowSearchClient = SearchClient12;
7868
+ exports.ZillowReferenceClient = ReferenceClient10;
7869
+ exports.ZillowSearchClient = SearchClient13;
7642
7870
  exports.collectAll = collectAll;
7643
7871
  exports.verifyWebhookSignature = verifyWebhookSignature;
7644
7872
  //# sourceMappingURL=index.js.map