# Browser Example | Stream API > Browser JavaScript code example demonstrating how to connect to the real-time SEC filings Stream API using socket.io and websocket. The example displays new filings in your browser in real-time. Source: https://sec-api.io/docs/stream-api/browser-example This guide will walk you through creating a real-time monitor for SEC filings in your web browser utilizing WebSockets and the Stream API. The provided HTML snippet with embedded JavaScript code initiates a connection to our Stream API. It displays new filings' metadata - accession number, CIK/name/ticker of the filer, and URLs to filing documents like exhibits - as they're released. **Steps to Follow:** 1. Copy the provided HTML and JavaScript snippet into a file named `stream-api-client.html`. Ensure you replace `YOUR_API_KEY` on the seventh line with your actual API key. 2. Open `stream-api-client.html` in your browser by double-clicking the file. Upon successful connection, you'll see "✅ Connected to Stream API. Awaiting new filings..." If there are any connection issues, an error message "WebSocket error: ERROR_MESSAGE" will appear. Whenever a new filing is received, an HTML list item (`
  • `) is dynamically created to display the filing's `formType`, `filedAt`, and other properties. This item is then added to the top of the list within ``. By following these instructions, you'll have a live SEC filings monitor right in your browser, providing you with immediate access to the latest disclosures. HTML, JavaScript ```html WebSocket Stream API Example
    Connecting...
    ``` ## Example for Connecting to Deprecated Legacy Endpoints This example illustrates the process of connecting to legacy streaming endpoints that are marked for deprecation. Please be advised that these endpoints will be phased out on April 5, 2024. To ensure uninterrupted access and take advantage of enhanced functionality, we strongly recommend migrating to the newly available endpoint as soon as possible. HTML, JavaScript ```html
    Connecting...
    ```