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