scrapebadger 0.40.1 → 0.42.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 -1
- package/dist/index.d.cts +98 -7
- package/dist/index.d.ts +98 -7
- package/dist/index.js +40 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
9
9
|
var WebSocket__default = /*#__PURE__*/_interopDefault(WebSocket);
|
|
10
10
|
|
|
11
11
|
// src/internal/version.ts
|
|
12
|
-
var SDK_VERSION = "0.
|
|
12
|
+
var SDK_VERSION = "0.42.0";
|
|
13
13
|
|
|
14
14
|
// src/internal/exceptions.ts
|
|
15
15
|
var ScrapeBadgerError = class _ScrapeBadgerError extends Error {
|
|
@@ -5750,6 +5750,44 @@ var SearchClient8 = class {
|
|
|
5750
5750
|
}
|
|
5751
5751
|
});
|
|
5752
5752
|
}
|
|
5753
|
+
/**
|
|
5754
|
+
* Search an eBay marketplace by image — eBay's own visual search.
|
|
5755
|
+
*
|
|
5756
|
+
* This is what eBay's camera icon does: the image is uploaded to eBay, and
|
|
5757
|
+
* the handle it answers with is searched like a keyword. Supply the picture
|
|
5758
|
+
* either as `image_url` (downloaded for you) or as `image_base64`; exactly
|
|
5759
|
+
* one of the two is required.
|
|
5760
|
+
*
|
|
5761
|
+
* There is no `sort_by` — eBay ignores sorting on a visual results page.
|
|
5762
|
+
*
|
|
5763
|
+
* @param params - The image plus the usual listing filters and pagination.
|
|
5764
|
+
* @returns Search results (with `query: null`), facets, and pagination.
|
|
5765
|
+
* @throws Error - If neither or both of `image_url` / `image_base64` are given.
|
|
5766
|
+
* @throws ValidationError - If eBay cannot read the image.
|
|
5767
|
+
*/
|
|
5768
|
+
async searchByImage(params) {
|
|
5769
|
+
if (Boolean(params.image_url) === Boolean(params.image_base64)) {
|
|
5770
|
+
throw new Error("provide exactly one of image_url or image_base64");
|
|
5771
|
+
}
|
|
5772
|
+
return this.client.request("/v1/ebay/search/by-image", {
|
|
5773
|
+
method: "POST",
|
|
5774
|
+
body: {
|
|
5775
|
+
image_url: params.image_url,
|
|
5776
|
+
image_base64: params.image_base64,
|
|
5777
|
+
domain: params.domain,
|
|
5778
|
+
category_id: params.category_id,
|
|
5779
|
+
page: params.page,
|
|
5780
|
+
per_page: params.per_page,
|
|
5781
|
+
condition: params.condition,
|
|
5782
|
+
buying_format: params.buying_format,
|
|
5783
|
+
min_price: params.min_price,
|
|
5784
|
+
max_price: params.max_price,
|
|
5785
|
+
free_shipping: params.free_shipping,
|
|
5786
|
+
location: params.location,
|
|
5787
|
+
language: params.language
|
|
5788
|
+
}
|
|
5789
|
+
});
|
|
5790
|
+
}
|
|
5753
5791
|
/**
|
|
5754
5792
|
* Search completed / sold listings — eBay's sold-price history.
|
|
5755
5793
|
*
|
|
@@ -5925,7 +5963,7 @@ var ReferenceClient5 = class {
|
|
|
5925
5963
|
|
|
5926
5964
|
// src/ebay/client.ts
|
|
5927
5965
|
var EbayClient = class {
|
|
5928
|
-
/** Client for active search, completed/sold search, and autocomplete */
|
|
5966
|
+
/** Client for active search, search by image, completed/sold search, and autocomplete */
|
|
5929
5967
|
search;
|
|
5930
5968
|
/** Client for item detail and catalog product reviews */
|
|
5931
5969
|
items;
|