# Changelog of Fotocasa Scraper — Spain Property Listings (`stone_jadex/fotocasa-es-scraper`) Actor

- **URL**: https://apify.com/stone_jadex/fotocasa-es-scraper/changelog.md
- **Full Actor documentation**: https://apify.com/stone_jadex/fotocasa-es-scraper.md

## Changelog

### 0.2.2 — 2026-11-24

- Added logical `sectionCaption` groups and explicit `prefill` defaults across `.actor/input_schema.json`, and updated `.actor/actor.json` version to `0.2`.
- Expanded `README.md` to full Store documentation (>20,000 characters) while preserving all existing 7-section and identifier contracts: added full 11-parameter input table, 2 JSON examples, illustrative JSON output matching `.actor/dataset_schema.json`, complete 41-field reference, dataset views & `OUTPUT` summary, Bronze–Diamond tier discount table, JavaScript & Python `ApifyClient` quickstarts, and dated Changelog.
- Aligned cloud pricing (`listing` `$0.0005` primary, `listing-detail` `$0.0015`, `apify-actor-start` `$0.0005`) with Apify Store subscription tier discounts (Bronze 5% off, Silver 10% off, Gold/Platinum/Diamond 15% off) and switched `0.2` to `latest`.

### Unreleased (2026-11-16)

- H6: the hard timer records in-flight `pushData`/`charge` promises, waits up to 3 s (inside the existing 20 s platform margin) for them to finish, then writes OUTPUT so rows written = rows charged = OUTPUT counts. If the wait times out, only confirmed rows are counted; a late write is not charged and is not added to OUTPUT.
- H7: the timer callback is stored as a promise. The main loop yield and `finish` (when the timer already owns the end) await that promise before returning, so OUTPUT and the run-notice row are written before any `Actor.exit()`.
- Platform status message follows `out.failed`: `Stopped (<stopReason>)` when failed, `Done: …` otherwise (failed runs no longer look like "Done").
- Unknown exceptions in the main loop go through `finish` with `stopReason=error`, `failed=true`, and an `errors[]` entry with `type`, `url`, and `lastFailure`. The run still ends SUCCEEDED (no throw). `invalid-input` still throws, unchanged.
- `charge-error` entries in `errors[]` now include `type`, `url`, and `lastFailure` (not only `{ error }`).
- Tests: H6 in-flight write, H6 abandoned write is not charged, H7 writes-before-exit, status message, fatal path, charge-error shape.
- Final-batch 2 unified block rules: HTTP 403/412/429 back off 30 s then 60 s; K1 (after a block on the same request, any later non-200, timeout or network error stops the whole run); stopReason `blocked-<code>` / `blocked-challenge` (was `cloudflare-challenge`); `site-end` removed in favour of `completed`; 0 rows with no errors is `empty`. Blocked / hard time-limit / list `errors` set `failed=true`. Buyer `maxRunSeconds` between requests is a normal wrap-up (`deadlineSource=maxRunSeconds`, `failed=false`).
- H4: the hard timer sets `stop=true` first; `emit` returns 0 after `finish`; `finish` does not overwrite the timer's `failed` and `runNotice`.
- Start fee: platform synthetic `apify-actor-start` at $0.0005 (first in `.actor/pay_per_event.json` and in `src/pricing.js`). Code never charges it. Detail event `listing-detail` is $0.0015. A failed detail is pushed as a list row and charged the list fee only; a blocked detail request pushes the in-hand list row first, then stops the run.
- Actor description: drop "No start fee"; state list / detail / start prices.

### Unreleased (2026-11-02)

- Add `.actor/output_schema.json` (`listings`, `summary`, `results`, `overview`) and reference it from `actor.json` (`"output"`); `dataset_schema.json` referenced via `storages.dataset`, covering all 41 emitted fields with `views.overview`, `views.listings`, and `views.notices`.

### 0.1.0 — 2026-10-26

- Initial Fotocasa.es scraper (list + optional detail) from cake/otodom-actor template.
- Privacy policy A: keep public agency phones/emails; drop private seller phones/emails.
- Page 1 from HTML `__initial_props__`; page >=2 from `web.gw.fotocasa.es` property-search JSON (HTML `/l/2+` is robots Disallow).
- Default input: Madrid rentals; maxItems 50 (cap 2000); scrapeDetails false; requestDelayMs 1200; concurrency 1; memory 256 MB; proxy off; residential never default (cap 5 MB).
