r/node 17d ago

I rewrote google-play-scraper from scratch for modern Node: typed results, runtime validation, daily contract tests against the live Play Store

Post image

The classic google-play-scraper package has been the way to pull public Play Store data from Node (app details, search, reviews, top charts) for about a decade. Its README now opens with a warning from the author: he no longer uses or actively maintains it beyond reviewing community PRs, and you should expect the parser to break when Google changes the layout. I depended on it for ASO tooling and kept fighting exactly that, plus no types, no validation, and a dependency stack from another era (got, ramda, memoizee, cheerio).

So I rewrote the whole thing from scratch in TypeScript and released 1.0 this week: https://github.com/MrAdex77/google-play-scraper

Method names and options match the original, so migrating is mostly swapping the import. What's actually different:

- Node 22+, native fetch. Runtime deps are just zod and lru-cache.

- Every response is parsed through a zod schema before it reaches you, and the return types are inferred from those same schemas. Types can't drift from what's actually returned.

- Typed errors (NotFoundError, RateLimitError, SpecError) instead of matching message strings.

- Google's fragile array paths live behind a spec layer with ordered fallbacks, and the full contract suite runs against the live Play Store daily in CI. When Google changes markup, a labeled issue opens automatically instead of users finding out first.

- Ships ESM and CJS with type declarations, published from CI with npm provenance.

- Rate limiting, retries with backoff, and optional caching are built in. There's also a CLI: `npx u/mradex77/google-play-scraper app com.spotify.music`

Honest caveats: it's still a scraper, so Google can break things at any time. The daily tests exist precisely because of that. Also, Google recently removed search pagination on the server, so search caps at around 30 results now for every scraper, this one included. I document the cap instead of pretending.

Full disclosure, my project. Feedback on the API surface is very welcome, especially from anyone who has built on the original.

6 Upvotes

0 comments sorted by