Reference
Everything a client needs to talk to the Signal8 real-time streams: how to authenticate, the messages in each direction, how filters match, how to resume after a disconnect, and what each error and close code means. Messages are JSON text frames.
wss://api.signal8.ai/api/v1/streamwss://api.signal8.ai/api/v1/streamAuthenticate with an existing Signal8 API key (sk_...), created on the API keys page. Server-side clients send it on the WebSocket upgrade as Authorization: Bearer sk_.... Browsers cannot set that header, so a browser client sends {"type":"auth","key":"sk_..."} as its first message, within 10 seconds of connecting. The key is never accepted in the query string, because URLs end up in logs: a URL carrying a key gets an error with code KEY_IN_URL right after the handshake, and the connection closes with 4400.
Live (sk_live_) and test (sk_test_) keys both work, and both need Pro, since a stream is not metered per request.
Pro is required
error with code PRO_REQUIRED, and the connection closes with 4003.A subscription has an id you choose, one or more channels, optional filters and an optional since cursor. Unsubscribe with the same id.
Authenticate (browser clients only)
{
"type": "auth",
"key": "sk_..."
}Subscribe
{
"type": "subscribe",
"id": "sub1",
"channels": [
"filings",
"filings.ai"
],
"filters": {
"tickers": [
"AAPL",
"MULN"
],
"ciks": [
"0000320193"
],
"forms": [
"8-K",
"S-1",
"424B5",
"4",
"13D"
],
"items": [
"1.01",
"3.02"
],
"event_types": [
"offering",
"reverse_split"
],
"significance": [
"critical",
"major"
],
"market_cap_min": 0,
"market_cap_max": 300000000,
"exchanges": [
"NASDAQ",
"NYSE",
"AMEX",
"OTC"
],
"security_types": [
"CS"
]
},
"since": "<cursor>"
}Unsubscribe
{
"type": "unsubscribe",
"id": "sub1"
}Ping
{
"type": "ping"
}After authentication the server sends welcome with your plan limits, and it answers each subscribe with subscribed. Events, heartbeats and errors follow.
{
"type": "welcome",
"plan": "pro",
"limits": {
"connections": 2,
"subscriptions": 10,
"tickers_per_filter": 500
}
}{
"type": "subscribed",
"id": "sub1",
"channels": [
"filings",
"filings.ai"
]
}subscribed, with a warning
{
"type": "subscribed",
"id": "sub2",
"channels": [
"filings",
"filings.ai"
],
"warnings": [
"filings: event_types can never match on this channel (the figure is not carried)"
]
}replay_complete (after a since replay)
{
"type": "replay_complete",
"id": "sub1"
}{
"type": "unsubscribed",
"id": "sub1"
}pong (reply to ping)
{
"type": "pong"
}{
"type": "heartbeat",
"ts": "2026-11-25T14:30:00Z"
}{
"type": "error",
"code": "BAD_FILTER",
"message": "forms must be an array of strings"
}{
"type": "event",
"channel": "filings",
"id": "0001234567-26-000123",
"cursor": "AAAAAEm3Kx0",
"data": {
"accession_number": "0001234567-26-000123",
"cik": "0001234567",
"company": "Example Therapeutics, Inc.",
"tickers": [
"XMPL"
],
"reporting_owner": null,
"form": "8-K",
"items": [
"1.01",
"3.02",
"9.01"
],
"accepted_at": "2026-11-25T21:05:12Z",
"time_precision": "second",
"filing_url": "https://www.sec.gov/Archives/edgar/data/1234567/000123456726000123/",
"document_url": "https://www.sec.gov/Archives/edgar/data/1234567/000123456726000123/xmpl-20261125.htm",
"received_at": "2026-11-25T21:05:14Z"
}
}Every event has the same envelope: type, channel, id, cursor and data. The fields inside data for each channel are shown on the SEC filings and press release pages.
| Channel | Arm | What it carries | When it is sent |
|---|---|---|---|
| filings | Raw (no AI) | Every SEC EDGAR filing: accession number, CIK, ticker(s), company, form type, EDGAR accepted-at time and a link to the filing. On 8-Ks, the item numbers and main document link when the EDGAR header is read in time. On insider and ownership forms, the reporting owner. | As soon as we see the filing. No AI step in the path. |
| filings.ai | AI | The same filing id plus what we read from the filing: 8-K item numbers, event type, significance, headline, summary, red flags and key figures. | When the analysis lands, which can be minutes or longer after the raw event. Only for filings under 72 hours old. |
| press_releases | Raw (no AI) | Headline, issuer, ticker(s), published-at time, a link to the release and, for syndicated releases that require one, a source credit. | As soon as we ingest the release. No AI step in the path. |
| press_releases.ai | AI | The same release id plus our AI analysis: event type, significance, summary, red flags, key figures and the tickers it attributes the release to. | When the analysis lands. Only for releases under 72 hours old. |
The raw event is never held back waiting for the AI event. The AI event carries the same id so a client can join them.
Matches an event that names any of these tickers. Up to 500 per filter.
Example ["AAPL","MULN"]
Matches the CIK (10 digits, zero-padded). Useful when a company has no ticker or changed it. Never matches a press release.
Example ["0000320193"]
Matches the EDGAR form type exactly. A trailing * matches a family by prefix: "424B*" matches 424B1 through 424B8. Without the *, "424B" matches nothing. Never matches a press release.
Example ["8-K","S-1","424B*","4"]
8-K item numbers. Raw 8-K events carry them when the EDGAR header is read within 4 seconds, else null; filings.ai events carry them too. So an items filter matches raw 8-Ks whose items were read, and AI events. A filing with no items (an S-1, a Form 4, a 6-K) never matches.
Example ["1.01","3.02"]
The AI event type. Only AI events carry it, so it never matches on the raw channels. Put it on a subscription to filings.ai or press_releases.ai.
Example ["offering","reverse_split"]
The AI significance rating: critical, major, standard or minor. AI channels only, for the same reason.
Example ["critical","major"]
Market cap in US dollars of the event's primary ticker (the first in tickers). market_cap_min is inclusive, market_cap_max is exclusive. An event with no ticker, or a company whose market cap we do not have, never matches.
Example 0 / 300000000
The listing venue of the primary ticker: NASDAQ, NYSE, AMEX, NYSE Arca or OTC (any case).
Example ["NASDAQ","NYSE","AMEX","NYSE Arca","OTC"]
Security type of the primary ticker, for example CS for common stock.
Example ["CS"]
Every filter you give must match (AND). Values inside one filter are alternatives (OR). A subscription with no filters receives every event on its channels, which on filings is the full EDGAR firehose, and Pro allows that. An event that matches several of your subscriptions on one connection is sent once.
Absent is not a match
If a filter can never match on one of the channels you subscribed to (event_types or significance on a raw channel, forms or ciks on press releases), the subscribe still succeeds and the subscribed message lists it in a warnings array.
These answer an error with code BAD_FILTER, and the connection stays open:
A filing's id is its dashed accession number. A press release's id is a stable Signal8 release id: pr_ followed by 24 hex characters. Every event also has a cursor: opaque, and one increasing sequence across all four channels, so a single cursor resumes a multi-channel subscription.
Store the cursor of the last event you handled. After a disconnect, subscribe again with that value as since: the server replays up to 24 hours of events you missed, sends replay_complete, and continues live with no gap. A cursor older than 24 hours gets a non-fatal CURSOR_EXPIRED error and a replay of the last 24 hours; anything older cannot be filled from the stream.
Make handling idempotent
channel and id.JavaScript (Node): reconnect with cursor
// npm install ws
import WebSocket from "ws";
const URL = "wss://api.signal8.ai/api/v1/stream";
const subscription = {
type: "subscribe",
id: "watch",
channels: ["filings", "filings.ai"],
filters: { tickers: ["XMPL"] },
};
let lastCursor = null; // Persist it (file, database) in production.
let attempt = 0;
function connect() {
const ws = new WebSocket(URL, {
headers: { Authorization: `Bearer ${process.env.SIGNAL8_API_KEY}` },
});
// A heartbeat arrives every 15 s. Three missed: treat the link as dead.
let watchdog;
const resetWatchdog = () => {
clearTimeout(watchdog);
watchdog = setTimeout(() => ws.terminate(), 45_000);
};
ws.on("open", () => {
attempt = 0;
resetWatchdog();
// One cursor covers every channel, so one since resumes the whole subscription.
ws.send(JSON.stringify(lastCursor ? { ...subscription, since: lastCursor } : subscription));
});
ws.on("message", (raw) => {
resetWatchdog();
const msg = JSON.parse(raw.toString());
if (msg.type === "replay_complete") console.log("caught up, live from here");
if (msg.type === "error") console.warn(msg.code, msg.message); // CURSOR_EXPIRED is not fatal
if (msg.type !== "event") return;
handle(msg);
lastCursor = msg.cursor; // save only after the event is handled
});
ws.on("close", (code) => {
clearTimeout(watchdog);
if (code === 4001 || code === 4003 || code === 4400) return; // bad key, no Pro plan or key in the URL: retrying will not help
const delay = Math.min(30_000, 1_000 * 2 ** attempt++) + Math.random() * 1_000;
setTimeout(connect, delay);
});
ws.on("error", () => {}); // "close" always follows and schedules the retry
}
function handle(msg) {
console.log(msg.channel, msg.id, msg.data);
}
connect();
Python: reconnect with cursor
# pip install websockets
import asyncio, json, os, random
import websockets
URL = "wss://api.signal8.ai/api/v1/stream"
HEADERS = {"Authorization": f"Bearer {os.environ['SIGNAL8_API_KEY']}"}
SUBSCRIPTION = {
"type": "subscribe",
"id": "watch",
"channels": ["filings", "filings.ai"],
"filters": {"tickers": ["XMPL"]},
}
last_cursor = None # Persist it in production.
def handle(msg):
print(msg["channel"], msg["id"], msg["data"])
async def run_once():
global last_cursor
async with websockets.connect(URL, additional_headers=HEADERS) as ws:
sub = dict(SUBSCRIPTION, since=last_cursor) if last_cursor else SUBSCRIPTION
await ws.send(json.dumps(sub))
while True:
# Heartbeat every 15 s; 45 s of silence means the link is dead.
raw = await asyncio.wait_for(ws.recv(), timeout=45)
msg = json.loads(raw)
if msg["type"] == "event":
handle(msg)
last_cursor = msg["cursor"] # save only after the event is handled
async def main():
attempt = 0
while True:
try:
await run_once()
except websockets.ConnectionClosed as exc:
if exc.rcvd and exc.rcvd.code in (4001, 4003, 4400):
raise # bad key, no Pro plan or key in the URL: retrying will not help
except (OSError, asyncio.TimeoutError):
pass
await asyncio.sleep(min(30, 2 ** attempt) + random.random())
attempt += 1
asyncio.run(main())
The server sends a heartbeat every 15 seconds. If you hear nothing for a few intervals, treat the connection as dead and reconnect with your last cursor. You can send {"type":"ping"} at any time; the server answers {"type":"pong"}.
| Error code | Meaning |
|---|---|
| AUTH_TIMEOUT | No auth message within 10 seconds. Closes with 4001. |
| AUTH_REQUIRED | A message other than auth arrived before the connection was authenticated. Closes with 4001. |
| AUTH_FAILED | The key is missing, invalid or revoked. Closes with 4001. |
| PRO_REQUIRED | The key's account is not on Signal8 Pro (or a grandfathered API plan). Closes with 4003. |
| TOO_MANY_CONNECTIONS | The key already has 2 connections open. Closes with 4029. |
| RATE_LIMITED | More than 30 client messages in 10 seconds. Closes with 4008. |
| SLOW_CONSUMER | The client is reading too slowly and over 4 MB is waiting to be sent. Closes with 4008. |
| BAD_REQUEST | The message is not a JSON object, has an unknown type, or a subscribe is missing its id or channels. |
| BAD_FILTER | A filter failed validation (see Filters). The connection stays open. |
| BAD_CURSOR | since is not a cursor from a previous event. |
| CURSOR_EXPIRED | The cursor is older than 24 hours. Not fatal: the server replays the last 24 hours instead. |
| TOO_MANY_SUBSCRIPTIONS | The connection already has 10 subscriptions. |
| UNKNOWN_SUBSCRIPTION | An unsubscribe named an id that is not subscribed. |
| REPLAY_FAILED | The replay from your cursor could not be read. Live events continue. |
| INTERNAL | A server-side error. |
| SERVER_RESTART | The server is restarting. Closes with 1001; reconnect with your last cursor. |
| KEY_IN_URL | The API key was put in the URL query string, where it would end up in logs. Closes with 4400. |
| STREAMS_DISABLED | The streams are switched off on our side. Closes with 4503; try again later. |
| CHANNEL_DISABLED | A channel in the subscribe is switched off on our side. Nothing is subscribed; the socket stays open. |
| Close code | Meaning | Reconnect? |
|---|---|---|
| 4001 | Authentication: no auth message within 10 s (AUTH_TIMEOUT), another message before auth (AUTH_REQUIRED), or an invalid key (AUTH_FAILED). | No. Fix the key or the client first. |
| 4003 | Plan: the key is valid but its account does not include streams (PRO_REQUIRED). | No. Upgrade to Signal8 Pro first. |
| 4008 | Rate: more than 30 client messages in 10 s (RATE_LIMITED), or a client too slow to read, with over 4 MB waiting to be sent (SLOW_CONSUMER). | Yes, with backoff and your last cursor. Read faster or narrow your filters. |
| 4029 | Too many connections: the key already has 2 open (TOO_MANY_CONNECTIONS). | After closing another connection. |
| 4400 | API key in the URL (KEY_IN_URL): the handshake completes, one error frame is sent and the socket closes. | No. Send the key in the Authorization header, or in the auth message from a browser. |
| 4503 | Streams are switched off on our side (STREAMS_DISABLED). | Later, with backoff and your last cursor. |
| 1011 | Server-side failure. | Yes, with backoff and your last cursor. |
| 1001 | Server restart (SERVER_RESTART). | Yes, reconnect with your last cursor. |
Signal8 Pro allows 2 concurrent connections per API key, 10 subscriptions per connection and 500 tickers per filter. A subscription to filings with no filters, the full EDGAR firehose, is allowed. The welcome message repeats the limits that apply to your key.
time_precision says whether a clock time is known to the second or only the date is (second or day).Open one WebSocket, send one subscribe message, and filings and press releases arrive as events. Resume with a cursor after a disconnect and the server replays up to 24 hours.
Included with Signal8 Pro, $29.50/mo or $294/yr. One API key covers the REST API, the MCP server and the streams.