diff --git a/CHANGELOG.md b/CHANGELOG.md index 1479834..0e22679 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.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.21.0] - 2026-07-17 + +### Added + +- **eBay** — new `sold_date` / `sold_date_at` fields on `SearchResult` cards (search, seller items, category, completed). `sold_date` is the sale date text as rendered by eBay (e.g. `"2 Jul 2026"`, localized on non-English markets, always set on completed/sold cards); `sold_date_at` is a best-effort ISO date (e.g. `"2026-07-02"`, `null` when the market's format isn't English). (SCR-122) + ## [0.20.0] - 2026-07-13 ### Added diff --git a/package.json b/package.json index d86f0c2..728fcbf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scrapebadger", - "version": "0.20.0", + "version": "0.21.0", "description": "Official Node.js SDK for ScrapeBadger - Async web scraping APIs for Twitter, Google, Vinted, Reddit, and more", "type": "module", "main": "./dist/index.js", diff --git a/src/ebay/types.ts b/src/ebay/types.ts index 9df9cae..dc7e5a2 100644 --- a/src/ebay/types.ts +++ b/src/ebay/types.ts @@ -124,6 +124,10 @@ export interface SearchResult { location: string | null; returns: string | null; sold_count: number | null; + /** Sale date text as rendered by eBay, e.g. "2 Jul 2026" (completed/sold cards; localized on non-English markets) */ + sold_date: string | null; + /** Best-effort ISO date, e.g. "2026-07-02"; null when the market's format isn't English */ + sold_date_at: string | null; watchers: number | null; coupon: string | null; rating: number | null; diff --git a/tests/ebay.test.ts b/tests/ebay.test.ts index 8165331..9141690 100644 --- a/tests/ebay.test.ts +++ b/tests/ebay.test.ts @@ -88,6 +88,8 @@ const SEARCH_RESULT = { location: "United States", returns: "30 days", sold_count: 120, + sold_date: null, + sold_date_at: null, watchers: 30, coupon: null, rating: 4.8, @@ -114,6 +116,7 @@ const SEARCH_FIXTURE: EbaySearchResponse = { const COMPLETED_FIXTURE: EbaySearchResponse = { ...SEARCH_FIXTURE, sold: true, + results: [{ ...SEARCH_RESULT, sold_date: "2 Jul 2026", sold_date_at: "2026-07-02" }], }; const ITEM_FIXTURE: EbayItemDetailResponse = { @@ -390,6 +393,8 @@ describe("EbayClient.search", () => { const { url } = capturedRequest(); expect(url).toContain("/v1/ebay/completed"); expect(result.sold).toBe(true); + expect(result.results[0].sold_date).toBe("2 Jul 2026"); + expect(result.results[0].sold_date_at).toBe("2026-07-02"); }); it("autocomplete sends GET to /v1/ebay/autocomplete", async () => {