Skip to main content

The NewsData.io news sources endpoint returns a list of 100 randomly selected news domains, which you can filter by country, category, language, source priority or a specific domain URL. It is a convenience endpoint that helps you keep track of the publishers available through the NewsData.io API.

NewsData.io is a news API that covers 102,000+ publishers across 206+ countries and 90+ languages. With a catalogue that large, you need a quick way to find out which sources exist for a given country, topic or language before you start fetching articles. That is exactly what the sources endpoint does.

In this guide, we cover how the endpoint works, every request parameter with examples, the response format, and practical ways to use the results with the Latest and Archive endpoints.

The base URL of the endpoint is: https://newsdata.io/api/1/sources?apikey=YOUR_API_KEY

Benefits of News Sources Endpoints

1. Source discovery: find out which publishers are available for a country, category or language before you build your queries.

2. Credibility filtering: the prioritydomain parameter lets you focus on sources ranked in the top, medium or low tier of the catalogue.

3. Cleaner queries: use the domains you discover to narrow your searches in other endpoints, so your results come only from publishers you trust.

4. Coverage tracking: check how well a region or language is covered before you commit to a use case, such as a regional news app or a media monitoring tool.

Request parameters of news ‘sources’ endpoint

1. 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.

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. 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.

The news sources endpoint is a simple but useful tool for anyone working with the NewsData.io API. Use country, category and language to discover publishers, prioritydomain to focus on quality tiers, and domainurl to check a specific source. Then pass those sources into your article queries to get cleaner, more relevant results.

Ready to try it? Get your free API key and make your first sources request in minutes.

Related Reading

Leave a Reply