Skip to main content
API reference

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.

$350/month for full news feed access · WebSocket +$100/month · Under a second
WebSocket
wss://newsfeed.1322.io/{ws_path}?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-Key header.
  • GET /v1/dashboard returns your ws_path and ws_key. Connect to wss://newsfeed.1322.io/{ws_path}?key={ws_key}, always on newsfeed.1322.io, the same host as REST.
  • The API key is on the API access page in your dashboard.

Connect to the WebSocket

Set these environment variables, then run either consumer from your server:

  • NEWS_WS_PATH: ws_path from GET /v1/dashboard
  • NEWS_WS_KEY: ws_key from GET /v1/dashboard
  • NEWS_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_path and ws_key: GET /v1/dashboard. Connect on newsfeed.1322.io, the REST host
WS_PATH = os.environ["NEWS_WS_PATH"].strip("/")
WS_URL = "wss://newsfeed.1322.io/" + WS_PATH + "?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_path and ws_key: GET /v1/dashboard. Connect on newsfeed.1322.io, the REST host
const WS_PATH = (process.env.NEWS_WS_PATH ?? "").split("/").filter(Boolean).join("/")
const WS_KEY = process.env.NEWS_WS_KEY
if (!WS_PATH || !WS_KEY) throw new Error("Set NEWS_WS_PATH and NEWS_WS_KEY")
const WS_URL = "wss://newsfeed.1322.io/" + WS_PATH + "?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"
}
  • feed is one of the feed names you subscribed to (the one above is fictional). Dedupe on guid.
  • _event_type is always LIVE_POST for a new article, and _sent_time is 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.

MethodPathWhat it does
GET/v1/dashboardSubscribed feeds, status, ws_path and ws_key.
POST/v1/subscribeSubscribe to a feed by name.
POST/v1/unsubscribeUnsubscribe 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 News or Bloomberg.

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

Related: