scrapebadger 0.9.0 → 0.11.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
@@ -3902,6 +3902,279 @@ var RedditClient = class {
3902
3902
  }
3903
3903
  };
3904
3904
 
3905
+ // src/amazon/search.ts
3906
+ var SearchClient4 = class {
3907
+ client;
3908
+ constructor(client) {
3909
+ this.client = client;
3910
+ }
3911
+ /**
3912
+ * Search Amazon for products by keyword.
3913
+ *
3914
+ * @param params - Search parameters including query, filters, and pagination.
3915
+ * @returns Search results with rows and pagination metadata.
3916
+ * @throws AuthenticationError - If the API key is invalid.
3917
+ * @throws ValidationError - If the parameters are invalid.
3918
+ */
3919
+ async search(params) {
3920
+ return this.client.request("/v1/amazon/search", {
3921
+ params: {
3922
+ query: params.query,
3923
+ domain: params.domain,
3924
+ page: params.page,
3925
+ sort_by: params.sort_by,
3926
+ category: params.category,
3927
+ min_price: params.min_price,
3928
+ max_price: params.max_price,
3929
+ zip: params.zip,
3930
+ language: params.language
3931
+ }
3932
+ });
3933
+ }
3934
+ /**
3935
+ * Get Amazon keyword autocomplete suggestions.
3936
+ *
3937
+ * @param query - Partial search query string.
3938
+ * @param options - Optional parameters (domain).
3939
+ * @returns Autocomplete suggestions.
3940
+ */
3941
+ async autocomplete(query, options = {}) {
3942
+ return this.client.request("/v1/amazon/autocomplete", {
3943
+ params: { query, domain: options.domain }
3944
+ });
3945
+ }
3946
+ };
3947
+
3948
+ // src/amazon/products.ts
3949
+ var ProductsClient2 = class {
3950
+ client;
3951
+ constructor(client) {
3952
+ this.client = client;
3953
+ }
3954
+ /**
3955
+ * Get full product detail (PDP) for an ASIN.
3956
+ *
3957
+ * @param asin - The product ASIN.
3958
+ * @param options - Optional parameters (domain, zip, language).
3959
+ * @returns Product detail including variants, badges, buybox, and related products.
3960
+ * @throws NotFoundError - If the product doesn't exist.
3961
+ */
3962
+ async get(asin, options = {}) {
3963
+ return this.client.request(
3964
+ `/v1/amazon/products/${asin}`,
3965
+ {
3966
+ params: {
3967
+ domain: options.domain,
3968
+ zip: options.zip,
3969
+ language: options.language
3970
+ }
3971
+ }
3972
+ );
3973
+ }
3974
+ /**
3975
+ * Get all-seller offers (and the buybox winner) for an ASIN.
3976
+ *
3977
+ * @param asin - The product ASIN.
3978
+ * @param options - Optional parameters (domain, zip).
3979
+ * @returns Offers response with the buybox winner and full offer list.
3980
+ */
3981
+ async offers(asin, options = {}) {
3982
+ return this.client.request(
3983
+ `/v1/amazon/products/${asin}/offers`,
3984
+ { params: { domain: options.domain, zip: options.zip } }
3985
+ );
3986
+ }
3987
+ /**
3988
+ * Get product reviews for an ASIN.
3989
+ *
3990
+ * @param asin - The product ASIN.
3991
+ * @param options - Optional parameters (domain, page, sort_by, star, verified_only, media_only).
3992
+ * @returns Reviews response with reviews, aggregate rating, and breakdown.
3993
+ */
3994
+ async reviews(asin, options = {}) {
3995
+ return this.client.request(
3996
+ `/v1/amazon/products/${asin}/reviews`,
3997
+ {
3998
+ params: {
3999
+ domain: options.domain,
4000
+ page: options.page,
4001
+ sort_by: options.sort_by,
4002
+ star: options.star,
4003
+ verified_only: options.verified_only,
4004
+ media_only: options.media_only
4005
+ }
4006
+ }
4007
+ );
4008
+ }
4009
+ };
4010
+
4011
+ // src/amazon/listings.ts
4012
+ var ListingsClient = class {
4013
+ client;
4014
+ constructor(client) {
4015
+ this.client = client;
4016
+ }
4017
+ /**
4018
+ * Get the bestsellers list for a marketplace / category.
4019
+ *
4020
+ * @param options - Optional parameters (domain, category, page).
4021
+ * @returns Bestsellers response with ranked products and pagination.
4022
+ */
4023
+ async bestsellers(options = {}) {
4024
+ return this.client.request("/v1/amazon/bestsellers", {
4025
+ params: {
4026
+ domain: options.domain,
4027
+ category: options.category,
4028
+ page: options.page
4029
+ }
4030
+ });
4031
+ }
4032
+ /**
4033
+ * Get the new-releases list for a marketplace / category.
4034
+ *
4035
+ * @param options - Optional parameters (domain, category, page).
4036
+ * @returns New-releases response with ranked products and pagination.
4037
+ */
4038
+ async newReleases(options = {}) {
4039
+ return this.client.request("/v1/amazon/new-releases", {
4040
+ params: {
4041
+ domain: options.domain,
4042
+ category: options.category,
4043
+ page: options.page
4044
+ }
4045
+ });
4046
+ }
4047
+ /**
4048
+ * Get current deals for a marketplace / category.
4049
+ *
4050
+ * @param options - Optional parameters (domain, category, page).
4051
+ * @returns Deals response with deal rows and pagination.
4052
+ */
4053
+ async deals(options = {}) {
4054
+ return this.client.request("/v1/amazon/deals", {
4055
+ params: {
4056
+ domain: options.domain,
4057
+ category: options.category,
4058
+ page: options.page
4059
+ }
4060
+ });
4061
+ }
4062
+ /**
4063
+ * Browse a category / department by browse-node ID.
4064
+ *
4065
+ * @param params - Parameters including the required node ID.
4066
+ * @returns Category response with result rows and pagination.
4067
+ */
4068
+ async category(params) {
4069
+ return this.client.request("/v1/amazon/category", {
4070
+ params: {
4071
+ node: params.node,
4072
+ domain: params.domain,
4073
+ page: params.page,
4074
+ sort_by: params.sort_by
4075
+ }
4076
+ });
4077
+ }
4078
+ };
4079
+
4080
+ // src/amazon/sellers.ts
4081
+ var SellersClient = class {
4082
+ client;
4083
+ constructor(client) {
4084
+ this.client = client;
4085
+ }
4086
+ /**
4087
+ * Get a seller's profile and ratings.
4088
+ *
4089
+ * @param sellerId - The seller ID.
4090
+ * @param options - Optional parameters (domain).
4091
+ * @returns Seller profile response.
4092
+ * @throws NotFoundError - If the seller doesn't exist.
4093
+ */
4094
+ async get(sellerId, options = {}) {
4095
+ return this.client.request(
4096
+ `/v1/amazon/sellers/${sellerId}`,
4097
+ { params: { domain: options.domain } }
4098
+ );
4099
+ }
4100
+ /**
4101
+ * Get a seller's storefront listings.
4102
+ *
4103
+ * @param sellerId - The seller ID.
4104
+ * @param options - Optional parameters (domain, page).
4105
+ * @returns Seller products response with result rows and pagination.
4106
+ */
4107
+ async products(sellerId, options = {}) {
4108
+ return this.client.request(
4109
+ `/v1/amazon/sellers/${sellerId}/products`,
4110
+ { params: { domain: options.domain, page: options.page } }
4111
+ );
4112
+ }
4113
+ /**
4114
+ * Get buyer feedback entries for a seller.
4115
+ *
4116
+ * @param sellerId - The seller ID.
4117
+ * @param options - Optional parameters (domain, page).
4118
+ * @returns Seller feedback response with feedback entries and pagination.
4119
+ */
4120
+ async feedback(sellerId, options = {}) {
4121
+ return this.client.request(
4122
+ `/v1/amazon/sellers/${sellerId}/feedback`,
4123
+ { params: { domain: options.domain, page: options.page } }
4124
+ );
4125
+ }
4126
+ };
4127
+
4128
+ // src/amazon/reference.ts
4129
+ var ReferenceClient2 = class {
4130
+ client;
4131
+ constructor(client) {
4132
+ this.client = client;
4133
+ }
4134
+ /**
4135
+ * Get all supported Amazon marketplaces.
4136
+ *
4137
+ * @returns Markets response with all supported marketplaces.
4138
+ */
4139
+ async markets() {
4140
+ return this.client.request("/v1/amazon/markets");
4141
+ }
4142
+ /**
4143
+ * Get the reference department / category aliases.
4144
+ *
4145
+ * @returns Categories response with all category aliases.
4146
+ */
4147
+ async categories() {
4148
+ return this.client.request("/v1/amazon/categories");
4149
+ }
4150
+ };
4151
+
4152
+ // src/amazon/client.ts
4153
+ var AmazonClient = class {
4154
+ /** Client for keyword search and autocomplete */
4155
+ search;
4156
+ /** Client for product detail, offers, and reviews */
4157
+ products;
4158
+ /** Client for bestsellers, new releases, deals, and category browse */
4159
+ listings;
4160
+ /** Client for seller profile, products, and feedback */
4161
+ sellers;
4162
+ /** Client for reference data (markets, categories) */
4163
+ reference;
4164
+ /**
4165
+ * Create a new Amazon client.
4166
+ *
4167
+ * @param client - The base HTTP client for making requests.
4168
+ */
4169
+ constructor(client) {
4170
+ this.search = new SearchClient4(client);
4171
+ this.products = new ProductsClient2(client);
4172
+ this.listings = new ListingsClient(client);
4173
+ this.sellers = new SellersClient(client);
4174
+ this.reference = new ReferenceClient2(client);
4175
+ }
4176
+ };
4177
+
3905
4178
  // src/client.ts
3906
4179
  var ScrapeBadger = class {
3907
4180
  baseClient;
@@ -3915,6 +4188,8 @@ var ScrapeBadger = class {
3915
4188
  google;
3916
4189
  /** Reddit scraper API client */
3917
4190
  reddit;
4191
+ /** Amazon scraper API client — 14 endpoints */
4192
+ amazon;
3918
4193
  /**
3919
4194
  * Create a new ScrapeBadger client.
3920
4195
  *
@@ -3954,9 +4229,10 @@ var ScrapeBadger = class {
3954
4229
  this.vinted = new VintedClient(this.baseClient);
3955
4230
  this.google = new GoogleClient(this.baseClient);
3956
4231
  this.reddit = new RedditClient(this.baseClient);
4232
+ this.amazon = new AmazonClient(this.baseClient);
3957
4233
  }
3958
4234
  };
3959
4235
 
3960
- export { AccountRestrictedError, 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, SpacesClient, StreamClient, TimeoutError, TrendsClient, TweetsClient, TwitterClient, UsersClient, ValidationError, VintedClient, ItemsClient as VintedItemsClient, ReferenceClient as VintedReferenceClient, SearchClient as VintedSearchClient, UsersClient2 as VintedUsersClient, WebClient, WebSocketStreamError, collectAll, verifyWebhookSignature };
4236
+ 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, SpacesClient, StreamClient, TimeoutError, TrendsClient, TweetsClient, TwitterClient, UsersClient, ValidationError, VintedClient, ItemsClient as VintedItemsClient, ReferenceClient as VintedReferenceClient, SearchClient as VintedSearchClient, UsersClient2 as VintedUsersClient, WebClient, WebSocketStreamError, collectAll, verifyWebhookSignature };
3961
4237
  //# sourceMappingURL=index.mjs.map
3962
4238
  //# sourceMappingURL=index.mjs.map