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
While making an API request following are some of the responses that you will get:
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. Common status codes include 200 (OK), 404 (Not Found), and 500 (Internal Server Error).
2. TotalResults: It displays the total number of results that your request has extracted. This valuable piece of information gives you an idea of how many news articles match your query or filters.
3. Title: It shows the title of the retrieved articles.
4. Link: Displays the link/URL of the retrieved articles.
5. Source_id: The “source_id” object indicates the source from which the news article originated. It provides the name of the news outlet, website, or platform that published the article.
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. Image_url: “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.
9. Video_url: “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.
10. Description: The “description” object offers a brief description or summary of the news article. It provides a snapshot of what the article covers.
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. 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 by adding full_content= 1 if you require articles with full content and adding full_content=0 if you require articles without full content.
13. Country: This object specifies the country of the publisher. It indicates the geographic location of the news source that published the article.
14. 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.
15. Language: The “language” object indicates the language in which the news article is written. It identifies the primary language of the article’s content.
16. 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.
17. Sentiments: The “sentiments” 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. (This is an upcoming response code)
18. Tags: The Tags response object will tell users the genre or let’s say to which field this news is related. For example, if news is related to Basketball in a category object it will broadly classified as sports but in Tags, it will narrow down the category by stating it’s sports which is Basketball. (This is an upcoming response code)
19. Location: This response object will specify the location of the news. (This is an upcoming response code)
20. Article_id: Every article is allotted with unique article_id. Which would helps in minimizing duplicacy and users use it to save the article and read it later. For example after sending the API request you want to save or read the article later and don’t want to miss it you can save the article_id number and can search it later.
Dushyant is an enthusiastic and quick learner in all fields who likes to gain experience, loves to write, and works on his creativity. He loves to explore new things and information and has the potential to spread knowledge across the world. He believes in teamwork and helping others and has a strong belief in learning from our own life experiences and exploring more through our mistakes as everyone has a story to create. His hobbies include sports, drawing, learning new things, and a deep interest in geopolitics.