# Changelog of Trefac Scraper – Treasure Factory Japan Secondhand Fashion (`tokyo-select-jp/trefac-search-scraper`) Actor

- **URL**: https://apify.com/tokyo-select-jp/trefac-search-scraper/changelog.md
- **Full Actor documentation**: https://apify.com/tokyo-select-jp/trefac-search-scraper.md

## Changelog

### 0.3.0 — 2026-11-02

- New `outputMode` input: `items` (default, unchanged), `summary` (one market-summary row per search instead of the listings), `both`. A summary row (`recordType: "summary"`) carries the sample size and the site's total count, price statistics (min / p25 / median / mean / p75 / max / stddev, on-sale vs sold), a price histogram, status / condition-rank / size / brand / category / gender breakdowns, recent-listing counts where the site exposes listing times, and the cheapest listings (all, and in good condition). Billed once per search as the `summary` event; in `summary` mode the sampled listings are not stored and not billed.
- Shared `src/core/summary.ts` — the same file in every JP Data Works Actor, so summaries from different sites line up field by field.
- Dataset schema: `recordType` added; only `source` is required now (summary rows have no item fields).

### 0.2.0 — 2026-10-30

- Structured search input: new `searches` array with `keyword`, `brand` / `brandId`, `categoryPath` / `categoryId`, `priceMinJpy`, `priceMaxJpy`, `sort` (relevance / newest / priceAsc / priceDesc), `conditionMin` (1–6), `gender` (mens / ladies / kids / any) and `storeName`. `keywords` keeps working; top-level `sort`, `priceMinJpy`, `priceMaxJpy`, `conditionMin` act as defaults for every search.
- Gender, category, brand, price range, condition rank and sort order are applied by the site itself (URL path `t{gtype}c{gcateg}psb{brandID}` + `kind`, `selects`, `selecte`, `gcondition`, `order`); `storeName` and unresolved brand names / category paths are applied client-side and logged as such.
- Brand names are resolved to the site's brand id through the brand list page (one request per run, only when needed).
- New run limits: `maxTotalItems` (hard cap across all searches) and `dedupeAcrossSearches` (default true, by `itemId`).
- Every item now carries `search` (the resolved parameters + first page URL); `keyword` falls back to the search label for brand / category searches.
- Parser: SALE prices (`.p-price2_b`) are read, hit count read from the current markup (`.search_result_num`).
- Pricing: results are billed by Apify's automatic `apify-default-dataset-item` event ($0.002); the Actor no longer charges a `search-result` event (that would double-bill). `detail-page` ($0.005) unchanged; the run stops when the max total charge is reached by either event. Actor start $0.00005.
- Store publishing: added `.actor/output_schema.json` (dataset JSON / CSV links) and a full field description in `.actor/dataset_schema.json`.
- Version 0.2 (actor.json), User-Agent `trefac-search-scraper/0.2`.

### 0.1.2

- Bare numbers 26–44 on size tags are now parsed as waist inches (W31 / W34) instead of JP numeric.

### 0.1.1

- Add top-level `imageUrl` (first full-size image) and `size` (normalized label, e.g. W28 / L / JP3).
- Dataset table view now shows image, normalized size.

### 0.1.0 — 2026-10-30

- Initial release.
- Keyword search on trefac.jp with pagination (90 listings per page, up to 500 per keyword).
- Normalized output: price (int JPY), tag size → `sizeNorm` (waist / alpha / numeric / cm / free), store, gender, badges, full-size image URL.
- Optional detail enrichment: condition rank ★1–6 + label, measurements in cm with English keys, staff comment, condition notes, material, country, category, all gallery images.
- Pay-per-event support: `search-result` per item, `detail-page` per enriched item.
- Polite crawling: configurable delay (default 3 s), robots.txt honoured, identifying User-Agent, sequential requests only.
