---
title: "Real-time news stream (WebSocket)"
method: GET
path: "/ws/event"
tags: ["Websocket"]
---

# Real-time news stream (WebSocket)

`GET /ws/event`

WebSocket endpoint — described here as its HTTP handshake because OpenAPI cannot model WebSocket traffic. Connect with a WebSocket client:

`wss://ws.newsdata.io/ws/event?apikey=YOUR_API_KEY&registration_id=YOUR_REGISTRATION_ID`

Whenever newly collected articles match the registered query, the server pushes one JSON message per batch: `{"status": "success", "totalResults": N, "results": [ ... ]}`, where each result is an article in the same shape as `/1/latest` results. Fields listed in the registration's `excludefield` are left out, and `pubDate`/`fetched_at` are rendered in the registration's `timezone` (UTC otherwise; `pubDateTZ` names the zone). Client-to-server messages are ignored — the socket is receive-only.

The handshake itself is always accepted; on failure the socket is then immediately closed with WebSocket close code `1008` and a reason: `invalid credentials or registration not found` (bad `apikey`/`registration_id`, or the plan lacks WebSocket access), `api limit reached` (no API credits remaining), or `device limit reached` (more than the allowed simultaneous devices per `registration_id` — default 5). Each delivered article consumes **1** API credit per connected device; when the credits run out, open connections are closed with code `1008` (`api limit reached`). A client that reads too slowly is disconnected with code `1013` (`send timeout`).

## Query parameters

- `apikey` string, required
- `registration_id` string, required

## Other responses

- `101` — WebSocket connection established. The schema below describes the JSON messages subsequently pushed over the socket (a `101` response itself has no body).

## Changes

- **2026-08-20** `ece1fd088c73` — 2 breaking, 4 info
  - removed the required property `items` from the response with the `101` status
  - removed the required property `type` from the response with the `101` status
  - removed the non-success response with the status `403`
  - added the required property `results` to the response with the `101` status
  - …2 more
- **2026-08-13** `692a9e161b3f` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/newsdata/apis/newsdata-io-api/changes/ws/event/get.md)

---

[API](https://skmtc.dev/newsdata/apis/newsdata-io-api.md) · [All operations](https://skmtc.dev/newsdata/apis/newsdata-io-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/newsdata/newsdata-io-api/revisions/ece1fd088c73/schema)
