# Changelog of Just Eat Scraper Spain — Restaurants, Menus & Fees (`rastriq/just-eat-spain-scraper`) Actor

- **URL**: https://apify.com/rastriq/just-eat-spain-scraper/changelog.md
- **Full Actor documentation**: https://apify.com/rastriq/just-eat-spain-scraper.md

## Changelog

### 0.1 — 2026-11-15 (not deployed)

First version. Just Eat Spain listing by postal code and menu by restaurant, plain HTTP, no proxy,
no browser. Store records (one per restaurant id) and product records (one per restaurant and
product variation).

**Source behaviour, as measured on 2026-11-15 from a home connection:**

- `/area/{CP}` → `__NEXT_DATA__`: 685 restaurants in 28013. The city slug after the CP is
  ignored. An unknown CP (`28099`) answers **200 with 0 restaurants**: the actor reports it as a
  failed area, never as "no restaurants".
- `/restaurants-{uniqueName}/menu` → `__NEXT_DATA__`. KFC Atocha: 392 items, of which 251 are
  deal-only components (the drink or sauce inside a combo, mostly at 0 €). They are not emitted.
- An item listed under two categories appears twice, keyed `variationId|categoryId`. Found in the
  first live run (941 duplicate uids in 174 menus, all Burger King and VIPS). Fixed: one record
  with both categories.
- **Client**: `httpx` got a Cloudflare 403 ("Attention Required") on the same URL where `urllib`,
  the client the survey used, got 200. The actor uses `urllib` with gzip. No other client was
  tried. See `src/http.py`.

**Live runs** (`tools/live_check.py`, home connection, 1 request/s):

| Run | Volume | Time | Transfer | Errors |
|---|---|---:|---:|---|
| Madrid listing, prefix 280 (63 CPs) | 3,820 restaurants | 65 s | 26 MB | 0 (63 × 200, no 429) |
| Menus of Goiko, KFC, Burger King, VIPS, Telepizza in Madrid | 174 menus, 21,410 products | 177 s | 52 MB | 0 |
| Second run, about 40 minutes later (listing + the same menus) | 3,820 restaurants, 21,410 products | 65 s + 182 s | 77 MB | 0 |

- **Id stability**: the two runs share all 3,820 restaurant ids and all 21,410 product uids, with
  0 price changes. Both runs are from the same night: stability across days is still to be
  checked (run `tools/live_check.py compare` on two days' outputs).

- Covering Madrid: the greedy cover needs 21 CPs for 90 % of the union, 44 for 99 % and 53 for
  100 %. Sweeping all 63 codes of the prefix costs one minute, so the actor does not try to save
  codes. 8 codes of the prefix are PO-box codes with 0 or 1 restaurant and show as failed areas.

- Chains in Madrid (by name): Burger King 50, McDonald's 40, Domino's 37, VIPS 37, Telepizza 33,
  Rodilla 31, KFC 28, Ginos 26, Goiko 26, Taco Bell 26…

- **Locator join (KFC, Madrid)**: 33 KFC stores in CP 280xx in `restaurant-locators-es`, 17 with
  a Just Eat link, 14 found in the sweep by `uniqueName`. Of the other 3, 2 menu pages are alive
  but the restaurants are not in any listing, and 1 link is dead. Goiko and VIPS publish no Just
  Eat link in the locator output today (Goiko only Glovo and Uber Eats; VIPS's
  `StoreFinder-StoreAgregator` is not called by the locator adapter).

**Tests:** 64 offline checks (`tests/test_v01.py`), including privacy, dataset-schema conformance
and a stubbed run with failed and empty postal codes.

**Not in 0.1:**

- change tracking between runs (the ids are stable; the diff is left to the consumer);
- datacenter-IP test from this branch (see docs/DEPLOY.md);
- reviews (personal data; not read).

**Platform smoke test (2026-11-15 08:06 UTC, Apify datacenter IP, no proxy, build 0.1.1 `beta`)**,
run `KawSZh5yyQNSyKEGe`, input `{"postalCodes":["28013"],"chains":["kfc"],"maxMenus":1}`:
2 requests, both 200; 685 restaurants listed, 2 KFC stores, 1 menu with 141 products; 3.8 s.
**Just Eat answers from the Apify datacenter range with this client: no proxy needed.**

**Egress fallback (still 0.1, build 0.1.2 on `beta`, 2026-11-15)**, same design as glovo-es:
`egressMode: auto` (default) starts direct and, on the first 403 (Cloudflare), switches once to the
residential proxy of the secret env var `JUSTEAT_PROXY_URL` (Decodo, Spain) and resends that
request; `egressMode: proxy` uses it from the start; an input `proxyConfiguration` overrides both.
`SUMMARY.egress` records mode, final egress and the switch point. The URL is never logged.
Tests: 71 offline checks.

- Run `ePpnbBmkf5lOTp5Jq` (08:52 UTC, `auto`): direct, no 403, no switch; 685 listed, 2 KFC,
  141 products; 3.7 s.
- Run `aEggyHDQvGnN77FrT` (08:52 UTC, `proxy`): through Decodo, Cloudflare let it through; same
  figures; 5.3 s.
- The switch itself was not triggered on the platform (Just Eat did not block); it is covered by
  the offline test with a scripted 403.
