Bing news search API: timeframe of the news and the number of news we can get from the API

Rui Qin 0 Reputation points
2023-10-09T12:52:39.22+00:00

Hi,

I am currently using Bing News API, using the

base_url = "https://api.bing.microsoft.com/v7.0/news/search"
headers = {"Ocp-Apim-Subscription-Key": api_key}

I set the parameter as

t = 0  # I will change t from 0 to 10 manually
count = 50
offset = t * count

params = {
        "q": "Microsoft",
        "count": count,
        "offset": offset,
        "since": "2022-10-09",
        "sortBy": "Relevance" # "Date".
    }

Using these parameters, I want to fetch news from 2022-10-09 until now. There's some issues I figured out and wonder if you can help me with answer them:

  1. If I change the "sortBy" from "Relevance" to "Date", the number of news I can retrieved decreased hugely. If I use "Relevance", I can get 154 news information, however, if I use "Date", there are only 67. Why we have this difference?
  2. If I use "Date", I can only get news whose "datePublished" between 2023-10-06 and 2023-10-09 (today). However, if I use "Relevance", the "datePublished" time range is larger. I would really want to use the "sortBy: "Date" " parameter because it gives a better time series data. But why the time frame of this choice is so narrow?
  3. From your documentation, there's seems no way to specify a timeframe like, I want data between 2022-10-01 and 2022-12-31. Is it true?
  4. In your generated Json file, the totalEstimatedMatches of this parameter setting is 41200. However, even using the "Relevant" parameter, I could only get 154. It was not a common sense to me that we can only get 154 Apple news within a year. Especially when "datePublished" time range is as large as 2010 - 2023. I wonder if I need to change any settings or improve my parameter selection.

Thanks for answering these questions. I am looking forward to your reply!

With best regards,

Rui

Bing News Search
Bing News Search
A Bing service that supports searching for news and get comprehensive results.
51 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.