Web Search & Custom Web Search APIs - Freshness parameter and sorting

Sebastian C 1 Reputation point
2022-07-27T19:14:29.377+00:00

I can see we can pass a "freshness" value when making requests to the Web Search API:

https://learn.microsoft.com/en-us/bing/search-apis/bing-web-search/reference/query-parameters

------------------------------------------------------------------------------------------------------

    Filter search results by the following case-insensitive age values:  

        Day — Return webpages that Bing discovered within the last 24 hours.  

        Week — Return webpages that Bing discovered within the last 7 days.  

        Month — Return webpages that Bing discovered within the last 30 days.  

    To get articles discovered by Bing during a specific timeframe, specify a date range in the form, YYYY-MM-DD..YYYY-MM-DD. For example, &freshness=2019-02-01..2019-05-30. To limit the results to a single date, set this parameter to a specific date. For example, &freshness=2019-02-04.  

------------------------------------------------------------------------------------------------------

I'm thinking about integrating this service with our product but the problem is that I will also need to use the Custom Web Search API to cover some of our use cases but it seems the "freshness" is not available when making requests to the generic endpoint (.../v7.0/custom/search), I can see it's available for the Custom Images & Videos search endpoints (.../v7.0/custom/images/search & .../v7.0/custom/videos/search):

https://learn.microsoft.com/en-us/bing/search-apis/bing-custom-search/reference/query-parameters

I need both the Web Search & Custom Web Search results to be filtered by specific dates and also, if possible, to be sorted by the "discovered_date".

Is this possible?

Bing Custom Search
Bing Custom Search
An easy-to-use, ad-free, commercial-grade search tool that lets you deliver the results you want.
79 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. romungi-MSFT 42,761 Reputation points Microsoft Employee
    2022-07-28T08:21:02.067+00:00

    @Sebastian C As noted in the documentation of custom web search instance the API does not provide a parameter for freshness. This is only available for the image and video search requests of a custom instance.

    If an answer is helpful, please click on 130616-image.png or upvote 130671-image.png which might help other community members reading this thread.

    0 comments No comments

  2. Cass Sapir 0 Reputation points
    2023-12-11T18:25:42.5866667+00:00

    @romungi-MSFT Thanks for the response.

    Is there any way to sort web search results by freshness?

    The API reference says that freshness should work as a query param for articles.

    But in all my tests I am getting zero or very few results (for a query that normally returns tens of thousands).

    0 comments No comments