# Changelog of Google Trends Scraper (`sourabhbgp/google-trends-scraper`) Actor

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

## Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### \[Unreleased]

### \[0.3.1] - 2026-05-17

#### Fixed

- Trending mode no longer uses BasicCrawler + RequestQueue. Per-request queue storage cost (~$0.000018/write × 4 writes per Request) dominated the sub-second RSS fetches and made daysBack=90 ~80% more expensive than v0.2 despite being faster. Replaced with a lightweight promise pool (`mapWithConcurrency`). Result: T\_HUGE (daysBack=90) now ~25% cheaper than v0.2 at 2x the speed.

### \[0.3.0] - 2026-05-17

#### Added

- `trendingConcurrency` input (1-15, default 8). Parallel RSS fetches via crawlee BasicCrawler.
- `exploreConcurrency` input (1-5, default 3). Parallel Playwright pages on a shared browser context.

#### Changed

- Trending mode now fetches days in parallel via a lightweight promise pool (no RequestQueue). Sub-second RSS fetches don't justify BasicCrawler/RequestQueue per-request storage overhead.
- Explore mode now runs N keywords in parallel across a pool of Playwright pages (single shared browser, single cookie warmup) via BasicCrawler. Within each keyword, the 4 widget API calls (multiline / comparedgeo / relatedsearches × 2) now run in parallel via `Promise.all`.
- Charging adopts the charge-first/push-after pattern so budget-capped runs no longer leak one paid-for row past the cap.

#### Removed

- `TRENDING_DAY_DELAY_MS` (300 ms serial delay between days). Concurrency replaces it.
- `EXPLORE_DELAY_MS` (500 ms serial delay between keywords). Concurrency replaces it.

### \[0.2.0] - 2026-04-27

#### Added

- `language` input (16 locales: en-US, en-GB, pt-BR, pt-PT, es-ES, es-MX, fr-FR, de-DE, it-IT, ja-JP, ko-KR, zh-CN, zh-TW, ru-RU, hi-IN, ar-SA). Applies to both trending and explore modes.
- `daysBack` input (1–90) for trending mode — fetches RSS for the end date plus N-1 prior days.
- `date` input (YYYY-MM-DD) for trending mode — end of the daysBack window. Defaults to today in the chosen timezone.
- `timezone` input (IANA names, ~22 supported) for trending mode.
- Trending output now includes `date` and `language` fields on every record.
- README "MCP / Agent Usage" section with a verified multi-parameter invocation.

#### Changed

- Default `tz` for explore mode is now `0` (UTC) instead of the prior hardcoded `240` (US-Eastern DST). Records near midnight may now be assigned to a different calendar day. Pass `timezone=America/New_York` for prior behavior.
- `maxResults` semantics: with `daysBack > 1`, the cap applies per day, not total.
- `maxResults` schema range narrowed to `1–50` (default `10`), down from `1–200` (default `50`). Google's trending RSS returns up to ~10 items per day per country — higher values had no effect and the documentation now reflects reality.

#### Fixed

- Historical trending with `daysBack=1` and an explicit past `date` no longer silently returns today's data. The RSS URL now always includes the `date` query param so the snapshot endpoint is hit consistently.
- The actor no longer FAILs on user-input mistakes. Per project policy, `Actor.fail()` is reserved for unexpected internal errors. Invalid inputs (bad language, timezone, geo, date, daysBack out of range, etc.) are auto-fixed to safe defaults with a warning logged. Zero-result runs now SUCCEED with a warning explaining why and the user is not charged. This protects the store-displayed success rate.

#### Performance

- Lowered `defaultMemoryMbytes` from 1024 to 512, `minMemoryMbytes` from 256 to 512, `maxMemoryMbytes` from 4096 to 2048. Real peak memory observed in production: 120–237 MB across both modes. The 1024 MB default was charging users ~4× more in compute units than needed; the new 512 MB default still gives 2× headroom over peak. Net effect: default-tier users pay ~half the compute cost for the same data.

#### Internal

- Added `node:test` test runner via `pnpm test`.
- Added `pnpm typecheck` script.
- Refactored URL-building to pure functions for testability.

### \[0.1.0] - 2026-04-25

#### Added

- Initial release split out of the bundled `apify/actors/` repository into its own repo under the `scrapeforge` organization.
- pnpm as the package manager (pinned via `packageManager` field).
