# Changelog of Baidu Maps Scraper (`searchapi/baidu-maps-scraper`) Actor

- **URL**: https://apify.com/searchapi/baidu-maps-scraper/changelog.md
- **Full Actor documentation**: https://apify.com/searchapi/baidu-maps-scraper.md

## Changelog

### \[3.2.1] - 2026-09-06

- Classify Baidu `anti_auth`/interactive verification failures as `TARGET_VERIFICATION` in sanitized logs so they are distinguishable from browser or DNS errors.
- Keep the fail-closed behavior: challenge pages never become dataset records.

### \[3.2.0] - 2026-09-05

- Replaced the DNS-sensitive Crawlee browser launcher with a direct persistent Playwright context so Baidu Maps can be reached when the host resolver is unavailable.
- Added bounded public-DNS resolution for the official `map.baidu.com` hostname, optional authorized proxy launch support, shared cookies, bounded retries, and query concurrency.
- Made the search button interaction explicit while retaining keyboard fallback for the live Baidu Maps SPA.
- Added the `blockMedia` developer option and recorded DNS/transport mode in the safe `OUTPUT` summary.
- Kept interactive verification fail-closed; challenge pages are never stored as dataset records.

### \[3.1.0] - 2026-09-05

- Added fair per-query buffering and round-robin interleaving before the global `maxItems` limit is applied.
- Added category, rating, review-count, and open-now filters plus name, rating, review, distance, and relevance sorting.
- Added API status/content-type/total-result provenance, extraction method, query position, global position, and an `OUTPUT` run summary.
- Added complete input editors, output/key-value-store schemas, README validation, and focused developer controls.

### \[3.0.0] - 2026-08-28

#### Added

- API-first extraction for validated Baidu Maps `qt=s` responses, including nested response arrays and a maintained DOM fallback.
- Stable UID/hash identifiers, global deduplication, explicit no-results handling, and batch `queries` with bounded concurrency.
- A typed 79-field dataset contract with required common fields and clean omission of unavailable optional values.
- Visibility-aware challenge detection, safe response-shape diagnostics, and Actor status messages.

#### Changed

- Pagination now remains inside the active Baidu Maps SPA page so cookies, anti-auth state, and search state are preserved.
- Dependencies and Docker browser image are pinned to Apify 3.7.2, Crawlee 3.17.0, and Playwright 1.61.1.
- Chinese abbreviated review counts such as `1.2万` are normalized to integers.

#### Security

- Transport payloads are mapped to the documented schema instead of being stored raw.
- Response status and content type are checked before JSON parsing; challenge payloads never reach the dataset.
- Production dependency audit reports zero known vulnerabilities.

### \[2.0.0] - 2026-06-12

#### Added

- **Canonical schema integration** — all records now flow through
  `normalizeMapRecord` from `_canonical/normalize.js`, producing a
  uniform 64 field dataset that matches the Bing / Google / Brave /
  Baidu `*.schema.json` family.
- **64 dataset fields per POI** (see `README.md` "Output" for full list):
  - **Identity**: `type`, `resultType`, `position`, `page`, `name`, `uid`, `poiId`
  - **Location**: `address`, `city`, `state`, `region`, `country`, `postalCode`,
    `latitude`, `longitude`
  - **Contact**: `phone`, `phoneRaw`, `website`, `email`
  - **Categorization**: `category`, `categories`, `tags`
  - **Ratings**: `rating`, `ratingRaw`, `ratingCount`, `reviewCount`,
    `reviewCountRaw`, `reviewSnippet`
  - **Pricing**: `price`, `priceNumeric`, `priceLevel`, `currency`
  - **Hours**: `hours`, `openingHours`, `isOpen`, `isOpenNow`,
    `businessStatus`
  - **Status flags**: `isClaimed`, `isVerified`, `isPermanentlyClosed`,
    `isChain`, `chainName`
  - **Distance / navigation**: `distance`, `distanceUnit`,
    `navigationUrl`, `directionsUrl`
  - **Rich data**: `description`, `thumbnail`, `imageUrl`, `images`,
    `facilities`, `paymentOptions`
  - **Links**: `link`, `detailUrl`, `domain`, `favicon`
  - **Engine identity**: `engineId`, `engineData`
  - **Search context**: `searchQuery`, `searchUrl`, `market`, `language`,
    `scrapedAt`, `searchMetadata`
- **2 views** in dataset schema: `overview` (key fields) and
  `fullDetails` (all fields)
- **POI UID extraction** — extracts Baidu Maps POI UID from card links
  or `data-uid` / `data-poi-id` attributes (`utils/extractPoiUid`)
- **Coordinate extraction** — parses `lng,lat` pairs from card text
  (both must have decimal points) and from `window.point` /
  `window.bdPoint` BMap globals
- **Rating parser** — `parseRating` extracts 0-5 numeric rating
- **Review count parser** — `parseReviewCount` handles Chinese
  "1.2万条评价" notation
- **Price parser** — `parsePrice` extracts numeric price, currency
  (¥ / ￥ / 元 / RMB / CNY / $ / USD / € / EUR / £ / GBP / ₹ / INR),
  and price level marker (`$`, `$$`, `$$$`, `$$$$`) from `$`-style
  prices
- **`toPriceLevel` helper** added to `_canonical/normalize.js` —
  converts `$`/`$$`/`$$$`/`$$$$` strings or 1-4 integers to a normalised
  level
- **New input fields**: `startUrls`, `region`, `maxPages`, `market`

#### Changed

- **Breaking** — actor version bumped to 2.0.0
- **Breaking** — schema expanded from ~12 fields to **64 fields** and
  aligned with the canonical `_canonical/normalize.js` `normalizeMapRecord`
  contract
- Cleaner `main.js` — extraction logic moved to `routes/handlers.js`
- `package.json` no longer runs `crawlee install-playwright-browsers`
  postinstall (Playwright browser is now part of the Docker base image)
- `pushData` block now delegates to `normalizeMapRecord`, eliminating
  field-by-field hand-rolled record assembly

### \[1.0.0] - 2025-07-01

#### Added

- Initial release of the actor
- Basic POI extraction with name, address, phone, rating
