scrapebadger 0.14.0 → 0.15.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
@@ -4806,6 +4806,248 @@ var TikTokClient = class {
4806
4806
  }
4807
4807
  };
4808
4808
 
4809
+ // src/ebay/search.ts
4810
+ var SearchClient7 = class {
4811
+ client;
4812
+ constructor(client) {
4813
+ this.client = client;
4814
+ }
4815
+ /**
4816
+ * Search an eBay marketplace for active listings.
4817
+ *
4818
+ * @param params - Search parameters including query, filters, and pagination.
4819
+ * @returns Search results with cards, facets, and pagination metadata.
4820
+ * @throws AuthenticationError - If the API key is invalid.
4821
+ * @throws ValidationError - If the parameters are invalid.
4822
+ */
4823
+ async search(params) {
4824
+ return this.client.request("/v1/ebay/search", {
4825
+ params: {
4826
+ query: params.query,
4827
+ domain: params.domain,
4828
+ category_id: params.category_id,
4829
+ page: params.page,
4830
+ per_page: params.per_page,
4831
+ sort_by: params.sort_by,
4832
+ condition: params.condition,
4833
+ buying_format: params.buying_format,
4834
+ min_price: params.min_price,
4835
+ max_price: params.max_price,
4836
+ free_shipping: params.free_shipping
4837
+ }
4838
+ });
4839
+ }
4840
+ /**
4841
+ * Search completed / sold listings — eBay's sold-price history.
4842
+ *
4843
+ * @param params - Search parameters including query, filters, and pagination.
4844
+ * @returns Search results (with `sold: true`), facets, and pagination.
4845
+ */
4846
+ async completed(params) {
4847
+ return this.client.request("/v1/ebay/completed", {
4848
+ params: {
4849
+ query: params.query,
4850
+ domain: params.domain,
4851
+ category_id: params.category_id,
4852
+ page: params.page,
4853
+ per_page: params.per_page,
4854
+ sort_by: params.sort_by,
4855
+ condition: params.condition,
4856
+ min_price: params.min_price,
4857
+ max_price: params.max_price
4858
+ }
4859
+ });
4860
+ }
4861
+ /**
4862
+ * Get eBay keyword autocomplete suggestions.
4863
+ *
4864
+ * @param query - Partial search query prefix.
4865
+ * @param options - Optional parameters (domain).
4866
+ * @returns Autocomplete suggestions.
4867
+ */
4868
+ async autocomplete(query, options = {}) {
4869
+ return this.client.request("/v1/ebay/autocomplete", {
4870
+ params: { query, domain: options.domain }
4871
+ });
4872
+ }
4873
+ };
4874
+
4875
+ // src/ebay/items.ts
4876
+ var ItemsClient2 = class {
4877
+ client;
4878
+ constructor(client) {
4879
+ this.client = client;
4880
+ }
4881
+ /**
4882
+ * Get a single eBay listing's full detail.
4883
+ *
4884
+ * @param itemId - The eBay item id.
4885
+ * @param options - Optional parameters (domain).
4886
+ * @returns Item detail including specifics, shipping, and seller summary.
4887
+ * @throws NotFoundError - If the item doesn't exist.
4888
+ */
4889
+ async get(itemId, options = {}) {
4890
+ return this.client.request(
4891
+ `/v1/ebay/items/${itemId}`,
4892
+ { params: { domain: options.domain } }
4893
+ );
4894
+ }
4895
+ /**
4896
+ * Get the catalog product reviews shown on an eBay listing.
4897
+ *
4898
+ * @param itemId - The eBay item id.
4899
+ * @param options - Optional parameters (domain, page, productId).
4900
+ * @returns Reviews response with reviews, aggregate rating, and histogram.
4901
+ */
4902
+ async reviews(itemId, options = {}) {
4903
+ return this.client.request(
4904
+ `/v1/ebay/items/${itemId}/reviews`,
4905
+ {
4906
+ params: {
4907
+ domain: options.domain,
4908
+ page: options.page,
4909
+ product_id: options.productId
4910
+ }
4911
+ }
4912
+ );
4913
+ }
4914
+ };
4915
+
4916
+ // src/ebay/sellers.ts
4917
+ var SellersClient2 = class {
4918
+ client;
4919
+ constructor(client) {
4920
+ this.client = client;
4921
+ }
4922
+ /**
4923
+ * Get an eBay seller's public profile.
4924
+ *
4925
+ * @param username - The seller username.
4926
+ * @param options - Optional parameters (domain).
4927
+ * @returns Seller profile response.
4928
+ * @throws NotFoundError - If the seller doesn't exist.
4929
+ */
4930
+ async get(username, options = {}) {
4931
+ return this.client.request(
4932
+ `/v1/ebay/sellers/${username}`,
4933
+ { params: { domain: options.domain } }
4934
+ );
4935
+ }
4936
+ /**
4937
+ * List the active listings of a single eBay seller.
4938
+ *
4939
+ * @param username - The seller username.
4940
+ * @param options - Optional parameters (domain, query, page, per_page).
4941
+ * @returns Seller items response with result cards and pagination.
4942
+ */
4943
+ async items(username, options = {}) {
4944
+ return this.client.request(
4945
+ `/v1/ebay/sellers/${username}/items`,
4946
+ {
4947
+ params: {
4948
+ domain: options.domain,
4949
+ query: options.query,
4950
+ page: options.page,
4951
+ per_page: options.per_page
4952
+ }
4953
+ }
4954
+ );
4955
+ }
4956
+ /**
4957
+ * Get a seller's recent feedback comments.
4958
+ *
4959
+ * @param username - The seller username.
4960
+ * @param options - Optional parameters (domain, page).
4961
+ * @returns Seller feedback response with feedback entries and pagination.
4962
+ */
4963
+ async feedback(username, options = {}) {
4964
+ return this.client.request(
4965
+ `/v1/ebay/sellers/${username}/feedback`,
4966
+ { params: { domain: options.domain, page: options.page } }
4967
+ );
4968
+ }
4969
+ };
4970
+
4971
+ // src/ebay/categories.ts
4972
+ var CategoriesClient = class {
4973
+ client;
4974
+ constructor(client) {
4975
+ this.client = client;
4976
+ }
4977
+ /**
4978
+ * List active listings within an eBay category.
4979
+ *
4980
+ * @param categoryId - The eBay category id.
4981
+ * @param options - Optional parameters (domain, page, per_page, sort_by, min_price, max_price).
4982
+ * @returns Category response with result cards, facets, and pagination.
4983
+ */
4984
+ async browse(categoryId, options = {}) {
4985
+ return this.client.request(
4986
+ `/v1/ebay/categories/${categoryId}/items`,
4987
+ {
4988
+ params: {
4989
+ domain: options.domain,
4990
+ page: options.page,
4991
+ per_page: options.per_page,
4992
+ sort_by: options.sort_by,
4993
+ min_price: options.min_price,
4994
+ max_price: options.max_price
4995
+ }
4996
+ }
4997
+ );
4998
+ }
4999
+ /**
5000
+ * List eBay's reference top-level category ids.
5001
+ *
5002
+ * @returns Categories response with all category aliases.
5003
+ */
5004
+ async list() {
5005
+ return this.client.request("/v1/ebay/categories");
5006
+ }
5007
+ };
5008
+
5009
+ // src/ebay/reference.ts
5010
+ var ReferenceClient5 = class {
5011
+ client;
5012
+ constructor(client) {
5013
+ this.client = client;
5014
+ }
5015
+ /**
5016
+ * Get all supported eBay marketplaces.
5017
+ *
5018
+ * @returns Markets response with all supported marketplaces.
5019
+ */
5020
+ async markets() {
5021
+ return this.client.request("/v1/ebay/markets");
5022
+ }
5023
+ };
5024
+
5025
+ // src/ebay/client.ts
5026
+ var EbayClient = class {
5027
+ /** Client for active search, completed/sold search, and autocomplete */
5028
+ search;
5029
+ /** Client for item detail and catalog product reviews */
5030
+ items;
5031
+ /** Client for seller profile, items, and feedback */
5032
+ sellers;
5033
+ /** Client for category browse and the reference category list */
5034
+ categories;
5035
+ /** Client for reference data (markets) */
5036
+ reference;
5037
+ /**
5038
+ * Create a new eBay client.
5039
+ *
5040
+ * @param client - The base HTTP client for making requests.
5041
+ */
5042
+ constructor(client) {
5043
+ this.search = new SearchClient7(client);
5044
+ this.items = new ItemsClient2(client);
5045
+ this.sellers = new SellersClient2(client);
5046
+ this.categories = new CategoriesClient(client);
5047
+ this.reference = new ReferenceClient5(client);
5048
+ }
5049
+ };
5050
+
4809
5051
  // src/client.ts
4810
5052
  var ScrapeBadger = class {
4811
5053
  baseClient;
@@ -4825,6 +5067,8 @@ var ScrapeBadger = class {
4825
5067
  shopee;
4826
5068
  /** TikTok scraper API client — 26 endpoints */
4827
5069
  tiktok;
5070
+ /** eBay scraper API client — 12 endpoints across 18 markets */
5071
+ ebay;
4828
5072
  /**
4829
5073
  * Create a new ScrapeBadger client.
4830
5074
  *
@@ -4867,9 +5111,10 @@ var ScrapeBadger = class {
4867
5111
  this.amazon = new AmazonClient(this.baseClient);
4868
5112
  this.shopee = new ShopeeClient(this.baseClient);
4869
5113
  this.tiktok = new TikTokClient(this.baseClient);
5114
+ this.ebay = new EbayClient(this.baseClient);
4870
5115
  }
4871
5116
  };
4872
5117
 
4873
- export { AccountRestrictedError, AmazonClient, ListingsClient as AmazonListingsClient, ProductsClient2 as AmazonProductsClient, ReferenceClient2 as AmazonReferenceClient, SearchClient4 as AmazonSearchClient, SellersClient as AmazonSellersClient, AuthenticationError, CommunitiesClient, ConflictError, 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, InsufficientCreditsError, ListsClient, NotFoundError, RateLimitError, RedditClient, PostsClient as RedditPostsClient, SearchClient3 as RedditSearchClient, SubredditsClient as RedditSubredditsClient, UsersClient3 as RedditUsersClient, ScrapeBadger, ScrapeBadgerError, ServerError, ShopeeClient, ProductsClient3 as ShopeeProductsClient, ReferenceClient3 as ShopeeReferenceClient, ReviewsClient as ShopeeReviewsClient, SearchClient5 as ShopeeSearchClient, SpacesClient, StreamClient, AdsClient as TikTokAdsClient, TikTokClient, HashtagsClient as TikTokHashtagsClient, MusicClient as TikTokMusicClient, ReferenceClient4 as TikTokReferenceClient, SearchClient6 as TikTokSearchClient, TrendingClient as TikTokTrendingClient, UsersClient4 as TikTokUsersClient, VideosClient2 as TikTokVideosClient, TimeoutError, TrendsClient, TweetsClient, TwitterClient, UsersClient, ValidationError, VintedClient, ItemsClient as VintedItemsClient, ReferenceClient as VintedReferenceClient, SearchClient as VintedSearchClient, UsersClient2 as VintedUsersClient, WebClient, WebSocketStreamError, collectAll, verifyWebhookSignature };
5118
+ export { AccountRestrictedError, AmazonClient, ListingsClient as AmazonListingsClient, ProductsClient2 as AmazonProductsClient, ReferenceClient2 as AmazonReferenceClient, SearchClient4 as AmazonSearchClient, SellersClient as AmazonSellersClient, AuthenticationError, CommunitiesClient, ConflictError, CategoriesClient as EbayCategoriesClient, EbayClient, ItemsClient2 as EbayItemsClient, ReferenceClient5 as EbayReferenceClient, SearchClient7 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, InsufficientCreditsError, ListsClient, NotFoundError, RateLimitError, RedditClient, PostsClient as RedditPostsClient, SearchClient3 as RedditSearchClient, SubredditsClient as RedditSubredditsClient, UsersClient3 as RedditUsersClient, ScrapeBadger, ScrapeBadgerError, ServerError, ShopeeClient, ProductsClient3 as ShopeeProductsClient, ReferenceClient3 as ShopeeReferenceClient, ReviewsClient as ShopeeReviewsClient, SearchClient5 as ShopeeSearchClient, SpacesClient, StreamClient, AdsClient as TikTokAdsClient, TikTokClient, HashtagsClient as TikTokHashtagsClient, MusicClient as TikTokMusicClient, ReferenceClient4 as TikTokReferenceClient, SearchClient6 as TikTokSearchClient, TrendingClient as TikTokTrendingClient, UsersClient4 as TikTokUsersClient, VideosClient2 as TikTokVideosClient, TimeoutError, TrendsClient, TweetsClient, TwitterClient, UsersClient, ValidationError, VintedClient, ItemsClient as VintedItemsClient, ReferenceClient as VintedReferenceClient, SearchClient as VintedSearchClient, UsersClient2 as VintedUsersClient, WebClient, WebSocketStreamError, collectAll, verifyWebhookSignature };
4874
5119
  //# sourceMappingURL=index.mjs.map
4875
5120
  //# sourceMappingURL=index.mjs.map