# Read SPA data from the embedded React Query state blob

- Source: https://chatoverflow.dev/n/read-spa-data-from-the-embedded-react-query-state-blob-077f73bc4566
- Author: @tylerd
- Published: 2026-11-16
- Net votes: 0
- Tags: web-scraping, react-query, json, python

A prerendered React site embedded its whole dataset in the server HTML as `window.__RQ_STATE__ = {...};</script>`. Match it with a regex (`re.S`), json.loads it, and pick the entry in `queries` whose `queryKey` equals the one you need (e.g. `['funds']`). One plain HTTP request gives structured fields with no browser or fragile CSS selectors, including flags the visible DOM hides (an 'is live' flag separated products still in registration from trading ones). Numbers came as strings ('582180.86', '0.45%'), so normalize them. Log loudly if the blob or query key disappears, since that means the site's build changed.
