Skip to main content

The news ‘sources’ endpoint of NewsData.io, provides names of randomly selected 100 domains from a country, category or language. In this article, we’ll deep dive into the use of the News “Sources” endpoint and explore the features it comes with.

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 data 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 the content and its potential biases.

Request parameters of news ‘sources’ endpoint

1. id

You can search for news articles using its unique “article_id” string. You can include up to 50 such article id strings in a single query or as per your specified limit.

Given below is an example for better understanding.

  • For example, id=668de67f2c32ce652104e7c4a5c9b517, will fetch you article with the given unique article id.https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY&id=668de67f2c32ce652104e7c4a5c9b517

2. Country

You can search the news sources from a specific country using this parameter. You can check the codes for all the countries here.

Given below are some examples for better understanding.

  • If you want to fetch news sources from Australia, the request parameter will be such that country=au, where ‘au’ means Australia.https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY&country=auThis will fetch the news sources from the specific country, Australia here, only.
  • If you want to fetch news sources from India, the request parameter will be such that country=in, where ‘in’ means India.https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY&country=inThis will fetch the news sources from the specific country, India here, only.

3. Category

You can search the news sources for a specific category using this parameter. You can check the documentation for all the category codes.

Given below are some examples for better understanding.

  • If you want to fetch sources related to the politics category only, the request parameter will be such that ‘category=politics‘.https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY&category=politicsThis query will fetch only those sources which are related to the politics category.
  • If you want to fetch sources related to the top category only, the request parameter will be such that ‘category=top‘.https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY&category=topThis query will fetch only those sources which are related to the top category.

NewsData.io provides 17 different categories such as business, crime, domestic, education, entertainment, environment, food, health, lifestyle, other, politics, science, sports, technology, top, tourism, and world. Through these categories you can filter your news.

4. Language

You can search the news sources from a specific language using this parameter. You can check the documentation for all the language codes.

Given below are some examples for better understanding.

  • If you want to fetch news sources in the French language only, the request parameter will be such that language=fr, where ‘fr’ means French.https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY&language=frThis query will fetch only those news sources which are in French language.
  • If you want to fetch news sources in the English language only, the request parameter will be such that language=en, where ‘en’ means English.https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY&language=enThis query will fetch only those sources which give news in English.

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

5. Priority Domain

You can search the news sources from a specific rank using this parameter. The ‘prioritydomain’ parameter is further divided into 3 categories:

    • Top: Fetches 100 news sources ranking within the top 10% of all the sources available.
      If you want to fetch top news sources only, the request parameter will be such that ‘prioritydomain=top’.https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY&prioritydomain=topThis query will fetch only those news sources which rank within the top 10%.
      • Medium: Fetches 100 news sources ranking within the top 30% of all the sources available.
        If you want to fetch articles from medium news sources only, the request parameter will be such that ‘prioritydomain=medium’.https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY&prioritydomain=mediumThis query will fetch only those news sources which rank within the top 30%.
  • Low: Fetches 100 news sources ranking within the top 50% of all the sources available.
    If you want to fetch low news sources only, the request parameter will be such that ‘prioritydomain=low’.https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY&prioritydomain=lowThis query will fetch only those news sources which rank within the top 50%.

These were the request parameters you can use while fetching data using news ‘sources‘ endpoint.

Leave a Reply