Bing Search
Get Bing web search results.
GET/api/v1/bing/search
Costs 1 credit per request; failed requests are refunded. Authentication, the search_metadata envelope and error codes are the same as for every endpoint (see the API reference). Try it in the playground.
Parameters
Engine and query
| Parameter | Type | Description |
|---|---|---|
qrequired | string | Bing search query after trimming.Accepted length: 1 through 2,048 characters.Control characters are rejected.Bing query syntax such as quoted phrases and exclusions remains available. |
engine | string | Selects the Bing web-search engine.Default: bing. |
Search origin
| Parameter | Type | Description |
|---|---|---|
location | string | Named city-level origin used to localize the Bing request.Maximum length: 256 characters.Control characters are rejected. |
lat | number | Latitude from -90 through 90.May be supplied independently or with lon. |
lon | number | Longitude from -180 through 180.May be supplied independently or with lat. |
Localization
| Parameter | Type | Description |
|---|---|---|
mkt | string | Case-insensitive Bing language-country market token.Format: two-letter language and country, such as en-US.Cannot be combined with cc. |
cc | string | Case-insensitive two-letter country of origin.Format: US or GB.Cannot be combined with mkt. |
Pagination, filters, and device
| Parameter | Type | Description |
|---|---|---|
first | integer | One-based native offset for organic results.Default: 1.Range: 1 through 9,007,199,254,740,991.Prefer serpfast_pagination.next when it is returned. |
safeSearch | "off" | "moderate" | "strict" | Bing adult-content policy; values are case-insensitive.Default: moderate. |
filters | string | Native Bing display or date filter expression.Maximum length: 8,192 characters.Control characters are rejected. |
device | "desktop" | "tablet" | "mobile" | Selects desktop, tablet, or mobile result behavior.Default: desktop. |
Response
A JSON object with search_metadata (request id, credits used and remaining) and the result groups the page returns. Groups and fields depend on the content of each page, so treat every field as optional.
Examples
cURL
curl "https://serpfast.com/api/v1/bing/search?q=python+documentation" \
-H "Authorization: Bearer $SERPFAST_KEY"Node.js 18+
const params = new URLSearchParams({
"q": "python documentation"
});
const res = await fetch(`https://serpfast.com/api/v1/bing/search?${params}`, {
headers: { Authorization: `Bearer ${process.env.SERPFAST_KEY}` },
});
const data = await res.json();
console.log(data);Python
import os, requests
params = {
"q": "python documentation"
}
res = requests.get(
"https://serpfast.com/api/v1/bing/search",
params=params,
headers={"Authorization": f"Bearer {os.environ['SERPFAST_KEY']}"},
timeout=120,
)
print(res.json())