I want to use bing search api to obtain search result count for given query, however, Bing API seem to not return any fields containing the search result count.
Should I specify some option to request URL? Or Bing API not return the result countt?
I want to use bing search api to obtain search result count for given query, however, Bing API seem to not return any fields containing the search result count.
Should I specify some option to request URL? Or Bing API not return the result countt?
You can obtain the result count, but it's not as obvious as I thought it would be. Using this URL:
you can get a JSON String, which includes the result count in
You need to use the Composite search for that (I specified only
web
in this example, but you can useweb+news
or any other bing source) and you have to retrieve at least one result ($top=1
).You can also use
Atom
instead ofJSON
to get an xml response.For those subscribed to the SearchWeb stream rather than the general Search, the URL is this:
As with Wang Tang's answer, the result should include
You can get the results count from the result object: