# Changelog of Brave Search Scraper (`searchapi/brave-search-scraper`) Actor

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

## Changelog

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

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

#### Changed

- Updated organic-card extraction for Brave's current document-wide `[data-pos][data-type="web"]` layout.
- Added explicit selector-drift detection so a representative search cannot silently succeed with an empty dataset.
- Published a typed 59-field JSON-schema contract with required common fields and recursive empty-value omission.
- Added reproducible Firefox/Docker installation, exact Apify/Crawlee/Playwright versions, generated metadata, and patched production dependencies.

#### Verified

- Eight tests pass; Apify input and dataset schemas validate; production dependency audit reports zero vulnerabilities.
- Historical local storage contained three unique, clean records with 34–44 fields each and no empty, URL, duplicate, block-page, or sensitive-data findings.

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

#### Breaking

- Replaced the stale canonical adapter with a Brave-specific normalized organic-result contract.
- `maxPages` now follows Brave's page-indexed `Next` links; fabricated numeric offsets are no longer used.

#### Added

- Captures publisher names and displayed URL paths, deep links, breadcrumbs, source URLs/domains, description aliases, image metadata, canonical URLs, Safe Search, and shared search metadata.
- Uses one shared scrape timestamp for every record and relative publication-date conversion.
- Adds bounded navigation retries, response/content-type checks, block-page detection, Safe Search verification, page limits, headless control, and proxy support.
- Adds tests for input validation, URL filters, relative dates, rich normalization, and canonical URL deduplication.

#### Fixed

- Corrected the live Brave selectors for displayed URLs (`cite.snippet-url`), deep links (`.deep-link`), and result thumbnails.
- Stopped storing favicon images as result thumbnails.
- Removed the non-functional API interception assumption; current Brave Search exposes only feedback requests, so stable DOM extraction is used.
- Removed reserved Apify fields from the dataset schema field map while retaining them in dataset views.
- Upgraded Apify, Crawlee, Playwright Firefox, and dependencies.

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

#### Added

- **New dataset fields** (41 total, up from 30): `resultType`, `titleHtml`, `url`, `description`, `reviewCount`, `category`, `tags`, `isAd`, `isSponsored`, `comments`, `query`.
- **New view**: `fullDetails` — all 41 fields in a single table.
- **Missing fields filled in** by `normalizeOrganicRecord` from the canonical normalizer.
- **INPUT.json** added at the project root for local validation.

#### Changed

- **Schema expanded** to 41 fields with full `fullDetails` view for downstream consumption.

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

#### BREAKING

- Renamed `siteLinks` → `sitelinks` (canonical lowercase, per `_canonical/CONTRIBUTING.md`).
- Replaced ad-hoc field shape with the canonical search-vertical schema. All records now pass through `_canonical/normalize.js` before being pushed. The output is a strict subset of `_canonical/schemas/search.schema.json`.
- Bumped major version because downstream consumers reading `siteLinks` must update to `sitelinks`.

#### Added

- **Identity & URL fields**: `favicon`, `displayedUrl`.
- **Snippet enrichment**: `snippetHtml` (preserves `<mark>`/`<b>`/`<em>`), `emphasis[]`.
- **Navigation**: `breadcrumbs[]`, expanded `sitelinks[]` with deduplication.
- **Rich-result metadata**: `rating`, `ratingCount`, `price` + `priceNumeric` + `currency`, `richResultType`, `additionalInfo[]`, `cacheLink`.
- **Date**: `publishedAt` (ISO-8601) alongside the raw `date` string.
- **Run context**: `page`, `searchUrl`, `searchMetadata`, `type` (`"organic"`).
- **Selectors**: Resilient fallbacks for favicon, rating, price, breadcrumbs, cache link, rich-result type indicator.
- **Shared validator/normalizer** wired to `_canonical/`.

#### Changed

- Handler normalizes every record before pushing.
- Search URL recorded per-page and embedded in each record.
- `pageNum` threads through to `position` and `page`.

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

#### Added

- Initial production release of the Brave Search Scraper.
- `PlaywrightCrawler`-based architecture using Firefox (`apify/actor-node-playwright-firefox`).
- Modular project structure.
- `.actor/actor.json`, `input_schema.json`, `dataset_schema.json` for Apify platform compatibility.
- `validate-datasets.js` for local dataset output validation.
- `Dockerfile` using `apify/actor-node-playwright-firefox` image.
- `README.md` with full Apify usage guide.
