Quick start · News
News feed WebSocket API quick start
Subscribe to the news feeds you want over REST, then connect one WebSocket and receive every new article as JSON with its full text. This page gets a consumer running; the API reference holds every field.
- WebSocket
wss://newsfeed.1322.io/news_<hex>?key={ws_key}- REST base
https://newsfeed.1322.io- Auth
- X-Api-Key header (REST), ?key= (WebSocket)
- Updated
What you get
Articles from the feeds you subscribe to, each with title, URL, author, categories, keywords, summary, media and the full extracted text. You choose feeds from the available feeds list and change them at any time over REST.
Articles arrive in under a second.
Price: $350/month for full news feed access; WebSocket +$100/month. Pay monthly, or prepay 3 months (10% off), 6 months (15% off) or a year (25% off). See News pricing.
Authentication
- REST calls send your API key in the
X-Api-Keyheader. GET /v1/dashboardreturns the full WebSocket URL asws_url(wss://newsfeed.1322.io/news_<hex>, without the key) and the key asws_key. Connect tows_url?key=<ws_key>. The key is only read from the query string.- For News,
ws_keyis the same value as your API key. The API key is on the API access page in your dashboard. Copy URL on the Workspace page gives the complete WebSocket URL with the key in it.
Connect to the WebSocket
Set these environment variables, then run either consumer from your server:
NEWS_WS_URL: ws_url from GET /v1/dashboardNEWS_WS_KEY: ws_key from GET /v1/dashboardNEWS_API_KEY: your API key (REST only)
# pip install "websockets>=13" (Python 3.9+)
import asyncio, json, os
from websockets.asyncio.client import connect
# ws_url and ws_key from GET /v1/dashboard. ws_url has no key in it.
WS_URL = os.environ["NEWS_WS_URL"] + "?key=" + os.environ["NEWS_WS_KEY"]
def handle(article):
if article.get("_event_type") != "LIVE_POST":
return
print(article.get("feed"), "|", article.get("title"), article.get("url"))
async def main():
backoff = 1
while True:
try:
async with connect(WS_URL) as ws:
backoff = 1
async for raw in ws:
try:
event = json.loads(raw)
except ValueError:
continue
if isinstance(event, dict):
handle(event)
except Exception as exc:
print("disconnected:", exc)
await asyncio.sleep(backoff)
backoff = min(backoff * 2, 30)
asyncio.run(main())// npm install ws, save as consumer.mjs, run: node consumer.mjs (Node 18+)
import WebSocket from "ws"
// ws_url and ws_key from GET /v1/dashboard. ws_url has no key in it.
const BASE_URL = process.env.NEWS_WS_URL
const WS_KEY = process.env.NEWS_WS_KEY
if (!BASE_URL || !WS_KEY) throw new Error("Set NEWS_WS_URL and NEWS_WS_KEY")
const WS_URL = BASE_URL + "?key=" + encodeURIComponent(WS_KEY)
function handle(article) {
if (article._event_type !== "LIVE_POST") return
console.log(article.feed, "|", article.title, article.url)
}
let backoff = 1000
function connect() {
const ws = new WebSocket(WS_URL)
ws.on("open", () => { backoff = 1000 })
ws.on("message", (raw) => {
let event
try { event = JSON.parse(raw.toString()) } catch { return }
if (event && typeof event === "object" && !Array.isArray(event)) handle(event)
})
ws.on("error", (err) => console.error("socket error:", err.message))
ws.on("close", () => {
setTimeout(connect, backoff)
backoff = Math.min(backoff * 2, 30000)
})
}
connect()- One message per article, from every feed you subscribe to.
- Events are not queued while you are disconnected, so reconnect promptly with a capped backoff, as above.
One example frame
Illustrative values for fictional accounts, trimmed to the fields most consumers read first. A real frame carries the full set for your tracked accounts.
{
"feed": "Example Wire",
"guid": "https://news.example.com/city/transit-line-opens",
"url": "https://news.example.com/city/transit-line-opens",
"title": "Example City opens its new transit line",
"publish_time": "2026-10-15T14:02:58+00:00",
"primary_category": "News",
"categories": [
"News",
"Local"
],
"author": "Example Wire staff",
"keywords": [
"transit",
"city"
],
"description": "The line adds six stations.",
"summary": "The line adds six stations and runs every eight minutes.",
"media": [
{
"url": "https://news.example.com/img/transit.jpg",
"type": "image",
"caption": "The first train"
}
],
"full_text": "Full article body text.",
"_event_type": "LIVE_POST",
"_sent_time": "2026-10-15T14:03:00.412000+00:00"
}feedis one of the feed names you subscribed to (the one above is fictional). Dedupe onguid._event_typeis alwaysLIVE_POSTfor a new article, and_sent_timeis when 1322 sent it.
Manage the list over REST
REST base https://newsfeed.1322.io. Each call below sends X-Api-Key with your API key.
| Method | Path | What it does |
|---|---|---|
| GET | /v1/dashboard | Status, term, feed slots, subscribed feeds, ws_url and ws_key (flat). |
| POST | /v1/subscribe | Subscribe to a feed by name. |
| POST | /v1/unsubscribe | Unsubscribe from a feed. |
curl "https://newsfeed.1322.io/v1/dashboard" \
-H "X-Api-Key: $NEWS_API_KEY"
curl -X POST "https://newsfeed.1322.io/v1/subscribe" \
-H "Content-Type: application/json" \
-H "X-Api-Key: $NEWS_API_KEY" \
-d '{ "feed": "BBC News" }'
curl -X POST "https://newsfeed.1322.io/v1/unsubscribe" \
-H "Content-Type: application/json" \
-H "X-Api-Key: $NEWS_API_KEY" \
-d '{ "feed": "BBC News" }'- Feed names must match the available feeds list exactly, for example
BBC NewsorBloomberg.
Full reference
Every field, endpoint and edge case for News lives in the API reference. Jump straight to the part you need:
Common questions
Which news feeds can I subscribe to?
Any name in the available feeds list in the API reference, such as BBC News, Bloomberg, CNBC, The Verge or Wired. Subscribe and unsubscribe with POST /v1/subscribe and /v1/unsubscribe.
Does each article include the full text?
Yes. full_text holds the extracted article body, next to the title, summary, categories, keywords and media.
Other quick starts
- X (Twitter) WebSocket quick start: Tweets, deletes, profile and follow events
- Truth Social WebSocket quick start: Posts, retruths, quotes and media
- Instagram WebSocket quick start: Posts, Reels, carousels and Stories
- YouTube WebSocket quick start: Uploads, Shorts and deletions
- TikTok WebSocket quick start: Uploads, reposts, LIVE start and end
- Binance Square WebSocket quick start: Posts, pin changes and sentiment
- FOMO WebSocket quick start: Theses, trades, token verification and new joins
Related: