From 7dfa1cbb65b2db2b6398aae331502f44368991e7 Mon Sep 17 00:00:00 2001 From: kasparasizi1 <132673909+kasparasizi1@users.noreply.github.com> Date: Thu, 26 Nov 2026 12:07:37 +0200 Subject: [PATCH] Wallapop filters: subcategory_ids needs category_id (docs, 0.83.1) Wallapop's filter endpoints reject subcategories without their category; the API answers 422 for that (scrapebadger#3569). Docstrings and the 0.83.0 changelog example now pass the category id. Search still accepts subcategories alone. No code or signature changes. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 7 ++++++- pyproject.toml | 2 +- src/scrapebadger/__init__.py | 2 +- src/scrapebadger/_internal/client.py | 2 +- src/scrapebadger/wallapop/client.py | 7 +++++-- uv.lock | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7d0e39..1e74896 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,15 @@ # Changelog +## [0.83.1] - 2026-11-26 + +### Changed +- **Wallapop filters docs.** `wallapop.list_filters()` and `wallapop.list_filter_options()` need `category_id` whenever `subcategory_ids` is set: Wallapop rejects subcategories on its filter endpoints without their category, and the API answers 422 for that. The 0.83.0 example `list_filter_options("brand", subcategory_ids=[9447])` is corrected to `list_filter_options("brand", category_id=24200, subcategory_ids=[9447])`. `search()` still accepts `subcategory_ids` alone. No code or signature changes. + ## [0.83.0] - 2026-11-26 ### Added - `wallapop.search(..., subcategory_ids=...)` narrows a search to Wallapop subcategories: the `subcategories` ids of `wallapop.list_categories()`, at any depth (e.g. `24200` Technology & electronics → `24201` Phones → `9447` Smartphones). Pass a list (`[9447, 10310]`) or a comma-separated string (`"9447,10310"`); several ids match any of them. Works with or without `category_id`, and on its own is enough to search (no `query` needed). A `next_page` cursor keeps the subcategories. -- `wallapop.list_filters()` and `wallapop.list_filter_options()` take the same `subcategory_ids`, so filters and option lists match the subcategory (e.g. `list_filter_options("brand", subcategory_ids=[9447])` returns phone brands only). +- `wallapop.list_filters()` and `wallapop.list_filter_options()` take the same `subcategory_ids`, so filters and option lists match the subcategory (e.g. `list_filter_options("brand", category_id=24200, subcategory_ids=[9447])` returns phone brands only; the filters need `category_id`, see 0.83.1). - New keyword-only arguments with a `None` default, so existing calls are unchanged. ## [0.82.1] - 2026-11-25 diff --git a/pyproject.toml b/pyproject.toml index 294c3cc..9b2d312 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "scrapebadger" -version = "0.83.0" +version = "0.83.1" description = "Official Python SDK for ScrapeBadger - Async web scraping APIs for Twitter and more" readme = "README.md" license = { text = "MIT" } diff --git a/src/scrapebadger/__init__.py b/src/scrapebadger/__init__.py index d32a688..6e9069f 100644 --- a/src/scrapebadger/__init__.py +++ b/src/scrapebadger/__init__.py @@ -1356,7 +1356,7 @@ async def main(): ZestimateHistoryPoint as ZillowZestimateHistoryPoint, ) -__version__ = "0.83.0" +__version__ = "0.83.1" __all__ = [ # TikTok core models diff --git a/src/scrapebadger/_internal/client.py b/src/scrapebadger/_internal/client.py index bc8512a..dadf57a 100644 --- a/src/scrapebadger/_internal/client.py +++ b/src/scrapebadger/_internal/client.py @@ -56,7 +56,7 @@ T = TypeVar("T") # User agent for SDK requests -SDK_VERSION = "0.83.0" +SDK_VERSION = "0.83.1" USER_AGENT = f"scrapebadger-python/{SDK_VERSION}" diff --git a/src/scrapebadger/wallapop/client.py b/src/scrapebadger/wallapop/client.py index 3860280..5d85dc9 100644 --- a/src/scrapebadger/wallapop/client.py +++ b/src/scrapebadger/wallapop/client.py @@ -394,7 +394,8 @@ async def list_filters( Args: category_id: Category the filters apply to. subcategory_ids: Subcategory ids the filters apply to (a list or - a comma-separated string). + a comma-separated string). Needs the ``category_id`` they + belong to; without it the API answers 422. query: Search text the filters apply to. market: Market code (es, it, pt). Defaults to "es". @@ -441,7 +442,9 @@ async def list_filter_options( query: Search text the options apply to. market: Market code (es, it, pt). Defaults to "es". subcategory_ids: Subcategory ids the options apply to (a list or - a comma-separated string), e.g. ``[9447]`` for phone brands. + a comma-separated string). Needs the ``category_id`` they + belong to, e.g. ``category_id=24200, subcategory_ids=[9447]`` + for phone brands; without it the API answers 422. Returns: The filter's options. diff --git a/uv.lock b/uv.lock index a53afc8..c53bd93 100644 --- a/uv.lock +++ b/uv.lock @@ -930,7 +930,7 @@ wheels = [ [[package]] name = "scrapebadger" -version = "0.83.0" +version = "0.83.1" source = { editable = "." } dependencies = [ { name = "httpx" },