# Changelog of Jumia Scraper & Price Tracker - Keywords, Categories, URLs (`badr_xba/jumia-scraper`) Actor

- **URL**: https://apify.com/badr_xba/jumia-scraper/changelog.md
- **Full Actor documentation**: https://apify.com/badr_xba/jumia-scraper.md

## Changelog

### 2026-11-27 (retry rule)

- Owner rule: a refusal by Jumia (403, 429, anti-robot challenge, login page) is never retried — no new session, no
  new IP — and goes to `FAILED_INPUTS` as BLOCKED, not charged. A technical error (network, timeout, 5xx, proxy) gets
  at most 2 new tries with the same proxy configuration (was: up to 9 session rotations plus 4 retries). The remote
  link file: 429 is no longer retried. Billing, output and run statuses unchanged.

### Unreleased (2026-11-12, graceful stop before the timeout, local, not pushed)

- Run deadline (`src/deadline.py`): `ACTOR_TIMEOUT_AT`, else `APIFY_TIMEOUT_AT`, else run start + the run's timeout
  (run options read from the Apify API, else the Actor default 10 800 s). Margin max(45 s, 10 % of the timeout)
  (was 5 %, 20 s-3 min). Retry pauses never sleep past the stop; requests still running get a short grace, then are
  abandoned (a slow page, a 90 s handler or a retry can no longer push the run past its timeout); history, alerts,
  RUN_STATS and visual report are bounded to the time left (report skipped under 15 s). Unfinished keywords / URLs
  go to FAILED_INPUTS with code `TIME_LIMIT`; the run ends SUCCEEDED. Output and billing unchanged.

### 1.2.1 (2026-11-09, not yet pushed)

- Successful runs that saved at least one result end their status message with one short, optional invitation to leave a Store review or open an issue (never on failed or empty runs); README section "Feedback and reviews". Output and billing unchanged.

### 1.2 (2026-11-08, not yet pushed)

#### Added

- New row fields (appended at the end; no field renamed or removed), read from the product block Jumia embeds in
  list, keyword and product pages: `images` now also filled on list/keyword pages (Jumia's photo list, 520 px),
  `priceEur` / `oldPriceEur` (euro prices published by Jumia, nothing converted by the Actor), `variants`
  (sizes/options with their own price, old price, discount, euro price, `isBuyable`, `stockText`) and
  `availableVariants`. Declared in `.actor/dataset_schema.json`; the *Products* view shows the euro price and the
  variants in stock.
- `FAILED_INPUTS` rows carry a stable `code` (`src/run_guard.py: error_code`), used to group failures in the report.
- Visual report on kit 1.1.0: at most 3 photos per product (main first, card thumbnail strip), live progress page
  while the run is going (`save_progress`, at most one write per minute), data-quality panel, warnings & errors
  panel (failures grouped by code; warnings for keyword fallback, default country, demo input, unknown input
  fields, budget/timeout stop, crash). The final report is also written when the run crashes (status FAILED).
  Cards show the euro price and "n/m in stock" for variants; new *Variant in stock* filter, euro price in table and
  compare.

#### Tests

- `tests/test_extras_live.py` (new fixture `jumia_fashion.html`: the real jumia.ma /fashion-mode/ page trimmed to 4
  products) and `tests/test_report.py` updated for kit 1.1.0 (≤ 3 photos, error codes, warnings).

### 2026-11-08

#### Added

- **Visual report** (`REPORT` record, Output tab → *Visual report*): product cards with photo (gallery of the
  product page when *Scrape product pages* is on), price, old price, discount, price change since the last run,
  rating, Jumia Express / official store / campaign badges; compare mode (up to 4); key figures, price, discount,
  category and brand charts, search, filters, sorting, table view and CSV/JSON export of the filtered rows. Built by
  the shared `src/visual_kit.py` (v1.0.1) with this Actor's `src/report.py`. At most 2,000 rows are kept in memory
  for it; it is never billed and a report error is only logged as a warning.
- *Price monitoring* view: product image column. Output schema: *Visual report* link; key-value store schema:
  `REPORT` (text/html).

#### Fixed

- Image links (`image`, `images`): `//host/…` becomes `https://host/…`; blank, `data:` and relative values are
  dropped, and a product-page picture listed twice is kept once. Valid links are unchanged.

#### Tests

- `tests/test_report.py`: 13 tests on 60 real products of a production run and the real product page fixture
  (image ownership, product-page gallery, placeholders, URL normalization in the parsers, escaping, a 5,000-row
  synthetic set, export = embedded data, failure safety, REPORT saved as exactly text/html, rows pushed → report within the budget).

### 2026-11-07

#### Fixed

- **Keywords returned nothing.** Jumia changed its keyword pages (`/slp/…`) in October 2026: they no longer contain the JSON-LD product list the Actor read, and very common words such as `samsung` have no keyword page at all (HTTP 404). Keyword runs, including the empty-input demo, saved 0 products (seen on the scheduled Apify run of 7 November for `samsung`, and locally for `samsung` and `samsung a16`). Keyword pages are now read like category pages (40 products per page, paginated up to *Maximum pages*), the old JSON-LD form is still understood, and a word without keyword page falls back to the brand/category page of the same name (`https://www.jumia.ma/samsung/`), which robots.txt allows.
- **Homepage visit before almost every request.** The session warm-up (one homepage visit per session) ran with crawlee's default pool of 1,000 sessions picked at random, so nearly every request opened a new session and fetched the homepage first: up to twice the requests sent to Jumia. The pool is now limited to 10 sessions (measured: 8 homepage visits for a 17-page run). A failed warm-up no longer counts as a failure of the page itself.
- Seller filter (`sellerKeywords`, API only) rejected every product on list pages, where the seller is not known yet; it is now checked after the product page, which is switched on automatically when this filter is used. An unknown seller was compared as the text "none".
- "Link remote text file" in Start URLs crashed on a fresh build: it imported `httpx`, which `crawlee[httpx]` no longer installs (it now ships `httpx2`). It now uses whichever is installed and retries network errors, 429 and 5xx (3 attempts, 1 s / 2 s with jitter).

#### Faster

- Pages are no longer parsed whole with BeautifulSoup (about 0.3–1 s of CPU per 1.3 MB list page locally, much more at 256 MB on Apify): the embedded data, pagination, JSON-LD, seller and description blocks are cut out first. Same results, checked field by field on real pages (list page 0.33 s → 0.02 s).
- Keyword URLs use Jumia's canonical form with a final slash (one redirect less per keyword).

#### Data

- On list and keyword pages, `inStock` now mirrors `isBuyable` (as in Jumia Products Scraper) instead of being always empty; the product page still overrides it.
- Every row is checked against the types of `.actor/dataset_schema.json` before it is saved (`src/item_check.py`); `page`, `position`, `reviewsCount` declared as integers; descriptions say which fields only exist with *Scrape product pages*.

#### Other

- Explicit 60 s timeout per page download; price history and per-run keys loaded/saved in parallel.
- `RUN_SUMMARY.homepageVisits` added.
- Offline test suite (`tests/`, 31 tests) on real, trimmed Jumia pages; `pytest.ini`. `tests/` excluded from the Docker image.
- `requirements.txt`: `apify>=3.4,<4`, `crawlee[beautifulsoup,httpx]>=1.11,<2`.
