Send a first Bing Search API web query
A first web query needs only a query string, and a country code makes the answer local.
- Call
bing-searchwithbody.qset to the phrase, for example best laptop 2026. - Add
body.glwith a 2-letter country code such as us, and addbody.countwhen you need more rows than the default. - Read
resultsfor the organic rows and keep theposition,title,urlandsnippetof each one. - Read
ads,related_searches,people_also_askandknowledge_panelfrom the samedatawhen you also want the extras of the results page.
The operation applies search operators inside body.q, so site:example.com or an exact phrase in double quotes narrows the call without any other input.
Page through Bing search results
A web page holds about 10 results, so a longer list is read page by page.
- Run the query with
body.pageat 1, or leave it out. - Repeat the call with
body.pageraised by 1, and keepbody.qand every other input unchanged so that the pages belong to one query. - Use
body.firstin place ofbody.pagewhen you track an offset instead: 11 starts page 2. - Read
pageandpage_offsetindatato see which page came back.
A larger body.count can stand in for several paging calls when 50 rows or fewer are enough.
Localise Bing results by market, country and language
Country and language can be set in one input or in two.
- Set
body.mktto a market such as de-DE to choose country and language together. - Or send
body.glas a country code andbody.hlas a language code, and the market is built from the pair. - Read
mktindatato see the market that answered. - Repeat the same
body.qonbing-searchwith a second market and compare theresultsside by side. - Send the same market inputs to
bing-news,bing-images,bing-videosandbing-autocomplete, so every call of the workflow describes one locale.
An unrecognised code leaves the default in place, so check mkt after the first call for a new market.
Restrict Bing results by recency and SafeSearch
Recency and SafeSearch narrow a call without changing the query.
- Set
body.freshnesstoday,weekormonthonbing-search;bing-newsalso takeshour. - Keep
body.qand the market inputs the same between calls, so that only the restriction changes. - Set
body.safetooff,moderateorstrictonbing-search,bing-imagesorbing-videos. - Compare the rows with and without the input when you need to confirm that it took effect.
An unrecognised value is ignored, so a mistyped body.freshness or body.safe leaves that restriction off.
Track keyword rankings with the Bing Search API
Rank tracking repeats one query and stores where a domain appears.
- Fix the inputs: the same
body.q, the samebody.mkt(orbody.glandbody.hl) and the samebody.countfor every run. - Call
bing-searchon each scheduled run and store theposition,urlanddomainof each row inresults, together with the date of the run. - Find your domain in the stored rows and note its
position. - Compare the stored positions from run to run.
body.device set to mobile still returns the desktop ranking, so the positions stored this way are desktop positions. Changing body.count or the market between runs changes the rows that come back, so keep both fixed.
Expand keyword ideas with Bing autocomplete
Autocomplete turns a seed phrase into a list of candidate searches.
- Call
bing-autocompletewith a seed phrase such as best lap inbody.q. - Store each entry of
suggestionsas a candidate keyword. - Send each candidate back as
body.qto collect the next level of suggestions. - Repeat with another
body.mktto build one list per market. - Run the candidates you keep through
bing-searchto see which pages answer them.
The suggestions come back in the order Bing shows them, so the position of an entry in suggestions can be stored next to its keyword.
Follow one topic across news, images and videos
One topic can be followed across three result types with the same query.
- Call
bing-newswithbody.qandbody.freshnessset today, and keep thetitle,sourceandurlof each article, newest first. - Call
bing-imageswith the samebody.q, and useimage_urlfor the full-size file andsource_urlfor the page that shows it. - Call
bing-videoswith the samebody.qand readdurationandplatform; testviewsbefore use, because it appears only when Bing shows it. - Send the same
body.mktorbody.glto all three calls so that the result sets share one locale.
How Bing works
Bing finds pages with its crawler Bingbot, adds them to an index and orders the results using signals such as relevance, quality and credibility, user engagement, location, language and load time. Paid ads do not improve the organic ranking.
Its query suggestions complete a partial search string as a user types, and the more complete the typed text, the more relevant the suggestions. The site: keyword limits results to pages of one site, domain or directory.
{
"body": {
"q": "best laptop 2026",
"gl": "us",
"hl": "en",
"count": 10
}
}[
{
"body": {
"q": "best lap",
"gl": "us"
}
},
{
"body": {
"q": "best laptop 2026",
"gl": "us",
"count": 10
}
}
]{
"body": {
"q": "best laptop 2026",
"gl": "us",
"page": 2
}
}[
{
"body": {
"q": "tesla",
"gl": "us",
"freshness": "day"
}
},
{
"body": {
"q": "tesla",
"gl": "us",
"count": 35
}
},
{
"body": {
"q": "tesla",
"gl": "us",
"count": 30
}
}
]Server-side request template
This server-side template shows authentication and request identity using the first operation of this API. Choose the operation for your use case and check its current availability and price on the API page. After a timeout, resend the unchanged request with the same Idempotency-Key.
The gateway request is always POST.
Use a JSON object with the documented path, query, headers and body locations; omit unused locations. input.headers is JSON data for the operation, not browser request headers. Do not put credentials here. Keep body arrays, scalar values and null as documented; omission is different from null.
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/bing/bing-autocomplete' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"gl":"us","q":"best lap"}}'Integration checklist
- The API key is stored in a server-side secret manager and never sent to a browser.
- Each request carries its own Idempotency-Key, kept until the request has a final answer.
- The integration reads ok and error.code and handles each error code as the error table describes.
- An uncertain POST is inspected using its original identity, never blindly repeated with a new one.
- The operation’s current availability and price have been checked on its API page.
Bing Search API overview and prices · Read the API reference · Try it in the playground