Skip to main content
websocket real-time streaming news API

Quick answer:

To connect to the NewsData.io WebSocket-based Streaming News API, register a query with at least one filter. Copy the registration ID you receive. Then open a WebSocket connection with your API key and that ID. Matching articles will arrive automatically, with no refreshing and no repeat requests.

This guide explains how NewsData.io WebSocket works and how to connect to it in five minutes. Without the need for any coding.

What is the NewsData.io WebSocket-based API?

The NewsData.io WebSocket-based API is the live delivery channel of the NewsData.io Streaming News API. You connect once and stay connected. New articles that match the filters in your query are pushed automatically the moment they are published.

Think of it as a phone call. You don’t need to redial to stay connected to the line. It stays open, and news reaches you when it happens.

NewsData.io draws on more than 100,000+ news sources across 2026 countries and 89 languages. Your stream taps into that same coverage.

Why Use the NewsData.io Streaming News API?

Standard News APIs need repeated requests to get new articles. This is called polling. It delays results and misses major updates.

The NewsData streaming news API fixes this loop:

  • Instant delivery: Articles are fetched as they are published and matched.
  • Precise filters: Filter by keyword, language, region, domain, or more.
  • Richer data: Request images, videos, and full content where available.
  • Fair credit use: Credits are used when articles are delivered, not when you connect.
  • Easy testing: An official Postman collection lets you test without code.

What you need before you start

  • A NewsData.io account and API key.
  • A free or paid plan. Both include real-time streaming.
  • A topic you want to track.
  • Postman, a free tool, for no-code setup.

How to Connect in 5 Minutes

StepActionTime
1Get your API key1 min
2Register a query1 min
3Copy your registration ID30 sec
4Connect to the stream1 min
5Watch articles arrive1 min

Step 1: Get Your API Key

Sign up at NewsData.io and copy your key from the dashboard. Keep it private.

Step 2: Register a Query

A registered query is your personal news feed. It tells NewsData.io what to send you.

Add at least one filter. A query can’t be registered without one. For example:

  • Topic: artificial intelligence
  • Country: United States
  • Language: English

In Postman, choose New → HTTP Request → POST. Paste the registration address from the table below. Add your filters under Params, then click Send.

Step 3: Copy Your Registration ID

A successful request returns a unique registration ID. Save it. It connects you to the stream and lets you manage the query later.

If you see a 409 message, the parameter already exists. Reuse the ID that comes with it. Check NewsData.io’s Documentation to learn more about error codes.

Step 4: Connect to the Stream

Open a WebSocket connection using your API key and registration ID. In Postman, choose New → WebSocket, paste the address, and click Connect. Keep it open.

Step 5: Watch News Arrive

Every news article that matches your query appears automatically. You can now view or delete queries at any time.

Quick Address Sheet

ActionRequest typeAddress
Register a queryPOSTnewsdata.io/api/1/websocket/register
Connect to the streamWebSocketwss://ws.newsdata.io/ws/event
View your queriesGETnewsdata.io/api/1/websocket/fetch
Delete a queryDELETEnewsdata.io/api/1/websocket/delete

Every request needs your key as apikey. Connecting and deleting also need registration_id.

Filters You Can Use

Advanced options include sentiment, tag, and region. Some filters can’t be combined. For example, you can’t use Country and excludeCountry together.

Manage Your Queries

Viewing your queries shows each registration ID, active clients, last-used time, news type, and filters.

Delete queries you no longer need. NewsData.io then stops sending news for that ID. It also protects your credits.

Understand Credit Use

  • One article sent to one device uses one credit.
  • Sending one article to three devices uses three credits.
  • Broad queries, such as “news”, can use credits quickly.
  • Specific filters keep your stream relevant and affordable.

Polling vs. NewsData.io WebSocket Streaming

FeatureStandard pollingNewsData.io WebSocket streaming
How it worksYou ask again and againConnect once; news is pushed to you
Update speedDelayed until the next checkDelivered as matching articles arrive
ConnectionsMany repeated requestsOne open connection
Page refreshOften neededNot needed
Credit useSpent per requestSpent per article delivered
FiltersSent with every requestRegistered once, reused
Best forReports, research, historyLive dashboards, alerts, AI agents

Who Uses a Real-Time News API?

As a real-time News API, NewsData.io suits many teams:

  • Brand Monitoring: Spot mentions as they happen.
  • Finance and Crypto: Track market-moving headlines.
  • Newsroom: Power live dashboards and alerts.
  • AI agents: Feed fresh news into automated workflows.
  • Crisis Monitoring: Follow emergencies as they unfold.

Developers can use the official SDKs on GitHub. They support streaming, including automatic reconnection after short drops.

Conclusion

Connecting to NewsData.io’s WebSocket-based streaming news API takes five simple steps: get a key, register a query, save the ID, connect, and watch fresh news arrive. With NewsData.io’s streaming news API, you get regular updates without constant checking.

Ready to start? Get your NewsData.io API key and stream your first query today.

FAQs

Q. What is the NewsData.io WebSocket API?

It is the live channel of the NewsData.io Streaming News API. It keeps one connection open and pushes matching articles to you.

Q. Is real-time streaming available on the free plan?

Yes. NewsData.io offers real-time streaming on all plans, including the free one.

Q. Do I need coding skills to connect?

No. Postman lets you register, connect, view, and delete queries without code.

Q. How many filters do I need?

At least one. NewsData.io won’t register a query without a filter.

Q. When are credits used?

When articles are delivered to your device, not when you connect.

Leave a Reply