Learn to fetch more than 10,000 articles
/v2/search
endpoint, our news API returns
some key information. For example, an API call about “Tesla” for the last week
total_hits
tells you how many articles are found.
total_hits
, chances are that there are more than
10,000 news articles for your query. The above Telsa example API call actually
matches 25,290 articles. To get all of these results, you have two choices:
get_search_all_articles
method from our Python SDK to
automatically divide your query.The distribution of Telsa relevant news articles throughout the week
get_search_all_articles
methodget_search_all_articles
method. It takes your query and based on the by
parameter divides it into a bunch of sub-queries. It then returns the
combination of all their results.
To get all the articles for the Telsa query you can simply:
by
parameter accepts four values: 'hour'
, 'day'
, 'week'
, and
'months'
. And it is set to 'week'
by default.