Home / Tutorials / Reference
Reference

Stream new SEC filings in real time with Server-Sent Events

Receive every new EDGAR filing seconds after it is published with a Server-Sent Events stream, filter by form type or CIK, or use webhooks.

EDGAR publishes thousands of filings a day. Polling search endpoints for new ones is slow and wasteful. /v1/stream pushes each new filing to you over Server-Sent Events (SSE) as soon as SecFeed sees it in EDGAR's live feed.

Look at recent stream events

/v1/stream/latest returns what the stream delivered most recently, which is a good way to see the event shape before you connect:

import os
import requests

BASE = "https://secfeedapi.com"
HEADERS = {"Authorization": f"Bearer {os.environ['SECFEED_KEY']}"}

latest = requests.get(f"{BASE}/v1/stream/latest", params={"size": 5}, headers=HEADERS, timeout=60).json()
for f in latest:
    print(f["filedAt"], f["formType"], f["companyName"], f["role"])

Output (the last filings before the weekend):

2026-10-09T21:56:14-04:00 4 FRIEDMAN BRIAN P Reporting
2026-10-09T21:45:05-04:00 3 Bregier Fabrice Roger Daniel Reporting
2026-10-09T21:40:53-04:00 3 Zavakopoulos Petros Reporting
2026-10-09T21:40:51-04:00 3 Panagiotidis Petros Panagiotis Reporting
2026-10-09T21:40:50-04:00 3 Syriopoulos John Paul Reporting

role tells you whether the CIK is the filer, the subject company or a reporting owner. An ownership filing such as a Form 4 can appear once for the insider (Reporting) and once for the company (Issuer).

Connect to the stream

The stream is a long lived HTTP response. Each filing arrives as an SSE event named filing with the JSON on the data: line; comment lines (: keep-alive) arrive every 15 seconds so idle connections stay open.

import json
import os
import requests

BASE = "https://secfeedapi.com"
HEADERS = {"Authorization": f"Bearer {os.environ['SECFEED_KEY']}"}

with requests.get(f"{BASE}/v1/stream", params={"formTypes": "8-K,4"}, headers=HEADERS, stream=True, timeout=(10, 60)) as r:
    for line in r.iter_lines(decode_unicode=True):
        if line and line.startswith("data: "):
            f = json.loads(line[6:])
            print(f["filedAt"], f["formType"], f["companyName"], f["linkToFilingDetails"])

Filter with formTypes (comma separated) and ciks. Each event also carries seenAt and latencyMs, the delay between EDGAR's timestamp and SecFeed seeing the filing. /v1/stream/latency?hours=24 summarizes those delays.

Reconnect on errors

Networks drop long connections. Wrap the loop in a retry with a short backoff, and after reconnecting call /v1/stream/latest to catch anything you missed.

Prefer push to your server? Use webhooks

POST /v1/webhooks with a JSON body {"url": "https://...", "formTypes": ["8-K"], "ciks": []} and SecFeed posts new filings to your HTTPS endpoint.

Next steps

More reference tutorials

Run this tutorial with your own key

500 free API calls a month. Every example on this page works on the free plan.

Get free API key →