scrapebadger 0.62.0 → 0.64.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.62.0";
6
+ var SDK_VERSION = "0.64.0";
7
7
 
8
8
  // src/internal/exceptions.ts
9
9
  var ScrapeBadgerError = class _ScrapeBadgerError extends Error {
@@ -3028,6 +3028,42 @@ var ReferenceClient = class {
3028
3028
  }
3029
3029
  });
3030
3030
  }
3031
+ /**
3032
+ * Get Vinted's A-Z directory of popular brands.
3033
+ *
3034
+ * Returns about 240 of the most popular brands whose name starts with
3035
+ * `letter`, with ID, slug and item count. Loop `letter` over A-Z and "0"
3036
+ * (digits) for a reference list of roughly 6,000 brand IDs. `brands()`
3037
+ * stops at 10 matches per keyword. 1 credit per call.
3038
+ *
3039
+ * @param options - Optional parameters.
3040
+ * @param options.letter - First letter of the brand name, "A"-"Z", or "0"
3041
+ * for digits. Omit for the most popular brands overall.
3042
+ * @param options.market - Market code (default: "fr").
3043
+ * @returns Brands for that letter (no pagination; one page per letter).
3044
+ *
3045
+ * @example
3046
+ * ```typescript
3047
+ * const ids = new Map<string, number>();
3048
+ * for (const letter of [..."ABCDEFGHIJKLMNOPQRSTUVWXYZ", "0"]) {
3049
+ * const { brands } = await client.vinted.reference.popularBrands({ letter, market: "uk" });
3050
+ * for (const brand of brands) ids.set(brand.title, brand.id);
3051
+ * }
3052
+ * ```
3053
+ */
3054
+ async popularBrands(options = {}) {
3055
+ const response = await this.client.request(
3056
+ "/v1/vinted/mobile/popular-brands",
3057
+ {
3058
+ method: "POST",
3059
+ body: {
3060
+ market: options.market ?? "fr",
3061
+ parameters: options.letter ? { letter: options.letter } : {}
3062
+ }
3063
+ }
3064
+ );
3065
+ return { brands: response.data?.brands ?? [], pagination: null };
3066
+ }
3031
3067
  /**
3032
3068
  * Get available colors for a market.
3033
3069
  *
@@ -6171,13 +6207,20 @@ var SearchClient8 = class {
6171
6207
  /**
6172
6208
  * Search completed / sold listings — eBay's sold-price history.
6173
6209
  *
6174
- * @param params - Search parameters including query, filters, and pagination.
6210
+ * Pass `query`, `seller` or both. `seller` alone pages through everything
6211
+ * that seller sold, e.g. `completed({ seller: "musicmagpie", domain: "co.uk" })`.
6212
+ *
6213
+ * @param params - Search parameters including query, seller, filters, and pagination.
6175
6214
  * @returns Search results (with `sold: true`), facets, and pagination.
6176
6215
  */
6177
6216
  async completed(params) {
6217
+ if (!params.query && !params.seller) {
6218
+ throw new Error("Pass query, seller, or both.");
6219
+ }
6178
6220
  return this.client.request("/v1/ebay/completed", {
6179
6221
  params: {
6180
6222
  query: params.query,
6223
+ seller: params.seller,
6181
6224
  domain: params.domain,
6182
6225
  category_id: params.category_id,
6183
6226
  page: params.page,