In this article, we’ll delve into the “HTTP Response” section of the NewsData.io documentation, demystifying the various elements of API responses and their significance.
NewsData.io News API Response Object
When a user makes an API request, he receives a number of responses. Some of those responses are discussed below for better understanding:
1. status
The status code is a three-digit number that indicates the outcome of the API request. It informs you whether the request was successful, encountered an error, or requires further action.
Some of the common status codes include:
- 200 indicating that the page is OK
- 404 indicating that the page is Not Found
- 500 indicating that there is an Internal Server Error
2. totalResults
It displays the total number of results that your request has extracted. This particular feature gives the user an estimated number of articles that match his query.
3. article_id
Every article is allotted with unique article_id. This would help minimise duplicity for the users.
For example, after sending the API request you want to save or read the article later. In that case, you can save the article_id number and search for it later.
4. title
It shows the title of the retrieved articles.
5. link
It displays the link or URL of the retrieved articles.
6. keywords
The “keywords” object presents a list of related keywords associated with the news article. These keywords offer insights into the topics, subjects, or themes covered within the article.
7. creator
The “creator” object specifies the author or creator of the news article. It identifies the individual or entity responsible for producing the article’s content.
8. video_url
The “video_url” object holds a URL that directs to a video embedded within the news article. This URL points to multimedia content associated with the article.
9. description
The “description” object offers a brief description or summary of the news article. It provides a snapshot of what the article covers.
10. content
Content displays the full content of the retrieved news articles. This section includes the comprehensive details and information provided within the article.
You can add the content parameter to your query as stated:
- full_content= 1, if you require articles with full content.
- full_content=0, if you require articles without full content.
11. pubDate
The “pubDate” object denotes the published date of the news article. It indicates the date when the article was made available to the public.
12. image_url
The “image_url” object contains a URL that leads to an image present in the news article. This image could be a visual element related to the article’s content.
13. source_id
The “source_id” object indicates the source from which the news article originated. This feature fetches the name of the news outlet, website, or platform that published the article.
14. source_url
The “source_url” object indicates the URL of the source from which the news article originated. This feature fetches the URL of the news outlet, website, or platform that published the article.
15. source_icon
The “source_icon” object indicates the URL of the logo associated with the source from which the news article originated.
16. source_priority
The “source_priority” object indicates the rank of the news domain on the basis of their traffic and authenticity. The lower the rank is, greater the authenticity of the domain is.
17. country
This object specifies the country of the publisher. It indicates the geographic location of the news source that published the article.
18. category
The “category” object represents the category assigned to the news article by NewsData.io. This categorization helps organize news content into specific topics or subjects.
19. language
The “language” object indicates the language in which the news article is written. It identifies the primary language of the article’s content.
20. ai_tag
The ai_tag response object will tell users the genre or let’s say to which field this news is related.
For instance, if news is related to Basketball it will broadly classified as sports in the category object. But in Tags, it will narrow down the category by stating the particular sports i.e. Basketball.
21. sentiment
The “sentiment” response object will inform the users whether the sentiment regarding the news is “positive”, “Negative” or “Neutral”. This will help the users identify the overall reaction towards the news which could be helpful in political and financial news.
22. sentiment_stats
The “sentiment_stats” response object will inform the users the distribution statistics of the news articles fetched. This distribution includes statistics on the “positive”, “Negative” or “Neutral” sentiments each of the news articles.
23. ai_region
The “region” response object fetches the AI-classified geographical region associated with a news article. It can be any city, district, state, country or even a continent.
24. nextPage
The “nextPage” object provides a way to navigate to the next page of results. It includes a code that you can use to construct a URL for fetching the next page of data. This feature is useful for retrieving additional sets of news articles beyond the current page.
For detailed information about the ‘nextPage’ response object, click here.
These were the response objects that the user receives with Newsdata.io.
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!