# Changelog of Brave Images Scraper (`searchapi/brave-images-scraper`) Actor

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

## Changelog

All notable changes to the Brave Images Scraper are documented here.

### \[3.3.0] - 2026-10-25

#### Fixed

- Brave's SvelteKit serializer now wraps each hydration `data` entry in an immediately-invoked function expression that hoists repeated strings into parameters, which the static decoder rejected with `Unsupported hydration expression: CallExpression`. The decoder now binds the decoded arguments to the callee's parameter names and decodes only the returned expression (no page code is executed); the DOM/detail path remains the fallback. `retrievalMethod` is `structured_sveltekit_hydration` again.
- Every inline script is now tried longest-first and the first payload matching the requested query wins, so a page whose largest script is not the SvelteKit bootstrap can still be parsed.
- The query is no longer required to sit next to the image response, and an image result is recognized from `properties.url` / `thumbnail.original` / `thumbnail.src`, so a payload whose query field moved still validates.

#### Added

- `hydrationKeys` and `fieldCoverage` diagnostics on the success path, and `inlineScripts` / `imagesResponseMarkers` / `imageResultMarkers` on the failure path, so a field that stays empty can be shown to be absent in the live payload rather than unfetched.

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

#### Changed

- Switched local and Docker browser execution from Firefox to Chrome/Chromium to match the current Brave Images page.
- Added dataset auditing, a generated-by metadata marker, and richer local validation scripts.

### \[3.1.0] - 2026-08-29

#### Added

- Safe, non-executing AST parsing of Brave's SvelteKit hydration response, with strict payload/query validation and DOM/detail fallback.
- Single-query, deduplicated multi-query, fair batch, exact one-item, filtered, and structural no-results modes.
- Stable query-aware SHA-256 IDs, global/query/request positions, global canonical image deduplication, source fetch dates, family-safety fields, ranking confidence, and explicit provenance.
- Bounded concurrent browser pages, coherent locale/timezone/viewport settings, stable proxy sessions, all-or-nothing batch writes, and verified image/media/font blocking.
- Ten focused unit tests plus local default, batch, filtered, one-item, no-results, invalid-input, proxy-disabled, and proxy-requested test inputs.

#### Changed

- Replaced the normal click-per-card path with fast structured extraction of up to roughly 200 current candidates per query.
- Aligned local and Docker Playwright Firefox to `1.62.1`, pinned Apify/Crawlee/Playwright/Acorn dependencies, and removed all production vulnerability findings.
- Replaced the invalid dataset view contract with a wrapper-valid 86-field schema; missing optional values are omitted rather than fabricated.
- Reduced temporary retries to one by default and never retries explicit challenge pages.

#### Removed

- Hard-coded obsolete Firefox user agent and unused API detector.
- Storage of opaque Brave debugging, tracking, and similar-image request state.
- Fabricated `false` advertising/sponsorship flags when Brave did not expose those values.

### \[3.0.0] - 2026-07-20

#### Added

- Source-backed detail-panel extraction for original image URLs, host pages, full dimensions, source attribution, previews, and favicons.
- Bounded retry/backoff controls and one consistent rotating proxy session per run.
- Strict input validation and focused normalization, URL, filter, and deduplication tests.

#### Changed

- Upgraded Apify, Crawlee, Playwright, and the Firefox Docker image to compatible current versions.
- Validates HTTP status/content type and confirms that Brave retained every requested search filter.
- Defaults the sample run to Apify Residential Proxy because Brave rate-limits the local host IP.
- Updated the dataset contract and views for the 60-field output.

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

#### Added

- **Schema expanded** from 24 to **48 fields**.
- **New fields**: `type`, `resultType`, `alt` (alias), `url`, `link`, `thumbnail`, `originalUrl`, `format`, `mimeType`, `size`, `dominantColor`, `orientation`, `isAd`, `isSponsored`, `hostPageUrl`, `domain`, `hostPageDomain`, `source`, `favicon`, `photographer`, `copyright`, `query`, `searchUrl`, `language`, `searchMetadata`.
- **New view**: `fullDetails` — all 48 fields in a single table.
- **INPUT.json** added at project root for local validation.

#### Changed

- `dataset_schema.json` now exports 2 views: `overview` and `fullDetails`.

### \[2.0.0] - 2026-06-12 (Brave refactor)

#### BREAKING

- Replaced ad-hoc dataset shape with the canonical image-vertical schema. All records now pass through `_canonical/normalize.js` `normalizeImageRecord` before being pushed. The output is a strict subset of `_canonical/schemas/images.schema.json`.

#### Added

- **Identity**: `altText` (raw `alt` attribute), `page` (1-based page number).
- **Dimensions**: `aspectRatio`, `fileFormat`, `fileSize`, `isAnimated`.
- **Visual properties**: `color`, `isAdult`.
- **Source attribution**: `sourceUrl`, `creator`, `creatorUrl`, `license`.
- **Selectors**: Resilient fallbacks for source URL, creator, license, dominant color, NSFW flag.
- **Helpers**: New `enrichImageItem(raw)` computes derived fields.
- **Shared validator/normalizer** wired to `_canonical/`.

#### Changed

- Handler normalizes every record before pushing.

### \[1.0.0] - 2025-05-20

#### Added

- Initial production release of the Brave Images Scraper.
- `PlaywrightCrawler`-based architecture using Firefox.
- Modular project structure with `main.js`, `routes/`, `extractors/`, `filters/`, `schema/`, `utils/`, `errors/`.
- `.actor/actor.json`, `input_schema.json`, `dataset_schema.json`.
- `validate-datasets.js` for local dataset output validation.
- `Dockerfile` using `apify/actor-node-playwright-firefox` image.
- `README.md` with full Apify usage guide.
