Skip to main content

NewsData.io, a prominent news data provider, understands the importance of diverse and reliable sources. Our API offers a dedicated “News Sources” endpoint, providing users with valuable insights into the origins of news articles. Sources endpoint provides names of randomly selected 100 domains from a country, category or/and language.

In this article, we’ll deep dive into the use of the “News Sources” endpoint, explore its features, and discuss how it synergizes the users to navigate the vast landscape of news data.

Benefits of News Sources Endpoints

  1. Source Credibility: By accessing metadata about news sources, users can gauge the credibility, reputation, and focus of each outlet.
  2. Comprehensive Insights: Whether you’re a journalist, researcher, or enthusiast, this endpoint offers a wealth of data for in-depth exploration.
  3. Enhanced Context: Understanding the origin of news articles enhances your ability to critically assess content and its potential biases.

Request Parameters of News Sources Endpoints

1. Country: Search the news sources from a specific country. You can add up to 5 countries in a single query, Check the codes for all the countries here. For example, country=au,jp where au means Australia and jp means Japan

https://newsdata.io/api/1/source?apikey=pub_YOUR API KEY&country=in

This will fetch the news sources from the mentioned specific country which is India.                          2. Language: Search the news sources for a specific language. You can add up to 5 languages in a single query. Check the codes for all the languages here. For example, language=fr,en where fr means French and en means English.

https://newsdata.io/api/1/sources?apikey=pub_YOUR API KEY&language=en

This query will fetch only those sources which gives news in English and to change the language you can check the list accordingly and modify your request.       

To fetch articles in different languages visit the documentation page and check out the language code and modify your request accordingly.

3. Category: Search the news articles for a specific category. You can add up to 5 categories in a single query. Check the codes for all the categories here. For example, category=sports,top there is a total of 12 categories option available from which users can filter.

https://newsdata.io/api/1/news?apikey=pub_YOUR API KEY&category=politics

This request will fetch the sources that is related to the politics category. So if the user enters category=politics the API will fetch the articles related to the politics category.

NewsData.io provides 12 different categories such as entertainment, sports, politics, science, business, food, world, tourism, top, technology, environment, and health through which you can filter your news.

How to Use News Sources Endpoints

Begin by constructing an API request using the “News Sources” endpoint. The documentation provides the base URL and details about possible query parameters and then Customize your request by including filters such as language, country, and category. This ensures that the returned sources align with your specific criteria.

For example, this would be your query https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY

And these would be the parameters

  • Search the news sources from a specific country. You can add up to 5 countries in a single query. Check the codes for all the countries here. For example, country=au,jp where au means Australia and jp means Japan.
  • Search the news sources for a specific category. You can add up to 5 categories in a single query. Check the codes for all the categories here. For example, category=sports,top there is a total of 12 categories option available from which users can filter.
  • Search the news sources for a specific language. You can add up to 5 languages in a single query. Check the codes for all the languages here. For example, language=fr,en where fr means French and en means English.

Example Queries
1. News sources that show from a specific country
https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY&country=ru,ua
2. News sources that show from a specific category
https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY&category=politics,world
3. News sources that show from specific language
https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY&language=nl,fr

Leave a Reply