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