
NewsData.io is introducing real-time news streaming via WebSocket, enabling you to receive live news updates instantly as they are published - without the need for repeated API polling.
Base URL
GETwss://ws.newsdata.io/ws/event?apikey=YOUR_API_KEY®istration_id=YOUR_REGISTRATION_ID
Overview
The NewsData.io WebSocket API provides a persistent, low-latency connection that streams news articles to your application in real time. Once connected, matching articles are pushed directly to your client as they become available - making it ideal for live dashboards, news tickers, alert systems, and real-time monitoring tools.
Resource Information
| Response Format | JSON |
| Requires Authentication | Yes |
| Rate Limited | Not applicable |
API Credit Usage
Every article delivered through the WebSocket stream consumes 1 API credit per article.
Credits are deducted in real time as articles are pushed to your connection. The faster news matches your query, the faster credits are consumed - plan your filters accordingly to avoid unexpected credit usage.
Important: Monitor Your Credit Usage
There is no rate limit on WebSocket streaming. If your query matches a large volume of news, articles can be delivered continuously and your API credits may be consumed very quickly - even potentially exhausting your available credits instantly. Create your query and filters carefully before starting the stream. Use specific keywords, categories, countries, source_url, or other filters to control the volume of matching news.
Connection Limits
| Limit | Value |
|---|---|
| Max registered queries per account | 1 (Free), 5 (Basic), 10 (Professional & Corporate) |
| Max devices per registered query | 5 |
Credit usage per connection: Each connected device or client consumes 1 API credit for every article delivered. If the same article is delivered to multiple connected devices, each device consumes 1 credit for that article.
Example: If one article matches your query and is delivered to 3 connected devices, it consumes 3 API credits. If 100 articles are delivered to 3 devices, 300 API credits will be consumed.
Steps to Start Streaming
1. Register a Query
Endpoint
POSThttps://newsdata.io/api/2/websocket/register?apikey=YOUR_API_KEY
Register a query with your desired filters to create a persistent stream subscription. On success, you receive a unique Registered ID (registration_id) that identifies this query. Use this ID to connect devices, fetch query details, or delete the query later.
Required Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| apikey | String | Yes | Your NewsData.io API key. |
The Real-time streaming API registration endpoint supports the following parameters.
| Name | Required | Description | Default | Example |
|---|---|---|---|---|
Search & Content Filters | ||||
q_in_title | OPTIONAL | Search news articles for specific keywords or phrases present in article titles only. The value must be URL-encoded. The maximum character limit depends on your subscription plan. Refer to the Query Character Limit section for plan-wise limits. Note: q_in_title can't be used with q or q_in_meta in the same query. | - | q_in_title=pizza |
q_in_meta | OPTIONAL | Search news articles for specific keywords or phrases present in article titles, URL, meta keywords and meta description only. The value must be URL-encoded. The maximum character limit depends on your subscription plan. Refer to the Query Character Limit section for plan-wise limits. Note: q_in_meta can't be used with q or q_in_title in the same query. | - | q_in_meta=pizza |
q | OPTIONAL | Search news articles for specific keywords or phrases present in the news title, content, URL, meta keywords and meta description. The value must be URL-encoded. The maximum character limit depends on your subscription plan. Refer to the Query Character Limit section for plan-wise limits. | - | q=pizza |
category | OPTIONAL | Search news articles for specific categories. Include up to 5 categories per query on Free and Basic plans. Professional and Corporate plans support up to 10 categories. | - | category=sports,top |
exclude_category | OPTIONAL | Exclude specific categories from your news search. Exclude up to 5 categories per query on Free and Basic plans. Professional and Corporate plans support up to 10 categories. Note: You can use either the category parameter to include specific categories or the exclude_category parameter to exclude them, but not both simultaneously. | - | exclude_category=top |
datatype | OPTIONAL | Specifies the type of article. Supported values: news, blog, multimedia, forum, pressrelease, review, research, opinion, analysis, podcast. Include up to 5 datatypes per query on Free and Basic plans. Professional and Corporate plans support up to 10 datatypes. | - | datatype=news,blog |
tag | OPTIONAL | Search news articles for specific AI-classified tags. Include up to 10 tags per query. With Custom AI Tags (Corporate Yearly Plan only), you can request your own tag to classify articles based on your specific topic or tag. | - | tag=food,tourism |
organization | OPTIONAL | Search news articles related to specific organizations. Include up to 10 organizations per query. (Available only to Corporate users) | - | organization=uber,apple |
creator | OPTIONAL | Search by the name of the article author or content creator. Include up to 5 creators per query on Free and Basic plans. Professional and Corporate plans support up to 10 creators. | - | creator=chintan haria creator=liz carolan,luca socci |
sentiment | OPTIONAL | Search news articles based on the sentiment of the article. Supported values: positive, negative, neutral. | - | sentiment=positive |
Location, Language & Time Filters | ||||
country | OPTIONAL | Search news articles from specific countries. Include up to 5 countries per query on Free and Basic plans. Professional and Corporate plans support up to 10 countries. | - | country=au,jp |
exclude_country | OPTIONAL | Exclude news articles from specific countries. Include up to 5 countries per query on Free and Basic plans. Professional and Corporate plans support up to 10 countries. Note: You can use either the country parameter to include specific countries or the exclude_country parameter to exclude them, but not both simultaneously. | - | exclude_country=au,jp |
region | OPTIONAL | Search news articles from specific geographical regions. A region can be a city, district, county, state, country, or continent. Include up to 5 regions per query, and it can be customized up to 10 regions per query. (Available only to Corporate users) | - | region=city1,city2 region=city1-state1-country1,city2-country2 region=state-country region=los-angeles-california-usa region=new york,chicago |
language | OPTIONAL | Search news articles in specific languages. Include up to 5 languages per query on Free and Basic plans. Professional and Corporate plans support up to 10 languages. | - | language=fr,en,ga |
exclude_language | OPTIONAL | Exclude news articles in specific languages. Exclude up to 5 languages per query on Free and Basic plans. Professional and Corporate plans support up to 10 languages. Note: You can use either the language parameter to include specific languages or the exclude_language parameter to exclude them, but not both simultaneously. | - | exclude_language=fr,en,ga |
Source, Quality & Intelligence Controls | ||||
source_url | OPTIONAL | Search news articles from specific domains or news sources. Include up to 5 domains per query on Free and Basic plans. Professional and Corporate plans support up to 10 domains. Note: If the domain is incorrect, suggestions may be provided in the response. | - | source_url=nytimes.com,bbc.com,bbc.co.uk |
exclude_source_url | OPTIONAL | Exclude news articles from specific domains or news sources. Exclude up to 5 domains per query on Free and Basic plans. Professional and Corporate plans support up to 10 domains. Note: If the domain is incorrect, suggestions may be provided in the response. | - | exclude_source_url=nytimes.com,bbc.com,bbc.co.uk |
source_priority | OPTIONAL | Search news articles only from sources based on their priority. NewsData.io categorizes source priority into three levels. Top: Fetches news articles from the top 10% of news domains. Medium: Fetches news articles from the top 30% of news domains and includes sources with top priority. Low: Fetches news articles from the top 50% of news domains and includes sources with top and medium priority. | - | source_priority=top source_priority=medium source_priority=low |
sentiment_score | OPTIONAL | Filters articles by sentiment score. The score is out of 100 for each sentiment label: positive, neutral, and negative. Returns articles with a sentiment score greater than or equal to the specified value. Works only when the sentiment parameter is included in the query. | - | sentiment_score=70 |
image | OPTIONAL | Search news articles with or without a featured image. Use 1 for articles with a featured image and 0 for articles without a featured image. | - | image=1 image=0 |
video | OPTIONAL | Search news articles with or without videos. Use 1 for articles with videos and 0 for articles without videos. | - | video=1 video=0 |
content | OPTIONAL | Search news articles with or without the content response object. Use 1 for articles that contain the content response object and 0 for articles that don't contain the content response object. | - | content=1 content=0 |
remove_duplicate | OPTIONAL | The remove_duplicate parameter allows users to filter out duplicate articles. Use 1 to remove duplicate articles. Note: The overall remove_duplicate parameter functionality works on the basis of NewsData.io's internal algorithm. It doesn't imply that an article returned with remove_duplicate=1 is necessarily a duplicate article. | - | remove_duplicate=1 |
Request Control & Response Handling | ||||
apikey | REQUIRED | You need to add your API key while accessing the NewsData.io API. | - | - |
exclude_field | OPTIONAL | Excludes selected fields from the response object. Multiple response fields can be excluded in one request. The id field cannot be excluded. | - | exclude_field=source.icon_url,published_at,url |
timezone | OPTIONAL | Specifies the timezone used to format the response timestamps. It does not affect the news search itself. Use a valid IANA timezone identifier. | - | timezone=Asia/Kolkata |
Plus at least one filter from the Minimum Required Filters listed below.
q, q_in_meta, q_in_title, category, country, language, source_url, source_priority, image, video, or content is required to register a query
Example Response
{status: "success"results: {message: "Query registered successfully"registration_id: "e0a9d7ad4ac90fe9d449a184a5e1ef2f"}}Response Fields
| Parameter | Type | Description |
|---|---|---|
| status | string | success or error |
| results | object | Contains the registration response details |
| message | string | Human-readable confirmation |
| registration_id | string | Unique ID assigned to the registered query |
2. Fetch Data from Real-time Streaming API
Endpoint
Real-time Streaming API
GETwss://ws.newsdata.io/ws/event?apikey=YOUR_API_KEY®istration_id=YOUR_REGISTRATION_ID
Connect to websocket using its registration_id to start receiving real-time news updates. Once connected, matching articles are pushed directly to your client as they become available.
Required Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| apikey | String | Yes | Your NewsData.io API key. |
| registration_id | String | Yes | Unique ID of the registered query you want to connect to. |
Once the connection is established, your client will receive matching news articles through the real-time streaming api connection as they become available.
3. Fetch Registered Queries
Endpoint
GEThttps://newsdata.io/api/2/websocket/fetch?apikey=YOUR_API_KEY
Retrieves all registered queries you’ve created, including their filter configuration and current connection information. This endpoint is useful for auditing active streams, monitoring connected clients, or debugging query configurations.
Required Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| apikey | String | Yes | Your NewsData.io API key. |
Example Response
{status: "success"total_results: 1results: [0: {registration_id: "120dad501006ce2afb5ebc4536114efd"active_clients: 0last_used: "2026-10-12T05:36:59Z"news_type: "news"query: {country: [0: "in"1: "us"]image: "1"language: [0: "en"1: "hi"]source_priority: "top"}}]}Response Fields
| Field | Type | Description |
|---|---|---|
| status | string | Indicates whether the request was successful or returned an error. Possible value: success or error. |
| total_results | integer | Total number of registered queries returned in the response. |
| results | array | List of registered queries. |
| registration_id | string | Unique ID assigned to the registered query. |
| active_clients | integer | Total number of clients/devices currently connected to the registered query. |
| last_used | string | Timestamp indicating when the registered query was last used, in ISO 8601 format (UTC). |
| news_type | string | Indicates the NewsData.io endpoint used by the registered query. |
| query | object | Full filter configuration of the registered query. |
registration_id, active_clients, news_type, and query are returned within each object in the results array.
4. Delete a Registered Query
Endpoint
DELETEhttps://newsdata.io/api/2/websocket/delete?apikey=YOUR_API_KEY
Permanently deletes a specific registered query from your account. Once deleted, any devices connected via that registration_id will lose their stream.
Required Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| apikey | string | Yes | Your NewsData.io API key. |
| registration_id | string | Yes | The registered query ID to delete |
Example Response
{status: "success"results: {message: "Registration deleted successfully"registration_id: "e0a9d7ad4ac90fe9d449a184a5e1ef2f"}}Response Fields
| Field | Type | Description |
|---|---|---|
| status | string | success or error |
| message | string | Confirmation or error details |
| registration_id | string | The ID of the deleted query |
See also
Real-Time Streaming API GuideWas this page helpful?