From d69d47b67130c53c590a09787de943041b33a1e4 Mon Sep 17 00:00:00 2001 From: kasparasizi1 <132673909+kasparasizi1@users.noreply.github.com> Date: Fri, 17 Jul 2026 22:19:10 +0300 Subject: [PATCH] feat: add sold_date and sold_date_at to eBay SearchResult (SCR-122) Expose the new completed-search card fields shipped by the API: - sold_date: sale date text as rendered by eBay (localized on non-English markets) - sold_date_at: best-effort ISO date, None when the format isn't English Bump version to 0.21.0. --- CHANGELOG.md | 6 ++++++ pyproject.toml | 2 +- src/scrapebadger/__init__.py | 2 +- src/scrapebadger/ebay/models.py | 2 ++ tests/test_ebay.py | 6 ++++++ uv.lock | 2 +- 6 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11e4e82..a42a560 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.21.0] - 2026-07-17 + +### Added + +- **eBay completed-search sold dates** — `SearchResult` now exposes `sold_date` (sale date text as rendered by eBay, e.g. "2 Jul 2026"; localized on non-English markets) and `sold_date_at` (best-effort ISO date "2026-07-02", `None` when the market's format isn't English) on `client.ebay` completed/sold result cards. (SCR-122) + ## [0.20.0] - 2026-07-13 ### Added diff --git a/pyproject.toml b/pyproject.toml index 17c09d9..2afb336 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "scrapebadger" -version = "0.20.0" +version = "0.21.0" 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 407e76d..5ccd968 100644 --- a/src/scrapebadger/__init__.py +++ b/src/scrapebadger/__init__.py @@ -863,7 +863,7 @@ async def main(): ZestimateHistoryPoint as ZillowZestimateHistoryPoint, ) -__version__ = "0.20.0" +__version__ = "0.21.0" __all__ = [ # TikTok core models diff --git a/src/scrapebadger/ebay/models.py b/src/scrapebadger/ebay/models.py index 8c7df0d..d83e189 100644 --- a/src/scrapebadger/ebay/models.py +++ b/src/scrapebadger/ebay/models.py @@ -117,6 +117,8 @@ class SearchResult(_BaseModel): location: str | None = None returns: str | None = None sold_count: int | None = None + sold_date: str | None = None # completed cards: sale date as rendered, e.g. "2 Jul 2026" + sold_date_at: str | None = None # ISO "2026-07-02", best-effort (None on non-English markets) watchers: int | None = None coupon: str | None = None rating: float | None = None diff --git a/tests/test_ebay.py b/tests/test_ebay.py index 7f60c89..e982ce6 100644 --- a/tests/test_ebay.py +++ b/tests/test_ebay.py @@ -69,6 +69,8 @@ "free_shipping": True, "location": "United States", "sold_count": 1200, + "sold_date": "2 Jul 2026", + "sold_date_at": "2026-07-02", "watchers": 42, "rating": 4.8, "ratings_total": 530, @@ -485,6 +487,8 @@ def test_completed_response(self) -> None: resp = SearchResponse.model_validate(COMPLETED_RESPONSE) assert resp.sold is True assert len(resp.results) == 1 + assert resp.results[0].sold_date == "2 Jul 2026" + assert resp.results[0].sold_date_at == "2026-07-02" def test_item_detail_response(self) -> None: resp = ItemDetailResponse.model_validate(ITEM_DETAIL_RESPONSE) @@ -631,6 +635,8 @@ async def test_completed( result = await search_client.completed("iphone 13", condition="used") assert isinstance(result, SearchResponse) assert result.sold is True + assert result.results[0].sold_date == "2 Jul 2026" + assert result.results[0].sold_date_at == "2026-07-02" call_args = mock_base_client.get.call_args assert call_args[0][0] == "/v1/ebay/completed" assert call_args[1]["params"]["condition"] == "used" diff --git a/uv.lock b/uv.lock index e6e78a0..220facc 100644 --- a/uv.lock +++ b/uv.lock @@ -752,7 +752,7 @@ wheels = [ [[package]] name = "scrapebadger" -version = "0.20.0" +version = "0.21.0" source = { editable = "." } dependencies = [ { name = "httpx" },