Click here to check the latest changes and updates happening in NewsData.io API and documentation.
About NewsData API

Newsdata.io is a News API that provides access to news articles from all over the world. To get started with the platform, you can sign up for a free trial account at https://newsdata.io/register.

NewsData.io gathers news from more than 82018 news sources which cover around 206 countries in 89 languages. As of now, NewsData.io has access to over 100 million news articles which are gathered from 2018 till today.

Once you have an account, you can access the news data by using the provided API. The API allows you to search for news articles based on keywords, phrases, date range, language, location, publisher and other criteria.

Once you have the API key, you can start making requests to the API to retrieve news articles. The API documentation provides detailed information on how to use the API and the different parameters that can be used in the requests.

Additionally, the platform offers a range of tools to analyze and visualize the data. These tools include sentiment analysis, entity extraction, and topic modeling. However, these text analysis modules are not part of the NewsData.io API.

It's also worth noting that Newsdata.io offers different subscription plans, so be sure to check which one best suits your needs before getting started. You can upgrade or cancel your plan anytime.

How to get the NewsData.io API key

To get access to an API key, you will first need to sign up. Once your email is verified, you can access the dashboard by logging in. On the dashboard, you will find the API key.

Once you have the API key, you can start making requests to the API to retrieve news articles. It's also important to keep your API key secure and not share it with anyone.

For a comprehensive look, visit our detailed article - How to Get Your NewsData.io News API Key

How to make your first request

Once you get the access of the API key, you can fetch the data using the API key in the request URL.

You can use platforms like HTTP REST clients (such as Postman) or Curl to fetch the data in JSON format.

Here is an example of a request to retrieve news articles:

get https://newsdata.io/api/1/latest?apikey=YOUR_API_KEY&q=pizza

This request will search for the latest news articles that contain the keyword "pizza". The apikey parameter is used to authenticate your account and is required in all requests.

You can also use additional parameters to refine your search, such as specifying a language, category, domain name etc.

get https://newsdata.io/api/1/archive?apikey=YOUR_API_KEY&q=example&language=en&from_date=2023-01-19&to_date=2023-01-25

This request will search for English language news articles published between August 26, 2022 and January 25, 2023 that contain the keyword "pizza".

Once you've made a request, you will receive a response in JSON format containing the news articles that match your search criteria.

For practical understanding visit - How to Make Your First Request With NewsData.io

Authentication

Newsdata.io uses API key authentication to access the platform's features and data. An API key is a unique string of characters that is generated for each account, and it is required in all requests to the API.

When making requests to the API, you need to include the API key in the request URL. The API key can be passed as a request header as X-ACCESS-KEY or as a query parameter apikey.

If the API key is not included in the request headers or it is invalid, the API will return a 403 Unauthorized error and the request will be denied.

Response Object

You will get the following data points in JSON response while requesting the API.

Sample Response

 

For a comprehensive look, visit our detailed article - Response Objects: Data you receive from NewsData.io News API

Security

Secure login and authentication: Newsdata.io uses secure methods for user authentication.

Data encryption: Newsdata.io uses encryption to protect user data, both in transit and at rest, to prevent unauthorized access to sensitive information.

Access controls: Newsdata.io may implement strict access controls to prevent unauthorized access to user data and ensure that only authorized personnel can access sensitive information.

Regular security updates and patches: Newsdata.io regularly update their systems and software to fix any discovered vulnerabilities and ensure the security of user data.

Compliance with industry-standard security regulations: Newsdata.io complies with industry-standard security and data protection regulations such as General Data Protection Regulation (GDPR) and the Payment Card Industry Data Security Standard (PCI DSS) to protect user data.

Incident management and incident response: Newsdata.io has a process in place to detect and respond to security incidents, such as data breaches or system failures, to minimize the impact on users.

Regular backups and disaster recovery plans: Newsdata.io maintains regular backups and disaster recovery plans to ensure data availability in case of an incident.

Strict access controls on the part of the company to their own systems and data: Newsdata.io has strict controls on their own systems and data to prevent any unauthorized access.

As a user, you should also take your own security measures such as keeping your API key secure and not sharing it with anyone, use unique and complex passwords and keep your software updated.

API Integration: Newsdata.io has strict controls on how their APIs are integrated into third-party apps to ensure that user data is protected. This could include rate limiting, IP whitelisting, and encryption of data in transit.

Regular Audits: Newsdata.io conducts regular security audits and penetration testing to identify and address vulnerabilities in their systems and third-party apps that integrate with their APIs.

Security awareness and training: Newsdata.io provides the necessary security awareness training to their employees to ensure they are aware of the security threats and how to handle them.

In summary, to maintain security and safety for users at Newsdata.io, the platform should have strict controls on the level of access that third-party apps have to user data, a vetting process for third-party apps, strict controls on API integration, regular security audits and penetration testing, compliance with industry-standard security regulations, incident management process, and security awareness and training for the employees.

Rate Limit

Newsdata.io API has a rate limit, which is the number of requests that can be made to the API within a certain time period. The rate limit is in place to ensure that the API is available for all users and to prevent any one user from overloading the system.

The specific rate limit for the API varies depending on the plan you have subscribed to. For example, a free plan may have a lower rate limit than a paid plan.

The API limit you get for different plans is as follows:

Free Plan: 30 credits every 15 minutes

Paid plans: 1800 credits every 15 minutes

If you exceed the rate limit for your plan, the API will return a "Rate Limit Exceeded" error and you will not be able to make any further requests until the rate limit resets after 15 minutes.

For detailed understanding visit - Rate Limit of NewsData.io

API credit limit for different plans

Newsdata.io API has a credit limit for different subscription plans. The credit limit is a way to control the amount of usage of the API by the users.

The free plan gives access to 200 API credits on a daily basis. The paid plan has an API credit of 20,000 per month for Basic plan, 50,000 per month for Professional plan and 300,000 per month for Corporate plan.

You can opt any of the subscription plans as per your requirements.

Please refer the table below to check the API Credit limit for different Subscription plans:

You can customize the number of articles you get per request from 1 to 50.

For example:

get https://newsdata.io/api/1/latest?apikey=YOUR_API_KEY&q=YOUR_QUERY&size=15

This request will retrieve 15 articles per page or per request if you are a paid user and if you are a free user then you need to define the size between 1 to 10.

How API credits get consumed

API credit at Newsdata.io gets consumed each time a request is made to the API. The number of credits consumed do not depend on the type of request made and the data returned.

You can track the API credit limit and monitor the usage of the API at your NewsData.io account.

For detailed understanding visit - How NewsData.io Credits Are Consumed

HTTP response codes

Newsdata.io API returns various HTTP response codes depending on the request. Below are all the HTTP response codes:

Latest News ("latest" endpoint)

The latest news endpoint provides access to the latest and breaking news. The news articles are sorted by the published date. With the "latest" endpoint, you can access the news articles up to the past 48 hours.

Retrieving the latest news allows you to build experience such as showcasing the latest news, breaking news tickers and analyzing News to better understand their content.

Resource URL
get https://newsdata.io/api/1/latest?apikey=YOUR_API_KEY

Example Queries

1. News from Australia and United States

get https://newsdata.io/api/1/latest?apikey=YOUR_API_KEY&country=au,us
Sample Response

2. News for domain BBC

get https://newsdata.io/api/1/latest?apikey=YOUR_API_KEY&domain=bbc

3. News for Category Science

get https://newsdata.io/api/1/latest?apikey=YOUR_API_KEY&category=science

To dive deeper with practical examples visit - Get Latest News using NewsData.io "News" Endpoint: In Detail

Crypto News

Search and Monitor Worldwide Cryptocurrency-related news and blog data from the most reliable News and Blog Websites.

Retrieving the latest news allows you to build experience such as showcasing the latest news, breaking news tickers and analyzing News to better understand their content.

Resource URL

get https://newsdata.io/api/1/crypto?apikey=YOUR_API_KEY

Example Queries

1. Crypto News from countries Germany and Hong Kong

get https://newsdata.io/api/1/crypto?apikey=YOUR_API_KEY&country=de,hk

2. Crypto News in Italian and Japanese language

get https://newsdata.io/api/1/crypto?apikey=YOUR_API_KEY&language=it,jp

3. Crypto News from domain nytimes

get https://newsdata.io/api/1/crypto?apikey=YOUR_API_KEY&domain=nytimes

To dive deeper with practical examples visit - Crypto News API Endpoints

News Archive

The news archive endpoint provides access to the old news data for a topic, event, country, for a specific category in a country, or for a single or multiple domains.

Retrieving a piece of old news allows you to get the past news data for research and analysis purposes.

The News Archive endpoint is available only in Paid plans. You can get news data for the past 2 years using the Archive endpoint.

There is limited access to the news archive endpoint for each paid plan:

Basic 6 months of historical data
Professional 1 year of historical data
Corporate 2 years of historical data

Under your plan, you will not be able to access news data beyond these limits. To get news beyond the past 2 years, click here

Resource URL

get https://newsdata.io/api/1/archive?apikey=YOUR_API_KEY

Example Queries

1. News from category technology and science

get https://newsdata.io/api/1/archive?apikey=YOUR_API_KEY&category=technology,science

2. News from_date 23-Jan-2020 to 17-Feb-2022

get https://newsdata.io/api/1/archive?apikey=YOUR_API_KEY&from_date=2020-01-23&to_date=2022-02-17

3. News from 12-Dec-2022 till present date

get https://newsdata.io/api/1/archive?apikey=YOUR_API_KEY&from_date=2022-12-12

To dive deeper with practical examples visit - All about News "Archive" Endpoint

News Sources

Sources endpoint provides names of randomly selected 100 domains from a country, category or/and language.

It is mainly a convenience endpoint that you can use to keep track of the publishers available on the API.

Resource URL

get https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY

Example Queries

1. News sources that show from specific country

get https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY&country=ru,ua

2. News sources that show from specific category

get https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY&category=politics,world

3. News sources that show from specific language

get https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY&language=nl,fr

To dive deeper with practical examples visit - News Sources Endpoints

Newdata.io Python Client

Use the Newsdata.io Python client library to integrate Newsdata.io API into your Python application without having to make HTTP requests directly.

Source: Newsdata.io Python Client

Installation:
Usage:
Pagination
Newsdata.io PHP Client

Use the Newsdata.io PHP client library to integrate Newsdata API into your PHP application without having to make HTTP requests directly.

Source: Newsdata.io PHP bindings

Installation:
Usage: