scrapebadger 0.41.0 → 0.43.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/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.41.0";
6
+ var SDK_VERSION = "0.43.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;
@@ -8497,6 +8535,9 @@ var AskClient = class {
8497
8535
  * @param params.prompt - The prompt to send (max 4096 characters).
8498
8536
  * @param params.country - ISO-3166 alpha-2 egress country (default: "US").
8499
8537
  * @param params.web_search - "auto", "force", or "off" (default: "auto").
8538
+ * @param params.image_url - Public image URL to attach; ChatGPT answers about
8539
+ * the picture. It will NOT generate one — anonymous chatgpt.com requires a login
8540
+ * for that. Allow 90-150s for an image ask.
8500
8541
  * @returns The answer, its citations, and the full retrieved search set.
8501
8542
  *
8502
8543
  * @example
@@ -8517,7 +8558,8 @@ var AskClient = class {
8517
8558
  params: {
8518
8559
  prompt: params.prompt,
8519
8560
  country: params.country,
8520
- web_search: params.web_search
8561
+ web_search: params.web_search,
8562
+ image_url: params.image_url
8521
8563
  }
8522
8564
  });
8523
8565
  }
@@ -8651,6 +8693,9 @@ var AskClient2 = class {
8651
8693
  * @param params.prompt - The prompt to send (max 4096 characters).
8652
8694
  * @param params.country - ISO-3166 alpha-2 egress country (default: "US").
8653
8695
  * @param params.web_search - "auto", "force", or "off" (default: "auto").
8696
+ * @param params.image_url - Public image URL to attach; Gemini answers about
8697
+ * the picture. It will NOT generate one — anonymous gemini.google.com requires a login
8698
+ * for that. Allow 90-150s for an image ask.
8654
8699
  * @returns The answer, its citations, and the full retrieved search set.
8655
8700
  *
8656
8701
  * @example
@@ -8671,7 +8716,8 @@ var AskClient2 = class {
8671
8716
  params: {
8672
8717
  prompt: params.prompt,
8673
8718
  country: params.country,
8674
- web_search: params.web_search
8719
+ web_search: params.web_search,
8720
+ image_url: params.image_url
8675
8721
  }
8676
8722
  });
8677
8723
  }