# Changelog of Product Price Monitor - Any Store, Price Drop & Stock Alerts (`mmdincer/product-price-monitor`) Actor

- **URL**: https://apify.com/mmdincer/product-price-monitor/changelog.md
- **Full Actor documentation**: https://apify.com/mmdincer/product-price-monitor.md

## Changelog

### 1.0.6

Clas Ohlson request identity and challenge-stub retry.

- **Clas Ohlson first request.** The adapter now sends the honest bot user agent (`ProductPriceMonitor`) with plain headers. Clas Ohlson answers a Chrome UA with a 3 KB `<title>Client Challenge</title>` stub on every path, and the full page with a `"price": "29.9"` JSON-LD offer to the bot UA. This is the same identity the old Clas Ohlson actor used.
- **Challenge retry order.** When a direct 200 page is a challenge stub, the HTTP client now retries once directly with the honest bot UA before any proxy traffic, then falls back to the proxy as before. A failed bot-UA retry keeps the original stub, so the row is still reported as a bot challenge, not `no_data`.
- **Challenge markers.** `client challenge`, `just a moment`, `attention required`, and `access denied` are recognized in the page title, so a large stub with that title is detected too. The shared marker list is used by `looksLikeChallenge` and `looksBlocked` instead of being copied.
- **Run log.** A successful bot-UA retry logs `Served <host> with the honest bot user agent after an HTTP 403 (HTTP 200).` or `… after a bot challenge (HTTP 200).`, so the run shows which retry cleared the page. Each page also carries `retriedWith: "bot-user-agent"` for the caller.
- **Tests.** A 3,038-byte Clas Ohlson `Client Challenge` fixture, an end-to-end read of the same URL in 29.9 SEK InStock after the bot-UA retry, no proxy call in that flow, the adapter's first-request headers, and the new marker strings.

### 1.0.5

Proxy fix and proof from the 88-URL live test.

- **Invalid proxy session id.** Every `newUrl()` call used the session id `product-price-monitor`, which does not match the SDK's `/^[\w.~]+$/` pattern (hyphens are forbidden). Apify Proxy rejected the URL before any request was made, so the log had no "Served … through Apify Proxy" line and all traffic stayed direct. Session ids are now built per host with a fresh random run suffix (`ppm_<random>_<host>`, sanitized, at most 50 characters), and any user-supplied id is sanitized the same way. A regression test uses a `newUrl` that throws the SDK's validation error on an invalid id.
- **Session error is not a 407.** A `newUrl` error that names `sessionId` is our own bug and no longer switches the run to the datacenter group. Any other `newUrl` failure still falls back to the datacenter group once.
- **Proxy proof.** Every proxied request logs `Served <host> through Apify Proxy (HTTP <code>) via <RESIDENTIAL|datacenter>[ in <CC>]`, the run ends with `Proxy summary: N requests through RESIDENTIAL, M through datacenter, K direct`, and each dataset row carries `proxy_group` (`RESIDENTIAL`, `DATACENTER`, or null).
- **Alternate market price.** A country-priced page read without its country proxy now caps confidence at 0.5 and is flagged as unverified in the run logic. It no longer overwrites a saved German baseline, so a non-DE IP cannot replace the DE price with another market's price.
- **Tests.** Valid default and per-host session ids, sanitizing a hyphenated id, the SDK-shaped validation error, no datacenter fallback on that error, generic `newUrl` fallback, proxy group and country on the page and the row, the run summary callbacks, and the unverified-market baseline rule.

### 1.0.4

Proxy and fallback fixes from the 88-URL live test.

- **Proxy logger crash.** `createProxyProvider` called the Apify logger's `info` and `warning` as bare functions, so the Apify/Crawlee `this.internal` binding was lost and every proxy attempt threw right after the configuration opened. The logger methods are now called on the logger object, with a regression test that uses a `this`-dependent logger.
- **Residential refusal at URL time.** A `newUrl` error for the residential group (for example HTTP 407 on a free plan) now switches the run to the default datacenter group instead of leaving the request direct.
- **Served log names the group.** The "Served … through Apify Proxy" line now says whether RESIDENTIAL, a custom group, or the default datacenter group served it.
- **Bot challenge stubs.** A small no-product stub seen when no proxy URL could be produced is reported as a bot challenge, not `no_data`.
- **Alternate market price.** A country-priced page read without the country proxy keeps a confidence below 0.9 and says the market price may differ.
- **WordPress 520.** A WordPress/WooCommerce host gets one short-backoff retry on HTTP 5xx, then the product is read from the WooCommerce Store API by URL slug before the row fails (April Söderström).
- **Tests.** This-bound logger, `newUrl` residential fallback, WordPress 5xx backoff, challenge stub without a proxy URL, WooCommerce 520 Store API fallback, and Alternate confidence.

### 1.0.3

Proxy and blocked-page fixes from the 88-URL live test.

- **Apify Proxy actually opens.** The input proxy object is mapped explicitly to the SDK's `groups`, `countryCode`, and `proxyUrls`. An empty country is no longer sent as `countryCode: null`, which made `createProxyConfiguration` fail and left every request direct. A missing or failing `newUrl` is logged instead of returning null silently.
- **Residential fallback.** When the account cannot open the RESIDENTIAL group, or the proxy answers HTTP 407 for it, the Actor uses the default datacenter group, logs which group served the requests, and reports `blocked_needs_residential_proxy` if the shop still refuses.
- **HEMA-style 403 retry.** A 403 first retries directly with the honest bot user agent, then goes through the proxy.
- **Bot challenge stubs.** A page under about 5 KB with no product markup is retried through the proxy instead of becoming `no_data` (Clas Ohlson).
- **Alternate price.** The adapter prefers the JSON-LD Offer whose `url` is the requested product and reads a rendered price only from the main product price container, so a recommendation card can no longer supply the price.
- **Tests.** Proxy mapping and residential fallback, bot-UA then proxy retry, dispatcher on the proxied request, small challenge stubs, the residential status, and an Alternate fixture with recommendation blocks.

### 1.0.2

Live accuracy fixes for blocked pages, login-only prices, market-specific prices, store JSON endpoints, and currency inference.

- **Optional proxy retry.** New `proxyConfiguration` input (off by default). A 403, 429, 5xx, dropped connection, or bot challenge is retried once through Apify Proxy, with residential when available. Requests use a Chrome user agent, browser headers, and an Accept-Language from the shop's locale; `botUserAgent` makes the Actor identify itself instead.
- **Biltema and Aponeo request paths.** Both adapters keep the exact request the old single-store monitors used. Biltema no longer returns 403 and Aponeo no longer reports `fetch failed`.
- **Praxis public price.** The adapter runs before generic JSON-LD. A Praxis Plus login-only offer (`isLoginPromotion`) is written to the new optional `memberPrice` field, and `price` keeps the public shelf price (7.49 instead of 5.61).
- **Alternate DE market.** The adapter reads the German rendered price and prefers it over a different JSON-LD offer, pins `de-DE`, and asks for a German proxy country when the proxy is on.
- **Shopify and WooCommerce JSON fallbacks.** A Shopify page without product JSON-LD is read from `products/<handle>.js` or `.json` (variant price, stock, `?variant=`); a WooCommerce page without JSON-LD is read from the Store API (`prices.price / 10^currency_minor_unit`, currency code).
- **Currency inference.** A bare `$` is never mapped to USD. Currency comes from an adapter hint, `og:locale`, the HTML language, or a country TLD such as `.com.au`, `.ca`, `.co.nz`, and `.co.uk`; otherwise it stays null with the low-confidence regex row. `houseofmalt.co.uk` now reports GBP.
- **Pricing.** `pricing-ppe.json` matches the live amounts: `apify-actor-start` 0.0005, `product-checked` and `price-changed` 0.002 flat on every tier.
- **Tests.** Offline fixtures for the Praxis member price, the Alternate DE price, the Shopify and WooCommerce JSON payloads, and the currency rules.

### 1.0.0

First build. One Actor watches public price and stock for product URLs from any shop. The extraction chain is JSON-LD, microdata, OpenGraph, Shopify/WooCommerce/Magento markup, 68 ported retailer adapters, and a low-confidence regex fallback. Pricing in `pricing-ppe.json` is a proposal and is not applied on the platform.
