By default, newsAPI returns a list of related articles for each news headline that is retrieved, but sometimes you might need to dive deeper and get even more comprehensive coverage on a news story. To do this, you can use the topicId
that is provided with each article.
Here is an example to illustrate this scenario:
Step 1:
Make a request to get the latest news headlines by performing the following GET
request:
GET https://newsapi90.p.rapidapi.com/topic/latest
Each article in the response will have a topicId
property if there is more news coverage related to the story. (Note that it is possible for the topicId
to be empty if the article isn’t considered part of a larger news story).
Step 2:
For the article that you want to get more coverage on, find it’s topicId
and add it to the following GET
request:
GET https://newsapi90.p.rapidapi.com/topic/INSERT_TOPIC_ID_HERE
The result of this request will be a larger list of articles that are related to the original article.