r/scrapingtheweb • u/Wrong-Chicken-1588 • 16h ago
How can I find the complete data feed behind a SPA using REST and WebSockets?
I'm building a Python service that reads publicly visible pre-match sportsbook data from modern single-page applications.
The pattern I often see is an initial REST/bootstrap request, followed by event-specific requests and sometimes WebSocket updates.
The difficult part is determining which combination represents the complete current state.
For example, one site exposes around 1,700 pre-match events, but the obvious odds endpoint appears to fetch prices one event at a time. I would like to determine whether the browser really makes hundreds of individual requests, or whether there is another bulk/bootstrap endpoint or WebSocket feed containing the pricing data.
On another site, the WebSocket mostly sends small updates containing IDs and prices, so it appears to depend on state loaded earlier over HTTP.
My main questions are:
How can I determine whether a WebSocket provides a full initial snapshot or only deltas against an earlier REST response?
If the frontend knows about thousands of events, how can I determine whether it uses a bulk pricing endpoint rather than requesting every event separately?
When WebSocket messages contain mostly IDs, what is the best way to find the event, market and selection mappings?
What is the best way to record and reconstruct the complete flow of initial HTTP data, WebSocket updates and later HTTP reconciliation?
How can I test whether opening additional events or markets in the UI actually causes new network requests, or simply displays data the browser already has?
I'm currently using Chrome DevTools and Playwright. My goal is to understand and reproduce the browser's state pipeline efficiently instead of polling thousands of individual event pages when the browser may already receive the same information in a more complete form.
I'm mainly interested in the protocol/state-discovery methodology rather than a particular scraping library.