From 772f704621ce74f6d152e8e49847fcc37b4dc008 Mon Sep 17 00:00:00 2001 From: kasparasizi1 <132673909+kasparasizi1@users.noreply.github.com> Date: Sat, 25 Jul 2026 12:46:46 +0300 Subject: [PATCH 1/2] feat(ebay): expose pagination.has_more; is_sponsored is now nullable has_more is the stop signal for bulk extraction of completed/sold listings. Without it the field was dropped by the model (extra=ignore), so SDK users could not page to the end: total_pages/total_results are null on that grid, and past the last page eBay re-serves it rather than returning empty. is_sponsored becomes bool | None, defaulting to None. eBay renders its Sponsored badge into every card as anti-scraping bait, so the API now reports null instead of true-for-everything. --- src/scrapebadger/ebay/models.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/scrapebadger/ebay/models.py b/src/scrapebadger/ebay/models.py index 19ee65e..fb56372 100644 --- a/src/scrapebadger/ebay/models.py +++ b/src/scrapebadger/ebay/models.py @@ -46,6 +46,11 @@ class Pagination(_BaseModel): per_page: int | None = None total_pages: int | None = None total_results: int | None = None + #: True while eBay still offers a next page. This is the stop signal for + #: bulk extraction: ``total_pages``/``total_results`` are ``None`` on the + #: completed/sold grid, and past the last page eBay re-serves that page, so + #: looping "until empty" alone never terminates. + has_more: bool | None = None class MarketInfo(_BaseModel): @@ -127,7 +132,10 @@ class SearchResult(_BaseModel): seller_feedback_percent: float | None = None seller_feedback_score: int | None = None program_badge: str | None = None # e.g. "eBay Refurbished" - is_sponsored: bool = False + #: Always ``None`` — eBay renders its "Sponsored" badge into every card + #: as anti-scraping bait, so promoted placements cannot be distinguished + #: from organic results. + is_sponsored: bool | None = None # ============================================================================= From d323c0854591b814bf1a872cbcc3097e8a99c42b Mon Sep 17 00:00:00 2001 From: kasparasizi1 <132673909+kasparasizi1@users.noreply.github.com> Date: Sat, 25 Jul 2026 12:48:09 +0300 Subject: [PATCH 2/2] test(ebay): is_sponsored default is None, not False --- tests/test_ebay.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_ebay.py b/tests/test_ebay.py index 1156d29..317cb8a 100644 --- a/tests/test_ebay.py +++ b/tests/test_ebay.py @@ -384,7 +384,9 @@ def test_search_result_minimal(self) -> None: result = SearchResult(position=1, item_id="X") assert result.title is None assert result.is_auction is False - assert result.is_sponsored is False + # None, not False: eBay's "Sponsored" badge is present on every card, so + # sponsorship is unknowable from the response rather than known-absent. + assert result.is_sponsored is None assert result.price is None def test_item_full(self) -> None: