Search code examples
bingbing-api

Pagination of Bing News API results


To implement pagination, I'm using value of totalEstimatedMatches provided in API's JSON output.

Using its value, I'm setting count & offset for paging of results. Please confirm, is it a right way.

Also, I've observed that value of above field is sometimes not accurate.


Solution

  • Correct. You can use the combination of &count (number of results to show per API call) and &offset (number of results to skip from the top) to page the results. So, if you want to get results 101 - 150 for a given query, you would use &count=50&offset=100. Here is the article that describes this in details: https://msdn.microsoft.com/en-us/library/dn760787.aspx