Bing Search Scraper

Bing Search Scraper - A tool to scrape Bing search results with a simple API. Get organic results, ads, knowledge graph, related searches, and more.
Get results as structured JSON for applications or Markdown for LLMs and AI agents, without managing HTML parsing or proxies.
How to scrape Bing Search?
Using a simple GET request, you can retrieve Bing search results:
https://serpapi.com/search?engine=bing&q=coffee&mkt=en-US&api_key=YOUR_SERPAPI_API_KEY
- Register at SerpApi to get your API Key. Keep your key private.
q parameter: defines the search query you want to search on Bing.
mkt parameter (optional): defines the market code (e.g., en-US). Specifying a known market is recommended. Do not combine it with cc.
Output formats: JSON and Markdown
JSON is the default output and is useful when you need individual result fields. Add output=md to receive Markdown for text-based workflows, LLMs, and AI agents.
Markdown request
curl --get https://serpapi.com/search \
--data-urlencode engine="bing" \
--data-urlencode q="coffee" \
--data-urlencode mkt="en-US" \
--data-urlencode output="md" \
--data-urlencode api_key="YOUR_SERPAPI_API_KEY"
Markdown is returned as text, not a JSON object. Use a text response reader instead of a JSON parser. The JSON field names below do not define a guaranteed Markdown structure.
Code examples
Here are some code examples based on your favorite programming languages.
cURL Integration
curl --get https://serpapi.com/search \
--data-urlencode engine="bing" \
--data-urlencode q="coffee" \
--data-urlencode mkt="en-US" \
--data-urlencode output="json" \
--data-urlencode api_key="YOUR_SERPAPI_API_KEY"
Python Integration
Step 1:
Create a new main.py file.
Step 2:
Install requests package with:
pip install requests
Step 3:
Add this code to your file:
import requests
SERPAPI_API_KEY = "YOUR_SERPAPI_API_KEY"
params = {
"api_key": SERPAPI_API_KEY,
"engine": "bing",
"q": "coffee",
"mkt": "en-US",
"output": "json"
}
search = requests.get("https://serpapi.com/search", params=params, timeout=60)
search.raise_for_status()
response = search.json()
if "error" in response:
raise RuntimeError(response["error"])
print(response)
If you're only interested in the organic_results, you can print them from the response directly:
print(response["organic_results"])
To request Markdown instead, keep the parameter definitions above and replace the request and response-handling lines with:
params["output"] = "md"
search = requests.get("https://serpapi.com/search", params=params, timeout=60)
search.raise_for_status()
print(search.text)
JavaScript Integration
Step 1:
Install the SerpApi JavaScript package:
npm install serpapi
Step 2:
Create a new index.js file.
Step 3:
Add this to your file:
const { getJson } = require("serpapi");
const API_KEY = "YOUR_SERPAPI_API_KEY";
getJson({
api_key: API_KEY,
engine: "bing",
q: "coffee",
mkt: "en-US"
}, (json) => {
if (json.error) {
throw new Error(json.error);
}
console.log(json);
});
For Markdown, use a text-capable HTTP client rather than getJson. This standalone alternative uses built-in fetch in Node.js 18 or later:
async function main() {
const params = new URLSearchParams({
api_key: "YOUR_SERPAPI_API_KEY",
engine: "bing",
q: "coffee",
mkt: "en-US",
output: "md"
});
const response = await fetch(`https://serpapi.com/search?${params}`, {
signal: AbortSignal.timeout(60000)
});
const text = await response.text();
if (!response.ok) {
throw new Error(`SerpApi HTTP ${response.status}: ${text}`);
}
console.log(text);
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Other Programming Languages
While you can use our APIs using a simple GET request with any programming language, you can also see our ready-to-use libraries here: SerpApi Integrations.
Bing Search Scraper Parameters
Please find the main parameters for the Bing Search API below:
| Name |
Description |
Requirement |
| engine |
Must be set to bing. |
Required |
| api_key |
Your SerpApi private API key. |
Required |
| q |
Search query. Supports Bing operators such as NOT, OR, site:, and filetype:. |
Required |
| Location and Market |
|
|
| location |
Search origin, preferably at city level. If omitted, results may use the proxy's location. Cannot be combined with uule. See the Locations API. |
Optional |
| lat |
Latitude for the search origin. |
Optional |
| lon |
Longitude for the search origin. |
Optional |
| mkt |
Market in language-country format, such as en-US. Recommended when known. Cannot be combined with cc. |
Optional |
| cc |
Two-character country code, such as us, de, or gb. Cannot be combined with mkt. |
Optional |
| Filtering and Pagination |
|
|
| safeSearch |
Off, Moderate, or Strict. Moderate excludes adult images and videos; Strict also excludes adult text. |
Optional |
| filters |
Advanced filter expression, including date ranges. Obtain the value from a Bing search URL rather than inventing filter identifiers. |
Optional |
| first |
Organic result offset, defaulting to 1. For example, first=10 moves the tenth organic result to the first position. |
Optional |
| SerpApi Parameters |
|
|
| device |
desktop (default), tablet, or mobile. |
Optional |
| no_cache |
Set to true for fresh results instead of the one-hour cache. Cannot be combined with async. |
Optional |
| async |
Set to true for later retrieval through the Searches Archive API. Cannot be combined with no_cache or used with Ludicrous Speed enabled. |
Optional |
| output |
json (default) for structured results, md for Markdown, or html for raw HTML. |
Optional |
Visit our documentation for more information on all available parameters.
Pagination
Repeat the search with first set to the desired organic-result offset, retaining your query, market, and filters. first is an offset, not a page number; do not assume each page has a fixed number of results. Stop if no further organic results are returned, and set a page or result limit when automating collection.
Available data on Bing Search (JSON Response)
Bing Search can return different information depending on the query. The following is a field guide, not a literal API response:
{
"organic_results": [
{
"position": "Integer - Position of the result",
"title": "String - Title of the search result",
"link": "String - URL to the page",
"tracking_link": "String - Bing tracking URL",
"displayed_link": "String - Displayed URL",
"snippet": "String - Brief excerpt from the page"
}
],
"related_searches": [
{
"query": "String - Related search query",
"link": "String - Bing search URL"
}
]
}
Other sections can include ads, knowledge_graph, inline_videos, and search_information. News, local results, images, and other search features may also appear depending on the page. Do not assume every response includes every section or field.
For Markdown output, use output=md and read the response as text as shown above.
Use cases
Here are some use cases for the Bing Search API:
- Build SEO rank tracking tools to monitor keyword positions.
- Create search result comparison tools between Google and Bing.
- Monitor brand presence and mentions across search engines.
- Build research tools that aggregate results from multiple search engines.
- Create competitive analysis tools for digital marketing.
- Build alternative search interfaces with Bing results.
Blog tutorial
Video tutorial
Contacts
Feel free to reach out via contact@serpapi.com.