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/README.md +1 -0
- package/dist/index.d.cts +806 -76
- package/dist/index.d.ts +806 -76
- package/dist/index.js +251 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +246 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4812,6 +4812,248 @@ var TikTokClient = class {
|
|
|
4812
4812
|
}
|
|
4813
4813
|
};
|
|
4814
4814
|
|
|
4815
|
+
// src/ebay/search.ts
|
|
4816
|
+
var SearchClient7 = class {
|
|
4817
|
+
client;
|
|
4818
|
+
constructor(client) {
|
|
4819
|
+
this.client = client;
|
|
4820
|
+
}
|
|
4821
|
+
/**
|
|
4822
|
+
* Search an eBay marketplace for active listings.
|
|
4823
|
+
*
|
|
4824
|
+
* @param params - Search parameters including query, filters, and pagination.
|
|
4825
|
+
* @returns Search results with cards, facets, and pagination metadata.
|
|
4826
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
4827
|
+
* @throws ValidationError - If the parameters are invalid.
|
|
4828
|
+
*/
|
|
4829
|
+
async search(params) {
|
|
4830
|
+
return this.client.request("/v1/ebay/search", {
|
|
4831
|
+
params: {
|
|
4832
|
+
query: params.query,
|
|
4833
|
+
domain: params.domain,
|
|
4834
|
+
category_id: params.category_id,
|
|
4835
|
+
page: params.page,
|
|
4836
|
+
per_page: params.per_page,
|
|
4837
|
+
sort_by: params.sort_by,
|
|
4838
|
+
condition: params.condition,
|
|
4839
|
+
buying_format: params.buying_format,
|
|
4840
|
+
min_price: params.min_price,
|
|
4841
|
+
max_price: params.max_price,
|
|
4842
|
+
free_shipping: params.free_shipping
|
|
4843
|
+
}
|
|
4844
|
+
});
|
|
4845
|
+
}
|
|
4846
|
+
/**
|
|
4847
|
+
* Search completed / sold listings — eBay's sold-price history.
|
|
4848
|
+
*
|
|
4849
|
+
* @param params - Search parameters including query, filters, and pagination.
|
|
4850
|
+
* @returns Search results (with `sold: true`), facets, and pagination.
|
|
4851
|
+
*/
|
|
4852
|
+
async completed(params) {
|
|
4853
|
+
return this.client.request("/v1/ebay/completed", {
|
|
4854
|
+
params: {
|
|
4855
|
+
query: params.query,
|
|
4856
|
+
domain: params.domain,
|
|
4857
|
+
category_id: params.category_id,
|
|
4858
|
+
page: params.page,
|
|
4859
|
+
per_page: params.per_page,
|
|
4860
|
+
sort_by: params.sort_by,
|
|
4861
|
+
condition: params.condition,
|
|
4862
|
+
min_price: params.min_price,
|
|
4863
|
+
max_price: params.max_price
|
|
4864
|
+
}
|
|
4865
|
+
});
|
|
4866
|
+
}
|
|
4867
|
+
/**
|
|
4868
|
+
* Get eBay keyword autocomplete suggestions.
|
|
4869
|
+
*
|
|
4870
|
+
* @param query - Partial search query prefix.
|
|
4871
|
+
* @param options - Optional parameters (domain).
|
|
4872
|
+
* @returns Autocomplete suggestions.
|
|
4873
|
+
*/
|
|
4874
|
+
async autocomplete(query, options = {}) {
|
|
4875
|
+
return this.client.request("/v1/ebay/autocomplete", {
|
|
4876
|
+
params: { query, domain: options.domain }
|
|
4877
|
+
});
|
|
4878
|
+
}
|
|
4879
|
+
};
|
|
4880
|
+
|
|
4881
|
+
// src/ebay/items.ts
|
|
4882
|
+
var ItemsClient2 = class {
|
|
4883
|
+
client;
|
|
4884
|
+
constructor(client) {
|
|
4885
|
+
this.client = client;
|
|
4886
|
+
}
|
|
4887
|
+
/**
|
|
4888
|
+
* Get a single eBay listing's full detail.
|
|
4889
|
+
*
|
|
4890
|
+
* @param itemId - The eBay item id.
|
|
4891
|
+
* @param options - Optional parameters (domain).
|
|
4892
|
+
* @returns Item detail including specifics, shipping, and seller summary.
|
|
4893
|
+
* @throws NotFoundError - If the item doesn't exist.
|
|
4894
|
+
*/
|
|
4895
|
+
async get(itemId, options = {}) {
|
|
4896
|
+
return this.client.request(
|
|
4897
|
+
`/v1/ebay/items/${itemId}`,
|
|
4898
|
+
{ params: { domain: options.domain } }
|
|
4899
|
+
);
|
|
4900
|
+
}
|
|
4901
|
+
/**
|
|
4902
|
+
* Get the catalog product reviews shown on an eBay listing.
|
|
4903
|
+
*
|
|
4904
|
+
* @param itemId - The eBay item id.
|
|
4905
|
+
* @param options - Optional parameters (domain, page, productId).
|
|
4906
|
+
* @returns Reviews response with reviews, aggregate rating, and histogram.
|
|
4907
|
+
*/
|
|
4908
|
+
async reviews(itemId, options = {}) {
|
|
4909
|
+
return this.client.request(
|
|
4910
|
+
`/v1/ebay/items/${itemId}/reviews`,
|
|
4911
|
+
{
|
|
4912
|
+
params: {
|
|
4913
|
+
domain: options.domain,
|
|
4914
|
+
page: options.page,
|
|
4915
|
+
product_id: options.productId
|
|
4916
|
+
}
|
|
4917
|
+
}
|
|
4918
|
+
);
|
|
4919
|
+
}
|
|
4920
|
+
};
|
|
4921
|
+
|
|
4922
|
+
// src/ebay/sellers.ts
|
|
4923
|
+
var SellersClient2 = class {
|
|
4924
|
+
client;
|
|
4925
|
+
constructor(client) {
|
|
4926
|
+
this.client = client;
|
|
4927
|
+
}
|
|
4928
|
+
/**
|
|
4929
|
+
* Get an eBay seller's public profile.
|
|
4930
|
+
*
|
|
4931
|
+
* @param username - The seller username.
|
|
4932
|
+
* @param options - Optional parameters (domain).
|
|
4933
|
+
* @returns Seller profile response.
|
|
4934
|
+
* @throws NotFoundError - If the seller doesn't exist.
|
|
4935
|
+
*/
|
|
4936
|
+
async get(username, options = {}) {
|
|
4937
|
+
return this.client.request(
|
|
4938
|
+
`/v1/ebay/sellers/${username}`,
|
|
4939
|
+
{ params: { domain: options.domain } }
|
|
4940
|
+
);
|
|
4941
|
+
}
|
|
4942
|
+
/**
|
|
4943
|
+
* List the active listings of a single eBay seller.
|
|
4944
|
+
*
|
|
4945
|
+
* @param username - The seller username.
|
|
4946
|
+
* @param options - Optional parameters (domain, query, page, per_page).
|
|
4947
|
+
* @returns Seller items response with result cards and pagination.
|
|
4948
|
+
*/
|
|
4949
|
+
async items(username, options = {}) {
|
|
4950
|
+
return this.client.request(
|
|
4951
|
+
`/v1/ebay/sellers/${username}/items`,
|
|
4952
|
+
{
|
|
4953
|
+
params: {
|
|
4954
|
+
domain: options.domain,
|
|
4955
|
+
query: options.query,
|
|
4956
|
+
page: options.page,
|
|
4957
|
+
per_page: options.per_page
|
|
4958
|
+
}
|
|
4959
|
+
}
|
|
4960
|
+
);
|
|
4961
|
+
}
|
|
4962
|
+
/**
|
|
4963
|
+
* Get a seller's recent feedback comments.
|
|
4964
|
+
*
|
|
4965
|
+
* @param username - The seller username.
|
|
4966
|
+
* @param options - Optional parameters (domain, page).
|
|
4967
|
+
* @returns Seller feedback response with feedback entries and pagination.
|
|
4968
|
+
*/
|
|
4969
|
+
async feedback(username, options = {}) {
|
|
4970
|
+
return this.client.request(
|
|
4971
|
+
`/v1/ebay/sellers/${username}/feedback`,
|
|
4972
|
+
{ params: { domain: options.domain, page: options.page } }
|
|
4973
|
+
);
|
|
4974
|
+
}
|
|
4975
|
+
};
|
|
4976
|
+
|
|
4977
|
+
// src/ebay/categories.ts
|
|
4978
|
+
var CategoriesClient = class {
|
|
4979
|
+
client;
|
|
4980
|
+
constructor(client) {
|
|
4981
|
+
this.client = client;
|
|
4982
|
+
}
|
|
4983
|
+
/**
|
|
4984
|
+
* List active listings within an eBay category.
|
|
4985
|
+
*
|
|
4986
|
+
* @param categoryId - The eBay category id.
|
|
4987
|
+
* @param options - Optional parameters (domain, page, per_page, sort_by, min_price, max_price).
|
|
4988
|
+
* @returns Category response with result cards, facets, and pagination.
|
|
4989
|
+
*/
|
|
4990
|
+
async browse(categoryId, options = {}) {
|
|
4991
|
+
return this.client.request(
|
|
4992
|
+
`/v1/ebay/categories/${categoryId}/items`,
|
|
4993
|
+
{
|
|
4994
|
+
params: {
|
|
4995
|
+
domain: options.domain,
|
|
4996
|
+
page: options.page,
|
|
4997
|
+
per_page: options.per_page,
|
|
4998
|
+
sort_by: options.sort_by,
|
|
4999
|
+
min_price: options.min_price,
|
|
5000
|
+
max_price: options.max_price
|
|
5001
|
+
}
|
|
5002
|
+
}
|
|
5003
|
+
);
|
|
5004
|
+
}
|
|
5005
|
+
/**
|
|
5006
|
+
* List eBay's reference top-level category ids.
|
|
5007
|
+
*
|
|
5008
|
+
* @returns Categories response with all category aliases.
|
|
5009
|
+
*/
|
|
5010
|
+
async list() {
|
|
5011
|
+
return this.client.request("/v1/ebay/categories");
|
|
5012
|
+
}
|
|
5013
|
+
};
|
|
5014
|
+
|
|
5015
|
+
// src/ebay/reference.ts
|
|
5016
|
+
var ReferenceClient5 = class {
|
|
5017
|
+
client;
|
|
5018
|
+
constructor(client) {
|
|
5019
|
+
this.client = client;
|
|
5020
|
+
}
|
|
5021
|
+
/**
|
|
5022
|
+
* Get all supported eBay marketplaces.
|
|
5023
|
+
*
|
|
5024
|
+
* @returns Markets response with all supported marketplaces.
|
|
5025
|
+
*/
|
|
5026
|
+
async markets() {
|
|
5027
|
+
return this.client.request("/v1/ebay/markets");
|
|
5028
|
+
}
|
|
5029
|
+
};
|
|
5030
|
+
|
|
5031
|
+
// src/ebay/client.ts
|
|
5032
|
+
var EbayClient = class {
|
|
5033
|
+
/** Client for active search, completed/sold search, and autocomplete */
|
|
5034
|
+
search;
|
|
5035
|
+
/** Client for item detail and catalog product reviews */
|
|
5036
|
+
items;
|
|
5037
|
+
/** Client for seller profile, items, and feedback */
|
|
5038
|
+
sellers;
|
|
5039
|
+
/** Client for category browse and the reference category list */
|
|
5040
|
+
categories;
|
|
5041
|
+
/** Client for reference data (markets) */
|
|
5042
|
+
reference;
|
|
5043
|
+
/**
|
|
5044
|
+
* Create a new eBay client.
|
|
5045
|
+
*
|
|
5046
|
+
* @param client - The base HTTP client for making requests.
|
|
5047
|
+
*/
|
|
5048
|
+
constructor(client) {
|
|
5049
|
+
this.search = new SearchClient7(client);
|
|
5050
|
+
this.items = new ItemsClient2(client);
|
|
5051
|
+
this.sellers = new SellersClient2(client);
|
|
5052
|
+
this.categories = new CategoriesClient(client);
|
|
5053
|
+
this.reference = new ReferenceClient5(client);
|
|
5054
|
+
}
|
|
5055
|
+
};
|
|
5056
|
+
|
|
4815
5057
|
// src/client.ts
|
|
4816
5058
|
var ScrapeBadger = class {
|
|
4817
5059
|
baseClient;
|
|
@@ -4831,6 +5073,8 @@ var ScrapeBadger = class {
|
|
|
4831
5073
|
shopee;
|
|
4832
5074
|
/** TikTok scraper API client — 26 endpoints */
|
|
4833
5075
|
tiktok;
|
|
5076
|
+
/** eBay scraper API client — 12 endpoints across 18 markets */
|
|
5077
|
+
ebay;
|
|
4834
5078
|
/**
|
|
4835
5079
|
* Create a new ScrapeBadger client.
|
|
4836
5080
|
*
|
|
@@ -4873,6 +5117,7 @@ var ScrapeBadger = class {
|
|
|
4873
5117
|
this.amazon = new AmazonClient(this.baseClient);
|
|
4874
5118
|
this.shopee = new ShopeeClient(this.baseClient);
|
|
4875
5119
|
this.tiktok = new TikTokClient(this.baseClient);
|
|
5120
|
+
this.ebay = new EbayClient(this.baseClient);
|
|
4876
5121
|
}
|
|
4877
5122
|
};
|
|
4878
5123
|
|
|
@@ -4886,6 +5131,12 @@ exports.AmazonSellersClient = SellersClient;
|
|
|
4886
5131
|
exports.AuthenticationError = AuthenticationError;
|
|
4887
5132
|
exports.CommunitiesClient = CommunitiesClient;
|
|
4888
5133
|
exports.ConflictError = ConflictError;
|
|
5134
|
+
exports.EbayCategoriesClient = CategoriesClient;
|
|
5135
|
+
exports.EbayClient = EbayClient;
|
|
5136
|
+
exports.EbayItemsClient = ItemsClient2;
|
|
5137
|
+
exports.EbayReferenceClient = ReferenceClient5;
|
|
5138
|
+
exports.EbaySearchClient = SearchClient7;
|
|
5139
|
+
exports.EbaySellersClient = SellersClient2;
|
|
4889
5140
|
exports.GeoClient = GeoClient;
|
|
4890
5141
|
exports.GoogleAiModeClient = AiModeClient;
|
|
4891
5142
|
exports.GoogleAutocompleteClient = AutocompleteClient;
|