# Changelog of Facebook Ad Library Scraper (`scrapeai/facebook-ad-library-scraper`) Actor

- **URL**: https://apify.com/scrapeai/facebook-ad-library-scraper/changelog.md
- **Full Actor documentation**: https://apify.com/scrapeai/facebook-ad-library-scraper.md

## Changelog

### 1.0.0

- Added target-aware live extraction.
- Added actor-specific startUrls, endUrls, and query defaults.
- Removed the former reference-site extraction implementation.

### 1.1.0

- Rows now come from Google Search results (`site:facebook.com/ads/library <keywords>`) fetched through the Apify Proxy group `GOOGLE_SERP`. facebook.com is no longer requested: its robots.txt disallows generic crawlers, and the official Ad Library API needs an access token.
- Each row carries `dataOrigin: google-serp`, the Ad Library URL as `sourceUrl`, and an ad archive ID (single-ad URLs) or Page ID (advertiser URLs), the advertiser name and Google's text snippet.
- Removed the generic page fetcher, the headless-browser fallback and its spoofed browser User-Agent, and the hard-coded datacenter proxy group.

### 1.1.1

- Stopped asking Google's redirect service (`google.com/goto`) where result links point: Google's `robots.txt` disallows `/goto?`. Results whose link is an opaque redirect are now skipped (counted as `opaque-google-link` in `RUN_SUMMARY`), so a run can return fewer rows, or fail with a message that explains why.

### 1.2.0 (2026-11-14)

- New input `resultSource`: `images` (default) reads Google Images results, `web` keeps the earlier Google web results. Google often writes web result links as opaque redirects that this Actor does not open (Google's `robots.txt` disallows `/goto?`), so many keywords returned few rows or none. In Google Images results every landing page URL is written in plain text (`data-lpage`), so images mode returns rows for those keywords.
- Images mode rows: `dataOrigin: google-serp-images`; ad archive ID (`?id=`) or Page ID (`view_all_page_id=`) and the Ad Library URL, taken from the page URL. Google titles these results only "Ad Library", so no advertiser name or text is returned in this mode (advertiser rows carry `advertiser.pageId`). Ad Library API, report and keyword-search pages are skipped.
- `maxSearchPages` in images mode: a further page (`start=10`, `20`, ...) is requested only while fewer than `maxItems` rows were found, the previous page was full (100 image results, a shorter page is the last one) and it still brought new pages. Measured 2026-11-14: for Ad Library queries the first page is usually all there is.
- The Google client now makes one retry after a timeout or connection error (no HTTP status received); an HTTP error status or a verification page is never retried. It refuses every URL except `http://www.google.com/search` and sends default headers only.
- Dataset schema: `dataOrigin` also allows `google-serp-images`; `advertiser.name` and `title` are no longer required.
- Tests: fixtures of a real Google Images page, request rules against a local fake proxy, dataset-schema check of every row.
