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
Source Credibility
By accessing metadata about news sources, users can gauge the credibility, reputation, and focus of each outlet.
Comprehensive Insights
Whether you’re a journalist, researcher, or data enthusiast, this endpoint offers a wealth of data for in-depth exploration.
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=au
This 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=in
This 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=politics
This 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=top
This 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=fr
This 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=en
This 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=top
This query will fetch only those news sources which rank within the top 10%.
- Top: Fetches 100 news sources ranking within the top 10% of all the sources available.
- 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=medium
This query will fetch only those news sources which rank within the top 30%.
- Medium: Fetches 100 news sources ranking within the top 30% of all the sources available.
- 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=low
This 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.
Hello, Curious Minds!
Welcome to my corner of the digital world, a space brimming with words and woven with ideas. Fresh out of the rigorous trenches of an Economics honors degree at the esteemed University of Delhi, I know a thing or two about crunching numbers and dissecting trends. But beyond the world of graphs and equations, lies my love for reading and writing. Admittedly, I’m a newbie in the content writing scene, still tasting the ink of fresh beginnings. I believe every corner of life holds a story waiting to be told, and I’m eager to be your storyteller. So, strap yourselves in, dear readers, and let’s dive into the captivating world of words together!
P.S. Feel free to drop a comment or reach out – I’m always up for a good conversation!