Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### 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)
- **eBay item `is_ended`** — `Item` now exposes `is_ended` (`True` when the listing has closed — sold or ended — any buying format, default `False`). `end_time_utc`/`end_time_at` broaden from auction-only to the listing end: auction close or sold time for ended listings of any format; still `None` for active fixed-price listings. (SCR-122)

## [0.20.0] - 2026-07-13

Expand Down
5 changes: 3 additions & 2 deletions src/scrapebadger/ebay/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,9 @@ class Item(_BaseModel):
bids: int | None = None
current_bid: EbayPrice | None = None # auctions: the current high bid (mirrors ``price``)
time_left: str | None = None # relative remaining, e.g. "12h 16m"
end_time_utc: float | None = None # absolute auction end (Unix float)
end_time_at: str | None = None # absolute auction end (ISO-8601 Z)
is_ended: bool = False # listing has closed (sold / ended), any buying format
end_time_utc: float | None = None # listing end: auction close / sold time (Unix float)
end_time_at: str | None = None # listing end: auction close / sold time (ISO-8601 Z)
buy_it_now_price: EbayPrice | None = None # BIN price (fixed-price, or auction-with-BIN)
best_offer_enabled: bool | None = None
brand: str | None = None
Expand Down
7 changes: 7 additions & 0 deletions tests/test_ebay.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
"bids": 19,
"current_bid": SAMPLE_AUCTION_BID,
"time_left": "12h 5m",
"is_ended": False,
"end_time_utc": 1782157851.0,
"end_time_at": "2026-06-22T19:50:51Z",
"buy_it_now_price": None,
Expand Down Expand Up @@ -419,13 +420,19 @@ def test_item_auction(self) -> None:
assert item.current_bid is not None
assert item.current_bid.value == 1430.0
assert item.time_left == "12h 5m"
assert item.is_ended is False
assert item.end_time_utc == 1782157851.0
assert item.end_time_at == "2026-06-22T19:50:51Z"
assert item.buy_it_now_price is None

def test_item_ended(self) -> None:
item = Item.model_validate({**SAMPLE_AUCTION_ITEM, "is_ended": True, "time_left": None})
assert item.is_ended is True

def test_item_non_auction_has_no_auction_fields(self) -> None:
item = Item.model_validate(SAMPLE_ITEM)
assert item.is_auction is False
assert item.is_ended is False
assert item.current_bid is None
assert item.end_time_utc is None
assert item.end_time_at is None
Expand Down
Loading