# Changelog of Google Maps Leads Scraper – Emails, Phones & Socials (`badr_xba/google-maps-scraper`) Actor

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

## Changelog

### 2026-11-28 owner retry rule (no price / field / event change; not released yet)

- **Technical error** (network error, timeout, Google 5xx, cut answer): at most 2 new tries (3 requests), on the
  same route. A run without proxy stays direct; a run with a proxy keeps that proxy type (new session).
- **Real refusal** (CAPTCHA / "unusual traffic" page, consent or login wall, HTTP 401/403/429): BLOCKED at once,
  not billed, no new try. Only exception: a 429 with `Retry-After` <= 10 s gets 1 new try after the wait, same
  address, once.
- **No more datacenter fallback**: before, the 1st request was direct and the next ones (up to 5 in all, 4 for place
  details) went through the Apify datacenter proxy, refusals included. Business websites are read on one route only
  (direct, or your own proxy URLs), and a site that refuses a page is not asked again in the run.
- OpenStreetMap geocoding follows the same rule (403/429 no longer retried). Place details asked by link / place ID
  that Google refuses are now listed in `FAILED_INPUTS` as `BLOCKED` (before: `PLACE_NOT_FOUND`).
- Shared code: `src/retry_rule.py` (same file in the 4 Google Maps Actors). Tests: `tests/test_retry_rule.py`.

### 2026-11-22 fix: no fake e-mails shown (no price / field / event change)

- **Cause**: pages that carry their text as JSON write `>` as `\u003e`, so `\u003einfo@site.com` was shown as the
  e-mail `u003einfo@site.com`; form examples and placeholders (`e.g. name@gmail.com`,
  `<input placeholder="you@outlook.com">`) could be shown as the place's e-mail. E-mails are not billed in this
  Actor, but these values were wrong data in the `email` / `emails` fields.
- **Fix**: JSON escapes are decoded first, escape residue is removed, and an address announced as an example or a
  placeholder just before it (same tag or text, 60 characters) is dropped, except on the website's own domain.
  Found on https://www.vinted.com/help (3 fake for 3 real). Tests: `tests/test_fake_emails_json.py`.

### 1.0.40 — 2026-11-21 fix: hidden e-mail search froze runs (no price / field / event change)

- **Cause**: the search for hidden e-mails written as `name at domain dot com` (and the plain e-mail regex) had no word boundary and no length limit; on long website pages (minified code, base64) it became quadratic: 2–7 s per page on a PC, minutes at Apify's CPU share. Runs with website contacts on a big city made no request for 5 minutes and ended **TIMED-OUT with 0 places** (2 public runs of 1.0.39 on 2026-11-21, found by the public-tasks check).
- **Fix**: both regexes start at a word boundary and cap the lengths (local part 64, domain 253): 0.07 s per page, same e-mails found. Website reading also gets a time budget up to the stop point before the run limit; past it, places are delivered with the contacts already found.
- **Proof**: private copy, Los Angeles, 100 restaurants with contacts: before TIMED-OUT 0 places in 300 s, after 100 places (49 with e-mail) in 84 s. Release comparison old vs new on the same input: same places, same billing.
- Tests: `test_website_reading_has_a_time_budget`, `test_email_regexes_stay_fast_on_long_letter_runs`.

### 2026-11-11 hotfix city (no price / field / event change)

- **City parsing**: a street was saved as `city` when the address had a note or a two-part street before the city line (`"West Olympic Boulevard"` for a place in Los Angeles, with the street number 11400 saved as postal code instead of 90064). The city now comes from Google's structured locality first, then the address line that holds it (postal code / locality match), then Google's locality block; postal codes, CEDEX, UK postcodes and arrondissements are stripped; street words, house numbers and plus codes are never a city: `null` rather than a street. `postalCode`, `state` and `cityLine` are read on that same line. Same fix as google-maps-business-leads build 0.1.6. Tests: `tests/test_city_parsing.py`.

### 2026-11-09 (review invitation)

- Successful runs that saved at least one result end their status message with one short, optional invitation to leave a Store review or open an issue (never on failed or empty runs); README section "Feedback and reviews". Output and billing unchanged.

### 2026-11-08 (visual kit 1.1.0)

#### Added

- Output fields `fid` (Google feature ID `0x…:0x…`), `kgmid` (Knowledge Graph ID `/g/…`) and `price` (price
  bracket, null when Google shows none), read at the same positions as Google Maps Scraper Pro. Existing fields unchanged.
- `FAILED_INPUTS` entries get a stable `errorCode` (`INVALID_URL`, `SHORT_LINK_EXPIRED`, `INVALID_AREA`, `NO_AREA`,
  `AREA_NOT_FOUND`, `GEOCODING_FAILED`, `PLACE_NOT_FOUND`, `BLOCKED`, `PARTIAL_BLOCKED`, `UNEXPECTED_ERROR`); the visual
  report groups failed inputs by that code.
- Visual report on kit 1.1.0: live progress page while the run is going (searches done / total, places so far; at most
  one write a minute), data-quality panel (name, phone, website, e-mail, address, category, rating, reviews, hours),
  at most 3 photos per place, photo column in the table view.
- The final report is also written when the run stops on an unexpected error (status FAILED), instead of staying
  "Running".

### 2026-11-08

#### Added

- **Place photo** `imageUrl`: Google's main photo of each place (lh3.googleusercontent.com, Google's own 408 px card
  size; a smaller thumbnail is asked at `=w408-h306-k-no` by editing only its size suffix). The search request now asks
  for the photo block the Google Maps web page asks for (`!20m…` of the `pb` parameter; before, `!20m0` = no photo).
  Null when Google has no photo for the place; Street View thumbnails, owner avatars and partner logos are never used.
  Local run 2026-11-08: 10 of 10 restaurants in Lyon with a photo, 3 URLs checked (HTTP 200, image/jpeg).
- Dataset schema: `imageUrl` declared, shown first (`"format": "image"`) in every view (Leads, Overview).
- Visual report: cards show the place photo (lazy, `referrerpolicy="no-referrer"`, category tile when null or broken).
- **Visual report** (`REPORT` record, Output tab → *Visual report*): business cards (category tile, name, rating, reviews, category, address, phone, website, e-mail, socials, opening hours, Google Maps link), key figures, rating
  distribution / top categories / top cities charts, search, filters (category, city, minimum rating, has website /
  phone / e-mail, open at scrape time), sorting, table view and CSV/JSON export of the filtered rows.
  Built by the shared `src/visual_kit.py` (v1.0.1) with this Actor's `src/report.py`. At most 2,000 rows are kept in
  memory for it; it is never billed and a report error is only logged as a warning.
- Output schema: *Visual report* link; key-value store schema: `REPORT` (text/html).

#### Tests

- `tests/test_photos.py` (8 tests): real Google answers saved 2026-11-08 with the photo block
  (`search_photos_nyc_2026-11-08.json.gz`: 20/20 photos; `search_photos_paris_2026-11-08.json.gz`: 18/20, one Street
  View-only place and one without anything stay null), old answers without the block give null, size handling, schema
  views, report cards.
- `tests/test_report.py`: 13 tests on real rows (`tests/fixtures/report_run_items.json`: 15 rows of production run lhY1AgWUngro7zPHQ + 20 rows parsed from the saved Google answer restaurant_nyc.json.gz):
  image ownership / placeholder tile, invalid image links dropped, escaping, 5,000 synthetic rows (time, size, cap
  banner), JSON export = embedded data, report errors never raise, bounded buffer, and a whole offline run whose
  `REPORT` holds exactly the rows pushed.

### 2026-11-07

#### Fixed

- `city` kept the postal code in countries that write it first (`75020 Paris`, `10115 Berlin`) or after the city
  (`London SW1A 1AA`): the city now comes alone, read from Google's structured address when it matches the line.
- `countryCode` was only the "Country of results" input (empty by default): it is now the place's own country code
  from Google (`US`, `FR`…), the input being the fallback.
- `postalCode` and `state` fall back to Google's structured address when the address line gives none (alphanumeric
  postal codes: UK, Canada, Netherlands…).

#### Improved

- Websites (e-mail / social enrichment): page bodies are streamed and cut at 400 KB (before, a huge file was read
  entirely into memory first); one site gets at most 30 s per route, so a site answering byte by byte cannot hold a
  whole batch; contact pages are read two at a time instead of one by one.
- Direct Google requests (no proxy) reuse one connection pool instead of a new TLS handshake per page; cookies are
  still cleared after every request.
- Place detail requests (places given by link / place ID): exponential backoff with jitter (longer after 403/429/5xx),
  no pause after the last attempt, shared connection pool for direct requests.
- Every row is checked against the dataset schema types before it is saved (`src/validate.py`).
- Dataset schema: `reviewsCount` and `rank` declared as integers (what the code outputs), English descriptions that
  say when a field is often empty and why.
- Tests: `python -m pytest -q` (offline, real saved Google Maps answers in `tests/fixtures`); `tests/` excluded from
  the Docker image.
