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.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { EventEmitter } from 'events';
|
|
|
3
3
|
import WebSocket from 'ws';
|
|
4
4
|
|
|
5
5
|
// src/internal/version.ts
|
|
6
|
-
var SDK_VERSION = "0.
|
|
6
|
+
var SDK_VERSION = "0.42.0";
|
|
7
7
|
|
|
8
8
|
// src/internal/exceptions.ts
|
|
9
9
|
var ScrapeBadgerError = class _ScrapeBadgerError extends Error {
|
|
@@ -5744,6 +5744,44 @@ var SearchClient8 = class {
|
|
|
5744
5744
|
}
|
|
5745
5745
|
});
|
|
5746
5746
|
}
|
|
5747
|
+
/**
|
|
5748
|
+
* Search an eBay marketplace by image — eBay's own visual search.
|
|
5749
|
+
*
|
|
5750
|
+
* This is what eBay's camera icon does: the image is uploaded to eBay, and
|
|
5751
|
+
* the handle it answers with is searched like a keyword. Supply the picture
|
|
5752
|
+
* either as `image_url` (downloaded for you) or as `image_base64`; exactly
|
|
5753
|
+
* one of the two is required.
|
|
5754
|
+
*
|
|
5755
|
+
* There is no `sort_by` — eBay ignores sorting on a visual results page.
|
|
5756
|
+
*
|
|
5757
|
+
* @param params - The image plus the usual listing filters and pagination.
|
|
5758
|
+
* @returns Search results (with `query: null`), facets, and pagination.
|
|
5759
|
+
* @throws Error - If neither or both of `image_url` / `image_base64` are given.
|
|
5760
|
+
* @throws ValidationError - If eBay cannot read the image.
|
|
5761
|
+
*/
|
|
5762
|
+
async searchByImage(params) {
|
|
5763
|
+
if (Boolean(params.image_url) === Boolean(params.image_base64)) {
|
|
5764
|
+
throw new Error("provide exactly one of image_url or image_base64");
|
|
5765
|
+
}
|
|
5766
|
+
return this.client.request("/v1/ebay/search/by-image", {
|
|
5767
|
+
method: "POST",
|
|
5768
|
+
body: {
|
|
5769
|
+
image_url: params.image_url,
|
|
5770
|
+
image_base64: params.image_base64,
|
|
5771
|
+
domain: params.domain,
|
|
5772
|
+
category_id: params.category_id,
|
|
5773
|
+
page: params.page,
|
|
5774
|
+
per_page: params.per_page,
|
|
5775
|
+
condition: params.condition,
|
|
5776
|
+
buying_format: params.buying_format,
|
|
5777
|
+
min_price: params.min_price,
|
|
5778
|
+
max_price: params.max_price,
|
|
5779
|
+
free_shipping: params.free_shipping,
|
|
5780
|
+
location: params.location,
|
|
5781
|
+
language: params.language
|
|
5782
|
+
}
|
|
5783
|
+
});
|
|
5784
|
+
}
|
|
5747
5785
|
/**
|
|
5748
5786
|
* Search completed / sold listings — eBay's sold-price history.
|
|
5749
5787
|
*
|
|
@@ -5919,7 +5957,7 @@ var ReferenceClient5 = class {
|
|
|
5919
5957
|
|
|
5920
5958
|
// src/ebay/client.ts
|
|
5921
5959
|
var EbayClient = class {
|
|
5922
|
-
/** Client for active search, completed/sold search, and autocomplete */
|
|
5960
|
+
/** Client for active search, search by image, completed/sold search, and autocomplete */
|
|
5923
5961
|
search;
|
|
5924
5962
|
/** Client for item detail and catalog product reviews */
|
|
5925
5963
|
items;
|