How does the "freshness" parameter of the Bing news search API work?
I am writng a program to call the Bing news search API. I set the "freshness" parameter to be "Month". Yet, Bing returned content that can be as old as 6 months ago. How did I find out? I use the offset parameter to retrieve the last new pages of the returned result and found out that they are can be as old as 6 months (some even 2 years odl). Clarly, this result is contradict to the fresness parameter that I put in. Can anyone shed some light on this? Many thanks,
The following is the code snippet: Basically, I set the freshness to be Month (freshness=Month) and sort the output by day (sortBy=Day).
let bing_news_search = function (search) {
console.log('Searching news for: ' + term);
let request_params = {
method: 'GET',
hostname: host,
path: path + '?q=' + encodeURIComponent('Microsoft') +'&count=100'+'&freshness=Month'+'&sortBY=Date'+'&offset=4979900',
headers: {
'Ocp-Apim-Subscription-Key': subscriptionKey,
}
Moving this to the Answer as verified in comments:
The issue is that the &count is set to 100. The current limit is 50. Once setting this number correctly the API will work as expected.
So it will look like so: