scrapebadger 0.82.0 → 0.83.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.cjs +38 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +48 -17
- package/dist/index.d.ts +48 -17
- package/dist/index.mjs +38 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1361,6 +1361,7 @@ interface MapsReviewsParams {
|
|
|
1361
1361
|
interface MapsPhotosParams {
|
|
1362
1362
|
data_id: string;
|
|
1363
1363
|
hl?: string;
|
|
1364
|
+
/** Accepted for compatibility; the photos endpoint returns a single page. */
|
|
1364
1365
|
next_page_token?: string;
|
|
1365
1366
|
}
|
|
1366
1367
|
interface MapsPostsParams {
|
|
@@ -2470,10 +2471,12 @@ declare class MapsClient {
|
|
|
2470
2471
|
* Get full place detail by `place_id` or `data_id`.
|
|
2471
2472
|
*
|
|
2472
2473
|
* Returns title, address, phone, website, GPS, rating, reviews_count,
|
|
2473
|
-
*
|
|
2474
|
-
* (
|
|
2475
|
-
*
|
|
2476
|
-
*
|
|
2474
|
+
* categories, extensions (amenity groups such as accessibility),
|
|
2475
|
+
* opening hours (`open_state`, today's `hours`, and `operating_hours`
|
|
2476
|
+
* for the coming seven days), `price_level` (Google's price per person,
|
|
2477
|
+
* e.g. "฿2,000+"), popular_times, provider_id, `thumbnail`/`image`, and
|
|
2478
|
+
* up to 20 photo URLs. `service_options` is null: Google no longer
|
|
2479
|
+
* exposes those flags to signed-out clients.
|
|
2477
2480
|
*/
|
|
2478
2481
|
place(params: MapsPlaceParams): Promise<GoogleResponse>;
|
|
2479
2482
|
/**
|
|
@@ -2485,12 +2488,13 @@ declare class MapsClient {
|
|
|
2485
2488
|
*/
|
|
2486
2489
|
reviews(params: MapsReviewsParams): Promise<GoogleResponse>;
|
|
2487
2490
|
/**
|
|
2488
|
-
* Get photos for a place
|
|
2491
|
+
* Get photos for a place.
|
|
2489
2492
|
*
|
|
2490
|
-
* Returns
|
|
2491
|
-
*
|
|
2492
|
-
*
|
|
2493
|
-
* one
|
|
2493
|
+
* Returns the photos Google exposes to signed-out clients (usually the
|
|
2494
|
+
* first 8 of the gallery) as `thumbnail` and `image` URLs.
|
|
2495
|
+
* `pagination.total_results` is the place's total photo count on Google;
|
|
2496
|
+
* there is one page (`next` is null). To get another size, replace a
|
|
2497
|
+
* URL's `=w..-h..-k-no` suffix and keep its path.
|
|
2494
2498
|
*/
|
|
2495
2499
|
photos(params: MapsPhotosParams): Promise<GoogleResponse>;
|
|
2496
2500
|
/** Get business posts (promotional updates, announcements) for a place. */
|
|
@@ -19255,7 +19259,10 @@ interface WallapopAutocompleteResponse {
|
|
|
19255
19259
|
}
|
|
19256
19260
|
/** One category (recursive tree node). */
|
|
19257
19261
|
interface WallapopCategory {
|
|
19258
|
-
/**
|
|
19262
|
+
/**
|
|
19263
|
+
* Category id — a top-level id is usable as the search `categoryId`,
|
|
19264
|
+
* a nested one in `subcategoryIds`.
|
|
19265
|
+
*/
|
|
19259
19266
|
id: number;
|
|
19260
19267
|
/** Localised category name. */
|
|
19261
19268
|
name: string | null;
|
|
@@ -19324,7 +19331,10 @@ interface WallapopMarketsResponse {
|
|
|
19324
19331
|
type WallapopOrderBy = "most_relevance" | "newest" | "closest" | "price_low_to_high" | "price_high_to_low";
|
|
19325
19332
|
/** Listing-age window for /search. */
|
|
19326
19333
|
type WallapopTimeFilter = "today" | "lastWeek" | "lastMonth";
|
|
19327
|
-
/**
|
|
19334
|
+
/**
|
|
19335
|
+
* Options for the /search endpoint. Needs a query, a `categoryId`,
|
|
19336
|
+
* `subcategoryIds`, or a combination.
|
|
19337
|
+
*/
|
|
19328
19338
|
interface WallapopSearchParams {
|
|
19329
19339
|
/** Market code: es, it, pt (default: "es"). */
|
|
19330
19340
|
market?: string;
|
|
@@ -19336,6 +19346,13 @@ interface WallapopSearchParams {
|
|
|
19336
19346
|
distanceKm?: number;
|
|
19337
19347
|
/** Category id (see `listCategories`). */
|
|
19338
19348
|
categoryId?: number;
|
|
19349
|
+
/**
|
|
19350
|
+
* Subcategory ids from `listCategories` (a category's `subcategories`, at
|
|
19351
|
+
* any depth), e.g. `[9447]` (Smartphones) or `[9447, 10310]`; a listing
|
|
19352
|
+
* matching any of them is returned. Also accepts a comma-separated string.
|
|
19353
|
+
* Works with or without `categoryId`.
|
|
19354
|
+
*/
|
|
19355
|
+
subcategoryIds?: ReadonlyArray<number | string> | string;
|
|
19339
19356
|
/** Minimum price (EUR). */
|
|
19340
19357
|
minPrice?: number;
|
|
19341
19358
|
/** Maximum price (EUR). */
|
|
@@ -19401,6 +19418,8 @@ interface WallapopMarketParams {
|
|
|
19401
19418
|
interface WallapopFiltersParams {
|
|
19402
19419
|
/** Category the filters apply to. */
|
|
19403
19420
|
categoryId?: number;
|
|
19421
|
+
/** Subcategory ids the filters apply to (array or comma-separated string). */
|
|
19422
|
+
subcategoryIds?: ReadonlyArray<number | string> | string;
|
|
19404
19423
|
/** Search text the filters apply to. */
|
|
19405
19424
|
query?: string;
|
|
19406
19425
|
/** Market code: es, it, pt (default: "es"). Localises labels. */
|
|
@@ -19453,15 +19472,26 @@ declare class WallapopClient {
|
|
|
19453
19472
|
/**
|
|
19454
19473
|
* Search Wallapop listings (40 per page).
|
|
19455
19474
|
*
|
|
19456
|
-
* Needs a query, a `categoryId`, or
|
|
19457
|
-
* which case every other parameter is
|
|
19475
|
+
* Needs a query, a `categoryId`, `subcategoryIds`, or a combination —
|
|
19476
|
+
* unless `nextPage` is given, in which case every other parameter is
|
|
19477
|
+
* ignored (the cursor already carries them).
|
|
19458
19478
|
*
|
|
19459
19479
|
* @param query - Search text, e.g. "iphone 14" (optional with `categoryId` or `nextPage`).
|
|
19460
19480
|
* @param options - Optional parameters (market, location/radius, category,
|
|
19461
|
-
* price, condition, brand/model/colour, cars filters,
|
|
19481
|
+
* subcategories, price, condition, brand/model/colour, cars filters,
|
|
19482
|
+
* sort, cursor).
|
|
19462
19483
|
* @returns Search response with matching listings and the next-page cursor.
|
|
19463
19484
|
* @throws AuthenticationError - If the API key is invalid.
|
|
19464
|
-
* @throws ValidationError - If neither a query nor a category is given.
|
|
19485
|
+
* @throws ValidationError - If neither a query nor a category/subcategory is given.
|
|
19486
|
+
*
|
|
19487
|
+
* @example
|
|
19488
|
+
* ```typescript
|
|
19489
|
+
* // Smartphones (9447) under Technology & electronics (24200)
|
|
19490
|
+
* const phones = await client.wallapop.search("iphone", {
|
|
19491
|
+
* categoryId: 24200,
|
|
19492
|
+
* subcategoryIds: [9447],
|
|
19493
|
+
* });
|
|
19494
|
+
* ```
|
|
19465
19495
|
*/
|
|
19466
19496
|
search(query?: string, options?: WallapopSearchParams): Promise<WallapopSearchResponse>;
|
|
19467
19497
|
/**
|
|
@@ -19520,7 +19550,7 @@ declare class WallapopClient {
|
|
|
19520
19550
|
* Get the search filters Wallapop offers for a category and/or query,
|
|
19521
19551
|
* with their option ids.
|
|
19522
19552
|
*
|
|
19523
|
-
* @param options - Optional parameters (categoryId, query, market).
|
|
19553
|
+
* @param options - Optional parameters (categoryId, subcategoryIds, query, market).
|
|
19524
19554
|
* @returns Available filters.
|
|
19525
19555
|
*/
|
|
19526
19556
|
listFilters(options?: WallapopFiltersParams): Promise<WallapopFiltersResponse>;
|
|
@@ -19529,7 +19559,8 @@ declare class WallapopClient {
|
|
|
19529
19559
|
* separately — filters flagged `options_endpoint` in `listFilters`.
|
|
19530
19560
|
*
|
|
19531
19561
|
* @param filterId - Filter id, e.g. "brand".
|
|
19532
|
-
* @param options - Optional parameters (categoryId, query,
|
|
19562
|
+
* @param options - Optional parameters (categoryId, subcategoryIds, query,
|
|
19563
|
+
* market); e.g. `subcategoryIds: [9447]` returns phone brands only.
|
|
19533
19564
|
* @returns The filter's options.
|
|
19534
19565
|
* @throws ValidationError - If the filter id is invalid.
|
|
19535
19566
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1361,6 +1361,7 @@ interface MapsReviewsParams {
|
|
|
1361
1361
|
interface MapsPhotosParams {
|
|
1362
1362
|
data_id: string;
|
|
1363
1363
|
hl?: string;
|
|
1364
|
+
/** Accepted for compatibility; the photos endpoint returns a single page. */
|
|
1364
1365
|
next_page_token?: string;
|
|
1365
1366
|
}
|
|
1366
1367
|
interface MapsPostsParams {
|
|
@@ -2470,10 +2471,12 @@ declare class MapsClient {
|
|
|
2470
2471
|
* Get full place detail by `place_id` or `data_id`.
|
|
2471
2472
|
*
|
|
2472
2473
|
* Returns title, address, phone, website, GPS, rating, reviews_count,
|
|
2473
|
-
*
|
|
2474
|
-
* (
|
|
2475
|
-
*
|
|
2476
|
-
*
|
|
2474
|
+
* categories, extensions (amenity groups such as accessibility),
|
|
2475
|
+
* opening hours (`open_state`, today's `hours`, and `operating_hours`
|
|
2476
|
+
* for the coming seven days), `price_level` (Google's price per person,
|
|
2477
|
+
* e.g. "฿2,000+"), popular_times, provider_id, `thumbnail`/`image`, and
|
|
2478
|
+
* up to 20 photo URLs. `service_options` is null: Google no longer
|
|
2479
|
+
* exposes those flags to signed-out clients.
|
|
2477
2480
|
*/
|
|
2478
2481
|
place(params: MapsPlaceParams): Promise<GoogleResponse>;
|
|
2479
2482
|
/**
|
|
@@ -2485,12 +2488,13 @@ declare class MapsClient {
|
|
|
2485
2488
|
*/
|
|
2486
2489
|
reviews(params: MapsReviewsParams): Promise<GoogleResponse>;
|
|
2487
2490
|
/**
|
|
2488
|
-
* Get photos for a place
|
|
2491
|
+
* Get photos for a place.
|
|
2489
2492
|
*
|
|
2490
|
-
* Returns
|
|
2491
|
-
*
|
|
2492
|
-
*
|
|
2493
|
-
* one
|
|
2493
|
+
* Returns the photos Google exposes to signed-out clients (usually the
|
|
2494
|
+
* first 8 of the gallery) as `thumbnail` and `image` URLs.
|
|
2495
|
+
* `pagination.total_results` is the place's total photo count on Google;
|
|
2496
|
+
* there is one page (`next` is null). To get another size, replace a
|
|
2497
|
+
* URL's `=w..-h..-k-no` suffix and keep its path.
|
|
2494
2498
|
*/
|
|
2495
2499
|
photos(params: MapsPhotosParams): Promise<GoogleResponse>;
|
|
2496
2500
|
/** Get business posts (promotional updates, announcements) for a place. */
|
|
@@ -19255,7 +19259,10 @@ interface WallapopAutocompleteResponse {
|
|
|
19255
19259
|
}
|
|
19256
19260
|
/** One category (recursive tree node). */
|
|
19257
19261
|
interface WallapopCategory {
|
|
19258
|
-
/**
|
|
19262
|
+
/**
|
|
19263
|
+
* Category id — a top-level id is usable as the search `categoryId`,
|
|
19264
|
+
* a nested one in `subcategoryIds`.
|
|
19265
|
+
*/
|
|
19259
19266
|
id: number;
|
|
19260
19267
|
/** Localised category name. */
|
|
19261
19268
|
name: string | null;
|
|
@@ -19324,7 +19331,10 @@ interface WallapopMarketsResponse {
|
|
|
19324
19331
|
type WallapopOrderBy = "most_relevance" | "newest" | "closest" | "price_low_to_high" | "price_high_to_low";
|
|
19325
19332
|
/** Listing-age window for /search. */
|
|
19326
19333
|
type WallapopTimeFilter = "today" | "lastWeek" | "lastMonth";
|
|
19327
|
-
/**
|
|
19334
|
+
/**
|
|
19335
|
+
* Options for the /search endpoint. Needs a query, a `categoryId`,
|
|
19336
|
+
* `subcategoryIds`, or a combination.
|
|
19337
|
+
*/
|
|
19328
19338
|
interface WallapopSearchParams {
|
|
19329
19339
|
/** Market code: es, it, pt (default: "es"). */
|
|
19330
19340
|
market?: string;
|
|
@@ -19336,6 +19346,13 @@ interface WallapopSearchParams {
|
|
|
19336
19346
|
distanceKm?: number;
|
|
19337
19347
|
/** Category id (see `listCategories`). */
|
|
19338
19348
|
categoryId?: number;
|
|
19349
|
+
/**
|
|
19350
|
+
* Subcategory ids from `listCategories` (a category's `subcategories`, at
|
|
19351
|
+
* any depth), e.g. `[9447]` (Smartphones) or `[9447, 10310]`; a listing
|
|
19352
|
+
* matching any of them is returned. Also accepts a comma-separated string.
|
|
19353
|
+
* Works with or without `categoryId`.
|
|
19354
|
+
*/
|
|
19355
|
+
subcategoryIds?: ReadonlyArray<number | string> | string;
|
|
19339
19356
|
/** Minimum price (EUR). */
|
|
19340
19357
|
minPrice?: number;
|
|
19341
19358
|
/** Maximum price (EUR). */
|
|
@@ -19401,6 +19418,8 @@ interface WallapopMarketParams {
|
|
|
19401
19418
|
interface WallapopFiltersParams {
|
|
19402
19419
|
/** Category the filters apply to. */
|
|
19403
19420
|
categoryId?: number;
|
|
19421
|
+
/** Subcategory ids the filters apply to (array or comma-separated string). */
|
|
19422
|
+
subcategoryIds?: ReadonlyArray<number | string> | string;
|
|
19404
19423
|
/** Search text the filters apply to. */
|
|
19405
19424
|
query?: string;
|
|
19406
19425
|
/** Market code: es, it, pt (default: "es"). Localises labels. */
|
|
@@ -19453,15 +19472,26 @@ declare class WallapopClient {
|
|
|
19453
19472
|
/**
|
|
19454
19473
|
* Search Wallapop listings (40 per page).
|
|
19455
19474
|
*
|
|
19456
|
-
* Needs a query, a `categoryId`, or
|
|
19457
|
-
* which case every other parameter is
|
|
19475
|
+
* Needs a query, a `categoryId`, `subcategoryIds`, or a combination —
|
|
19476
|
+
* unless `nextPage` is given, in which case every other parameter is
|
|
19477
|
+
* ignored (the cursor already carries them).
|
|
19458
19478
|
*
|
|
19459
19479
|
* @param query - Search text, e.g. "iphone 14" (optional with `categoryId` or `nextPage`).
|
|
19460
19480
|
* @param options - Optional parameters (market, location/radius, category,
|
|
19461
|
-
* price, condition, brand/model/colour, cars filters,
|
|
19481
|
+
* subcategories, price, condition, brand/model/colour, cars filters,
|
|
19482
|
+
* sort, cursor).
|
|
19462
19483
|
* @returns Search response with matching listings and the next-page cursor.
|
|
19463
19484
|
* @throws AuthenticationError - If the API key is invalid.
|
|
19464
|
-
* @throws ValidationError - If neither a query nor a category is given.
|
|
19485
|
+
* @throws ValidationError - If neither a query nor a category/subcategory is given.
|
|
19486
|
+
*
|
|
19487
|
+
* @example
|
|
19488
|
+
* ```typescript
|
|
19489
|
+
* // Smartphones (9447) under Technology & electronics (24200)
|
|
19490
|
+
* const phones = await client.wallapop.search("iphone", {
|
|
19491
|
+
* categoryId: 24200,
|
|
19492
|
+
* subcategoryIds: [9447],
|
|
19493
|
+
* });
|
|
19494
|
+
* ```
|
|
19465
19495
|
*/
|
|
19466
19496
|
search(query?: string, options?: WallapopSearchParams): Promise<WallapopSearchResponse>;
|
|
19467
19497
|
/**
|
|
@@ -19520,7 +19550,7 @@ declare class WallapopClient {
|
|
|
19520
19550
|
* Get the search filters Wallapop offers for a category and/or query,
|
|
19521
19551
|
* with their option ids.
|
|
19522
19552
|
*
|
|
19523
|
-
* @param options - Optional parameters (categoryId, query, market).
|
|
19553
|
+
* @param options - Optional parameters (categoryId, subcategoryIds, query, market).
|
|
19524
19554
|
* @returns Available filters.
|
|
19525
19555
|
*/
|
|
19526
19556
|
listFilters(options?: WallapopFiltersParams): Promise<WallapopFiltersResponse>;
|
|
@@ -19529,7 +19559,8 @@ declare class WallapopClient {
|
|
|
19529
19559
|
* separately — filters flagged `options_endpoint` in `listFilters`.
|
|
19530
19560
|
*
|
|
19531
19561
|
* @param filterId - Filter id, e.g. "brand".
|
|
19532
|
-
* @param options - Optional parameters (categoryId, query,
|
|
19562
|
+
* @param options - Optional parameters (categoryId, subcategoryIds, query,
|
|
19563
|
+
* market); e.g. `subcategoryIds: [9447]` returns phone brands only.
|
|
19533
19564
|
* @returns The filter's options.
|
|
19534
19565
|
* @throws ValidationError - If the filter id is invalid.
|
|
19535
19566
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import WebSocket from 'ws';
|
|
|
3
3
|
import { createHmac, timingSafeEqual } from 'crypto';
|
|
4
4
|
|
|
5
5
|
// src/internal/version.ts
|
|
6
|
-
var SDK_VERSION = "0.
|
|
6
|
+
var SDK_VERSION = "0.83.0";
|
|
7
7
|
|
|
8
8
|
// src/internal/exceptions.ts
|
|
9
9
|
var ScrapeBadgerError = class _ScrapeBadgerError extends Error {
|
|
@@ -3491,10 +3491,12 @@ var MapsClient = class {
|
|
|
3491
3491
|
* Get full place detail by `place_id` or `data_id`.
|
|
3492
3492
|
*
|
|
3493
3493
|
* Returns title, address, phone, website, GPS, rating, reviews_count,
|
|
3494
|
-
*
|
|
3495
|
-
* (
|
|
3496
|
-
*
|
|
3497
|
-
*
|
|
3494
|
+
* categories, extensions (amenity groups such as accessibility),
|
|
3495
|
+
* opening hours (`open_state`, today's `hours`, and `operating_hours`
|
|
3496
|
+
* for the coming seven days), `price_level` (Google's price per person,
|
|
3497
|
+
* e.g. "฿2,000+"), popular_times, provider_id, `thumbnail`/`image`, and
|
|
3498
|
+
* up to 20 photo URLs. `service_options` is null: Google no longer
|
|
3499
|
+
* exposes those flags to signed-out clients.
|
|
3498
3500
|
*/
|
|
3499
3501
|
async place(params) {
|
|
3500
3502
|
if (!params.place_id && !params.data_id) {
|
|
@@ -3517,12 +3519,13 @@ var MapsClient = class {
|
|
|
3517
3519
|
});
|
|
3518
3520
|
}
|
|
3519
3521
|
/**
|
|
3520
|
-
* Get photos for a place
|
|
3522
|
+
* Get photos for a place.
|
|
3521
3523
|
*
|
|
3522
|
-
* Returns
|
|
3523
|
-
*
|
|
3524
|
-
*
|
|
3525
|
-
* one
|
|
3524
|
+
* Returns the photos Google exposes to signed-out clients (usually the
|
|
3525
|
+
* first 8 of the gallery) as `thumbnail` and `image` URLs.
|
|
3526
|
+
* `pagination.total_results` is the place's total photo count on Google;
|
|
3527
|
+
* there is one page (`next` is null). To get another size, replace a
|
|
3528
|
+
* URL's `=w..-h..-k-no` suffix and keep its path.
|
|
3526
3529
|
*/
|
|
3527
3530
|
async photos(params) {
|
|
3528
3531
|
return this.client.request("/v1/google/maps/photos", {
|
|
@@ -10507,6 +10510,10 @@ var DepopClient = class {
|
|
|
10507
10510
|
|
|
10508
10511
|
// src/wallapop/client.ts
|
|
10509
10512
|
var onlyTrue = (value) => value ? true : void 0;
|
|
10513
|
+
var idList = (ids) => {
|
|
10514
|
+
if (ids === void 0 || typeof ids === "string") return ids;
|
|
10515
|
+
return ids.length > 0 ? ids.join(",") : void 0;
|
|
10516
|
+
};
|
|
10510
10517
|
var WallapopClient = class {
|
|
10511
10518
|
client;
|
|
10512
10519
|
constructor(client) {
|
|
@@ -10515,15 +10522,26 @@ var WallapopClient = class {
|
|
|
10515
10522
|
/**
|
|
10516
10523
|
* Search Wallapop listings (40 per page).
|
|
10517
10524
|
*
|
|
10518
|
-
* Needs a query, a `categoryId`, or
|
|
10519
|
-
* which case every other parameter is
|
|
10525
|
+
* Needs a query, a `categoryId`, `subcategoryIds`, or a combination —
|
|
10526
|
+
* unless `nextPage` is given, in which case every other parameter is
|
|
10527
|
+
* ignored (the cursor already carries them).
|
|
10520
10528
|
*
|
|
10521
10529
|
* @param query - Search text, e.g. "iphone 14" (optional with `categoryId` or `nextPage`).
|
|
10522
10530
|
* @param options - Optional parameters (market, location/radius, category,
|
|
10523
|
-
* price, condition, brand/model/colour, cars filters,
|
|
10531
|
+
* subcategories, price, condition, brand/model/colour, cars filters,
|
|
10532
|
+
* sort, cursor).
|
|
10524
10533
|
* @returns Search response with matching listings and the next-page cursor.
|
|
10525
10534
|
* @throws AuthenticationError - If the API key is invalid.
|
|
10526
|
-
* @throws ValidationError - If neither a query nor a category is given.
|
|
10535
|
+
* @throws ValidationError - If neither a query nor a category/subcategory is given.
|
|
10536
|
+
*
|
|
10537
|
+
* @example
|
|
10538
|
+
* ```typescript
|
|
10539
|
+
* // Smartphones (9447) under Technology & electronics (24200)
|
|
10540
|
+
* const phones = await client.wallapop.search("iphone", {
|
|
10541
|
+
* categoryId: 24200,
|
|
10542
|
+
* subcategoryIds: [9447],
|
|
10543
|
+
* });
|
|
10544
|
+
* ```
|
|
10527
10545
|
*/
|
|
10528
10546
|
async search(query, options = {}) {
|
|
10529
10547
|
return this.client.request("/v1/wallapop/search", {
|
|
@@ -10534,6 +10552,7 @@ var WallapopClient = class {
|
|
|
10534
10552
|
longitude: options.longitude,
|
|
10535
10553
|
distance_km: options.distanceKm,
|
|
10536
10554
|
category_id: options.categoryId,
|
|
10555
|
+
subcategory_ids: idList(options.subcategoryIds),
|
|
10537
10556
|
min_price: options.minPrice,
|
|
10538
10557
|
max_price: options.maxPrice,
|
|
10539
10558
|
condition: options.condition,
|
|
@@ -10640,13 +10659,14 @@ var WallapopClient = class {
|
|
|
10640
10659
|
* Get the search filters Wallapop offers for a category and/or query,
|
|
10641
10660
|
* with their option ids.
|
|
10642
10661
|
*
|
|
10643
|
-
* @param options - Optional parameters (categoryId, query, market).
|
|
10662
|
+
* @param options - Optional parameters (categoryId, subcategoryIds, query, market).
|
|
10644
10663
|
* @returns Available filters.
|
|
10645
10664
|
*/
|
|
10646
10665
|
async listFilters(options = {}) {
|
|
10647
10666
|
return this.client.request("/v1/wallapop/filters", {
|
|
10648
10667
|
params: {
|
|
10649
10668
|
category_id: options.categoryId,
|
|
10669
|
+
subcategory_ids: idList(options.subcategoryIds),
|
|
10650
10670
|
query: options.query,
|
|
10651
10671
|
market: options.market
|
|
10652
10672
|
}
|
|
@@ -10657,7 +10677,8 @@ var WallapopClient = class {
|
|
|
10657
10677
|
* separately — filters flagged `options_endpoint` in `listFilters`.
|
|
10658
10678
|
*
|
|
10659
10679
|
* @param filterId - Filter id, e.g. "brand".
|
|
10660
|
-
* @param options - Optional parameters (categoryId, query,
|
|
10680
|
+
* @param options - Optional parameters (categoryId, subcategoryIds, query,
|
|
10681
|
+
* market); e.g. `subcategoryIds: [9447]` returns phone brands only.
|
|
10661
10682
|
* @returns The filter's options.
|
|
10662
10683
|
* @throws ValidationError - If the filter id is invalid.
|
|
10663
10684
|
*/
|
|
@@ -10667,6 +10688,7 @@ var WallapopClient = class {
|
|
|
10667
10688
|
{
|
|
10668
10689
|
params: {
|
|
10669
10690
|
category_id: options.categoryId,
|
|
10691
|
+
subcategory_ids: idList(options.subcategoryIds),
|
|
10670
10692
|
query: options.query,
|
|
10671
10693
|
market: options.market
|
|
10672
10694
|
}
|