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