diff --git a/api-reference/endpoint/wallapop/list-categories.mdx b/api-reference/endpoint/wallapop/list-categories.mdx index 598f8d3..514373c 100644 --- a/api-reference/endpoint/wallapop/list-categories.mdx +++ b/api-reference/endpoint/wallapop/list-categories.mdx @@ -1,10 +1,10 @@ --- title: "List Categories" api: "GET https://scrapebadger.com/v1/wallapop/categories" -description: "Wallapop's full category tree with localised names — the ids are the category_id values search and filters accept." +description: "Wallapop's full category tree with localised names — the ids are the category_id and subcategory_ids values search and filters accept." --- -Wallapop's full category tree. Every `id` in the tree, at any depth, works as the `category_id` in [search](/api-reference/endpoint/wallapop/search-items) and [filters](/api-reference/endpoint/wallapop/list-filters). +Wallapop's full category tree. A top-level `id` is a `category_id`; every id under it in `subcategories`, at any depth, goes in `subcategory_ids` — both in [search](/api-reference/endpoint/wallapop/search-items) and [filters](/api-reference/endpoint/wallapop/list-filters). For example, Smartphones is `category_id=24200&subcategory_ids=9447`. **Credits:** 1 @@ -31,7 +31,7 @@ Wallapop's full category tree. Every `id` in the tree, at any depth, works as th Parent category id; `null` for top-level categories. Wallapop vertical, e.g. `consumer_goods` or `cars`. Subcategories inherit it from their parent. Wallapop icon name for the category, e.g. `car`. - Child categories, with the same shape, nested to any depth. + Child categories, with the same shape, nested to any depth. Their ids are `subcategory_ids` values. The market used for the request. diff --git a/api-reference/endpoint/wallapop/list-filter-options.mdx b/api-reference/endpoint/wallapop/list-filter-options.mdx index 901d625..720280a 100644 --- a/api-reference/endpoint/wallapop/list-filter-options.mdx +++ b/api-reference/endpoint/wallapop/list-filter-options.mdx @@ -23,7 +23,11 @@ The options for filters too long to inline in [`/v1/wallapop/filters`](/api-refe ## Query Parameters - Category to scope the options to, e.g. `100` for car makes and models. + Top-level category to scope the options to, e.g. `100` for car makes and models. + + + + Comma-separated subcategory ids to scope the options to. For example `brand` with `subcategory_ids=9447` lists phone brands, and with `10310` laptop brands. diff --git a/api-reference/endpoint/wallapop/list-filters.mdx b/api-reference/endpoint/wallapop/list-filters.mdx index 78bff9b..4e9c3ab 100644 --- a/api-reference/endpoint/wallapop/list-filters.mdx +++ b/api-reference/endpoint/wallapop/list-filters.mdx @@ -19,7 +19,11 @@ Filters with long option lists, such as `brand` and `model`, return no options h ## Query Parameters - Category the filters apply to, from [`/v1/wallapop/categories`](/api-reference/endpoint/wallapop/list-categories). Use `100` for car filters. + Top-level category the filters apply to, from [`/v1/wallapop/categories`](/api-reference/endpoint/wallapop/list-categories). Use `100` for car filters. + + + + Comma-separated subcategory ids the filters apply to, e.g. `9447` (Smartphones). Same format as in [search](/api-reference/endpoint/wallapop/search-items). diff --git a/api-reference/endpoint/wallapop/search-items.mdx b/api-reference/endpoint/wallapop/search-items.mdx index e2c3da1..59ce205 100644 --- a/api-reference/endpoint/wallapop/search-items.mdx +++ b/api-reference/endpoint/wallapop/search-items.mdx @@ -1,10 +1,10 @@ --- title: "Search Listings" api: "GET https://scrapebadger.com/v1/wallapop/search" -description: "Search Wallapop second-hand listings in Spain, Italy, or Portugal with Wallapop's own filters — price, condition, brand, model, colour, distance, listing age, shipping, and car filters." +description: "Search Wallapop second-hand listings in Spain, Italy, or Portugal with Wallapop's own filters — category and subcategory, price, condition, brand, model, colour, distance, listing age, shipping, and car filters." --- -Search Wallapop listings, **40 per page**, with the same filters the Wallapop app offers. Send a `query`, a `category_id`, or both. +Search Wallapop listings, **40 per page**, with the same filters the Wallapop app offers. Send a `query`, a `category_id`, `subcategory_ids`, or any combination. **Credits:** 5 per page. Empty results are not charged. @@ -17,7 +17,7 @@ Search Wallapop listings, **40 per page**, with the same filters the Wallapop ap ## Query Parameters - Search text, e.g. `iphone 14`, `bicicleta montaña`. Required unless you pass `category_id`; requests with neither return `422`. + Search text, e.g. `iphone 14`, `bicicleta montaña`. Required unless you pass `category_id` or `subcategory_ids`; requests with none of them return `422`. @@ -37,7 +37,11 @@ Search Wallapop listings, **40 per page**, with the same filters the Wallapop ap - Category id from [`/v1/wallapop/categories`](/api-reference/endpoint/wallapop/list-categories), e.g. `24200` (Technology & electronics) or `100` (Cars). Required unless you pass `query`. + Top-level category id from [`/v1/wallapop/categories`](/api-reference/endpoint/wallapop/list-categories), e.g. `24200` (Technology & electronics) or `100` (Cars). Wallapop matches only top-level ids here: a subcategory id sent as `category_id` returns no results, so send subcategories in `subcategory_ids`. + + + + Comma-separated subcategory ids from [`/v1/wallapop/categories`](/api-reference/endpoint/wallapop/list-categories) — the `subcategories` of a category, at any depth. For example `24201` (Phones), `9447` (Smartphones), or `9447,10310` (smartphones and laptops); a listing in any of them matches. Works with or without `category_id`; a subcategory from another category than `category_id` matches nothing. Spaces and empty entries are ignored; anything other than numeric ids returns `422`. A `next_page` cursor keeps the subcategories. @@ -237,6 +241,15 @@ scrapebadger wallapop search "iphone" --market es --shippable +Subcategory search — smartphones (`9447`, under Technology & electronics `24200`) up to €300, newest first: + +```bash +curl "https://scrapebadger.com/v1/wallapop/search?query=iphone&category_id=24200&subcategory_ids=9447&max_price=300&order_by=newest" \ + -H "X-API-Key: YOUR_API_KEY" +``` + +Each listing's `taxonomy` shows the full category path it sits in, e.g. Technology & electronics › Phones › Smartphones. + Car search — manual cars from 2015 on with under 100,000 km, closest to Madrid first: ```bash