DEV Community

Cover image for How to Scrape Bing Search Results: 4 Practical Methods
Stella Lin
Stella Lin

Posted on

How to Scrape Bing Search Results: 4 Practical Methods

Bing results are easy to copy until you need the same query every week, several pages of results, or a dataset that another developer can reproduce.

The practical choice depends on how much control you need:

  • Use an Octoparse template for a fast, standard keyword export.
  • Use Octoparse API or MCP when a verified workflow must run repeatedly.
  • Use Octoparse Desktop when you need custom fields, pagination, or filtering.
  • Use Python or a SERP service when extraction is one component of a larger application.

One important boundary: Microsoft retired the Bing Search APIs on August 11, 2025. Microsoft points customers toward Grounding with Bing Search for Azure AI agent grounding, which is a different product from collecting visible result rows. This guide focuses on browser-based extraction and code-first parsing, not on a hidden Bing API.

What does it mean to scrape Bing search results?

Scraping Bing search results means turning a visible result page into structured rows. A useful row normally includes the input keyword, result title, destination URL, description, and source name. A custom workflow can also record position, result type, sponsored status, related questions, or data from the destination page.

That is different from:

  • Crawling a website, which discovers pages by following links across a domain.
  • Bingbot, which is Microsoft's crawler for its search index.
  • Grounding with Bing Search, which supplies web context to an Azure AI agent rather than exporting a SERP table.

The goal here is a repeatable table that you can inspect, compare, and export.

Four ways to scrape Bing, from easiest to most flexible

Method Best for Setup Main trade-off
Octoparse template One-off or small batches of standard keyword results Lowest Inputs and fields follow the template schema
Octoparse API or MCP Scheduled jobs, agents, and repeatable cloud runs Moderate Automates supported Octoparse workflows; it is not a Bing API
Octoparse Desktop Custom fields, pagination, filters, and visual debugging Moderate You own more setup and testing
Python or a SERP service Code-first products and custom post-processing Highest Selectors, throttling, maintenance, and service cost remain your responsibility

Start with the smallest method that can answer the question. Automate only after the output schema is useful. Move to Desktop or Python when the standard fields stop matching the dataset your application needs.

Method 1: use the Bing Search Results Scraper template

The Bing Search Results Scraper template is the shortest path from a keyword to a spreadsheet. It accepts a language, country or area, one or more keywords, and a page count. You can run it from the browser or the Octoparse app without building selectors.

A repeatable template workflow

  1. Select the language and market you want to observe.
  2. Enter one keyword per line.
  3. Set the number of result pages.
  4. Run one representative query.
  5. Inspect the rows before exporting.
  6. Export only after the fields and result types look correct.

Do not treat a completed run as proof of a good dataset. Check row count, duplicates, empty cells, redirect URLs, and the difference between sponsored and organic results.

What one documented test returned

The original Octoparse article reports a reproducible test run completed on August 21, 2026 with the keyword web scraping, the United States market, and one page of results:

Check Observed value
Run time 1 minute 10 seconds
Rows 9
Reported duplicates 0
Export columns Keyword, Title, Link, Description, Source
CSV size 9,239 bytes

This is one test, not a guaranteed benchmark. The result included both sponsored and organic rows, and some sponsored rows had an empty Link field. Query, market, page layout, and run conditions can change the result.

Validate the template output

Field What it represents What to check
Keyword The input query associated with the row Market and spelling match the request
Title The visible result headline Ads, truncation, and missing text
Link Captured destination or tracking URL Empty values, redirects, and canonical URL
Description Visible result snippet Missing or changing snippets
Source Visible publisher or source name Empty or inconsistent values

Try the standard path: run one keyword through the Bing Search Results Scraper template, inspect the first page, and export only the checked rows.

Method 2: automate a verified workflow with API or MCP

Once a template or cloud task returns the fields you need, the next step is usually automation, not a complete rebuild.

Use the Octoparse API when code, a scheduler, n8n, Make, or an internal application needs deterministic control. Use Octoparse MCP when a compatible AI client should discover or run supported Octoparse workflows conversationally.

Both are control layers for Octoparse. They do not expose a replacement Bing Search API. The extraction definition still comes from a supported template or cloud task.

A safe automation boundary looks like this:

searchTemplates -> executeTask -> exportData
Enter fullscreen mode Exit fullscreen mode

Your application should verify all of the following before accepting the result:

  1. The selected template or task matches the intended input schema.
  2. The run reaches a terminal success state.
  3. The export contains rows instead of an empty file.
  4. Required columns are present.
  5. The exported artifact is readable and stored with its query, market, and collection time.

An accepted response means a task was created. It does not prove that a usable export is ready.

Keep API keys out of prompts, screenshots, and source control. Store secrets in an environment variable or secret manager, and rotate a key if it is exposed.

Automate a verified run: connect the Octoparse API workflow only after a manual test has confirmed the schema and result quality.

Method 3: build a custom workflow in Octoparse Desktop

Use Octoparse Desktop when the prepared template returns almost what you need, but not quite.

Desktop is useful when you need to:

  • separate sponsored blocks from organic results;
  • keep an explicit result-position field;
  • normalize tracking URLs;
  • add pagination or waits;
  • handle missing descriptions;
  • rename or remove columns; or
  • test the workflow against several localized result pages.

A practical Desktop workflow is:

  1. Open a representative Bing result URL in the built-in browser.
  2. Let auto-detection create an initial field set.
  3. Review the preview table and rename fields to your own schema.
  4. Add pagination, waits, or filters where the page requires them.
  5. Test a second query and market before scaling.
  6. Run and export only after the preview contains usable rows.

The preview is a schema test, not a promise that every future Bing page will behave the same way. Search layouts, result types, and localized pages change.

Method 4: scrape Bing with Python

Python makes sense when search extraction is one step inside a maintained application. You can normalize the rows, store them in a database, compare snapshots, or feed them into a ranking-analysis pipeline.

The following example is a minimal starting point for standard organic result cards. It is not a production scraper. Bing markup, localized layouts, throttling, and access rules can change.

from __future__ import annotations

import requests
from bs4 import BeautifulSoup


def fetch_bing_results(query: str, count: int = 10) -> list[dict]:
    response = requests.get(
        "https://www.bing.com/search",
        params={"q": query, "count": count},
        headers={"User-Agent": "Mozilla/5.0"},
        timeout=30,
    )
    response.raise_for_status()

    soup = BeautifulSoup(response.text, "html.parser")
    rows: list[dict] = []

    for card in soup.select("li.b_algo"):
        heading = card.select_one("h2 a")
        snippet = card.select_one(".b_caption p")

        if not heading:
            continue

        rows.append(
            {
                "query": query,
                "title": heading.get_text(" ", strip=True),
                "link": heading.get("href"),
                "description": (
                    snippet.get_text(" ", strip=True) if snippet else None
                ),
            }
        )

    return rows


if __name__ == "__main__":
    for result in fetch_bing_results("web scraping"):
        print(result)
Enter fullscreen mode Exit fullscreen mode

Before using code at scale, add bounded retries, respectful delays, logging, schema checks, and a stop condition. If you buy a maintained SERP interface instead, compare supported markets, data provenance, freshness, rate limits, retention, and total scenario cost rather than only the advertised price per request.

Store provenance with every result

A SERP row without context becomes difficult to trust a week later. Store the input and collection conditions next to the result:

from datetime import datetime, timezone


def add_provenance(row: dict, *, market: str, method: str, page: int) -> dict:
    return {
        **row,
        "market": market,
        "method": method,
        "page": page,
        "collected_at": datetime.now(timezone.utc).isoformat(),
    }
Enter fullscreen mode Exit fullscreen mode

At minimum, keep:

  • the exact query;
  • language and country or area;
  • collection timestamp and timezone;
  • page number and requested page count;
  • extraction method and task version;
  • sponsored versus organic classification; and
  • the original link before redirect or URL cleanup.

This makes duplicate checks, ranking comparisons, and debugging much easier.

Which method should you choose?

Choose based on the next decision your team needs to make:

  • One-off keyword research: use the template and export CSV or Excel.
  • Weekly monitoring: validate the template first, then automate it with API or MCP.
  • Custom SERP schema: use Desktop for position, result type, pagination, or URL cleanup.
  • Product engineering: use Python or a maintained SERP service when rows must flow directly into application code.

If the research covers more than one search engine, compare the differences rather than forcing every result page into one schema. Market, layout, ranking rules, and result types are not interchangeable.

Quality and responsible-collection checklist

Public visibility does not remove every obligation. Before scaling a workflow:

  • review current terms and applicable policies;
  • avoid bypassing authentication or technical controls;
  • use only the fields needed for the project;
  • apply reasonable request rates and bounded retries;
  • review personal or sensitive data before storage; and
  • involve legal or security reviewers for regulated or commercial use.

For data quality, compare a sample with the live page, distinguish ads from organic listings, test destination links, record empty fields, and keep the exact input conditions. A dataset that cannot explain how it was produced is difficult to reproduce.

FAQs

Does Bing still offer a Search API?

No general Bing Search API is available. Microsoft announced that the Bing Search APIs would be retired on August 11, 2025 and directed customers toward Grounding with Bing Search for Azure AI agent scenarios. Grounding is not a drop-in endpoint for exporting visible SERP rows.

Can I export Bing search results to Excel?

Yes. The Octoparse template supports spreadsheet-oriented exports such as CSV and Excel for supported workflows. Inspect the result first because ads, localization, and page layout affect which fields are populated.

What is the difference between the template, API, and MCP?

The template defines a ready-made extraction workflow. The API lets code control supported Octoparse tasks and retrieve their data. MCP lets compatible AI clients interact with supported Octoparse workflows. API and MCP automate Octoparse; they do not call a hidden Bing API.

Why did a test return fewer rows than expected?

A search page is not a fixed database response. Market, query, ads, layout, deduplication, and extraction rules can change the row count. The documented test returned 9 rows for one page, but another query can return a different result.

Which method is the most stable?

For a defined custom dataset, Desktop usually provides the most control because you can inspect and adjust the workflow. For the fastest standard export, a template is simpler. Stability still depends on testing, target changes, and ongoing validation.

Is it legal to scrape Bing search results?

That depends on the data, jurisdiction, access method, and intended use. Public visibility alone is not a complete legal analysis. Follow current terms, avoid circumvention, limit collection, and seek qualified advice for sensitive or commercial projects.

A practical starting point

Start with one representative keyword and one page. Run the template, inspect the fields, and save the CSV only after the schema looks right. If the same question returns next week, automate the verified workflow with API or MCP. If the standard fields are not enough, move into Desktop and build the extraction your application actually needs.

The original source is How to Scrape Bing Search Results (4 Methods, 2026). This DEV.to version keeps the source's documented test boundaries while adding a developer-oriented decision table, Python example, provenance model, and validation checklist.

Top comments (0)