惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
云风的 BLOG
云风的 BLOG
小众软件
小众软件
F
Fortinet All Blogs
爱范儿
爱范儿
WordPress大学
WordPress大学
N
Netflix TechBlog - Medium
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
C
Check Point Blog
博客园 - 聂微东
D
Docker
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
aimingoo的专栏
aimingoo的专栏
Vercel News
Vercel News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
A
About on SuperTechFans
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog
宝玉的分享
宝玉的分享
Jina AI
Jina AI
H
Hackread – Cybersecurity News, Data Breaches, AI and More

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Bing Search API Replacement: scrape SERP results for $1.0...
Devil Scrapes · 2026-05-31 · via DEV Community

Quick answer: Microsoft retired the Bing Search API on August 11, 2025. There is no longer an official endpoint. A Bing search scraper hits the same www.bing.com/search HTML endpoint any browser hits, decodes the bing.com/ck/a redirect wrappers to canonical URLs, and returns clean typed rows — query, position, title, URL, snippet, country, language, timestamp. The Apify Actor below costs $0.001 per row (~$1.05 per 1,000), with TLS fingerprint rotation, residential proxy routing, and Bing's pagination handled for you.

Microsoft's retirement notice landed on August 11, 2025, and thousands of teams who had wired Bing SERP data into rank trackers, brand-monitoring dashboards, and RAG pipelines found themselves holding a dead api.bing.microsoft.com call. The official replacement — "Grounding with Bing Search" inside Azure AI — is gated behind an Azure subscription and priced for LLM workflows, not raw SERP pulls. SerpApi and DataForSEO fill the gap at $75–225/month. DIY means debugging redirect wrappers at 11pm.

This post covers where a naive scraper breaks and how I packaged the fix as a cheap Apify Actor.

What is Bing Search? 🔎

Bing is Microsoft's web search engine. For SEO practitioners it matters because its ranking signals diverge from Google's — it weights on-page keyword density and anchor text differently, surfaces more forum content, and runs its own crawler (bingbot) with independent crawl frequency. For AI and RAG applications, Bing's index includes different long-tail pages than Google's; an LLM agent that only queries one engine has blind spots the other would fill.

The SERP itself — www.bing.com/search?q=<query> — is a server-rendered HTML page. It returns 10 organic <li class="b_algo"> blocks per page, paginated via &first=0,10,20,.... Everything the old API gave you (titles, URLs, snippets) is in that HTML.

Does Bing have an API for search results?

No — as of August 11, 2025, Microsoft has no official API for Bing organic search results. The Bing Web Search API v7 was retired on that date. The Azure AI "Grounding with Bing Search" product is a different surface, gated to the Azure OpenAI workflow and not available as a standalone SERP endpoint for arbitrary queries.

The only programmatic path to Bing SERP data is the public HTML endpoint the browser hits — which is what this Actor uses.

What the data looks like

Each organic result becomes one flat, Pydantic-validated row. Every field is verified against the ResultRow model in src/models.py before it reaches your dataset — no positional-array guessing, no silent null promotion:

{
  "query": "bing search api replacement",
  "position": 1,
  "title": "Bing Search Scraper — SERP organic results to JSON",
  "url": "https://apify.com/DevilScrapes/bing-search-scraper",
  "displayed_url": "https://apify.com › DevilScrapes › bing-search-scraper",
  "snippet": "Drop-in replacement for the retired Bing Search API. Returns title, URL, snippet, position for any query and locale.",
  "country": "US",
  "language": "en",
  "scraped_at": "2026-05-16T13:40:00.000Z"
}

Nine fields. The url is always the canonical destination — never a bing.com/ck/a redirect wrapper. The displayed_url is the breadcrumb Bing renders on screen. position is 1-indexed across all paginated pages, so position 11 is the first result on page 2 — no off-by-one math on your side.

The naive approach (and why it falls apart) 🔧

The SERP is just HTML, so the obvious path looks like:

import requests
from parsel import Selector

resp = requests.get("https://www.bing.com/search", params={"q": "bing api replacement"})
sel = Selector(text=resp.text)
for li in sel.css("li.b_algo"):
    print(li.css("h2 a::text").get())

This will fail in production. Three reasons, and they are why a hosted Actor earns its keep:

1. TLS fingerprint inspection. Bing inspects the JA3/JA4 signature of your TLS handshake. Python's stdlib ssl, requests, and httpx emit fingerprints no real browser produces — the server returns 403 before reading the query string. We route every request through curl-cffi's AsyncSession, impersonating Chrome 131, Chrome 124, or Firefox 147 TLS + HTTP/2 SETTINGS frames at the socket level, rotating profiles per page to reduce burst correlation.

2. The bing.com/ck/a redirect wrapper. Every organic href is a click-tracking redirect of the form https://www.bing.com/ck/a?...&u=a1<base64url>.... A naive parser hands you that wrapper, which joins to nothing downstream. We decode the u=a1<base64url> on every href — the url field in your dataset is always the canonical destination.

3. Proxy continuity across pagination. Bing serves 10 results per page. Rotating proxies mid-query degrades results: fewer organic blocks, more ads, eventually empty pages. We thread Apify residential proxies with a stable session_id per query's page-burst, then rotate on the next query. On 429/503 we retry with exponential backoff (2s → 4s → ... capped at 30s, max 5 attempts, honouring Retry-After). A query that exhausts retries doesn't abort the run — partial success surfaces via status message.

The Actor ⚙️

The result is packaged as an Apify Actor: Bing Search Scraper.

Run it from the Apify Console by pasting your queries into the input form, or call it programmatically:

from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run = client.actor("DevilScrapes/bing-search-scraper").call(
    run_input={
        "queries": [
            "bing search api replacement",
            "bing serp scraper",
            "scrape bing results python",
        ],
        "country": "US",
        "language": "en",
        "maxResultsPerQuery": 30,
        "useProxy": True,
    }
)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["position"], item["url"], item["snippet"])

Input parameters:

Field Type Default Notes
queries string[] required One row emitted per (query × result)
country string US ISO-3166-1 alpha-2, passed as cc=
language string en ISO-639-1, passed as setlang=
maxResultsPerQuery int 1–100 30 Capped at 100; Bing quality degrades past ~page 5
useProxy bool true Apify residential proxy; strongly recommended

The output streams to the default dataset as the scrape progresses — you can read partial results before the run finishes.

What you'd actually use this for 📊

Bing Search API migration. If you have any Python code calling api.bing.microsoft.com, it is dead. The Actor's input and output map to the same logical shape: queries in, ranked organic results out. The migration work is replacing the client call, not re-architecting the downstream.

SEO rank tracking across locales. Run the same query list with country=US, country=GB, country=DE on a weekly schedule and chart position drift over time. Locale-specific Bing rank tracking is hard to buy — most tools are Google-first.

Brand monitoring. Pull the top 30 results for branded queries and alert when a new domain enters the top 10. At 100 queries × 30 results that is 3,000 rows per run — $3.05 total including the actor-start fee.

AI agent retrieval / RAG diversification. LangChain's BingSearchAPIWrapper and LlamaIndex's BingToolSpec both called the now-dead endpoint. An Apify Actor call is the drop-in. Bing's index skews toward forum content and long-tail pages where Google's top results are SEO-dominated — the diversification is real.

Pricing — exact numbers 💰

Pay-per-event. You pay only for rows that land in your dataset. No data, no charge (beyond the warm-up fee).

Event Rate (USD) When
actor-start $0.05 Once per run
result-row $0.001 Per organic SERP row pushed
Pull Cost
100 rows $0.15
300 rows (10 queries × 30) $0.35
1,000 rows $1.05
3,000 rows (100 queries × 30) $3.05
10,000 rows $10.05

Apify's free $5 trial credit covers roughly 4,950 rows — no credit card required. For comparison, SerpApi's entry plan runs $75/month, and DataForSEO requires a separate account plus API key management. This Actor undercuts on simplicity and price by going direct to Bing's HTML endpoint.

The part worth understanding technically

The redirect decoder is the technically non-obvious piece. Bing wraps every organic href in bing.com/ck/a?!&&p=<hash>&u=a1<base64url>.... The u= parameter carries the destination URL prefixed with a1 and encoded as URL-safe base64:

import base64, re

def decode_bing_href(href: str) -> str:
    match = re.search(r"[?&]u=a1([A-Za-z0-9_-]+)", href)
    if not match:
        return href  # already canonical
    return base64.urlsafe_b64decode(match.group(1) + "==").decode("utf-8", errors="replace")

Bing has kept this format stable since at least 2023, but it's the detail that causes a naive scraper to silently fill your dataset with bing.com/ck/a junk that joins to nothing. Every URL is decoded before it reaches the dataset.

Limitations 🚧

  • Organic web results only. People-Also-Ask, news, images, videos, and local packs are out of scope for v1.
  • 100-result ceiling per query. Bing's HTML becomes unreliable past page 10. The Actor stops paginating rather than returning garbage.
  • No is_featured flag. Featured snippets that render inside b_algo blocks appear as regular rows; v1 has no way to distinguish them.
  • No JavaScript rendering. The current path hits server-rendered HTML (verified working 2026-05-16). A Bing move to client-rendering would require a Camoufox upgrade.
  • Snapshots only. Every run is a fresh snapshot. For time-series tracking, schedule runs and export to named Apify datasets or your own storage. Free-plan default storage purges after 7 days.
  • Country/language passed through, not validated. Unrecognized ISO codes silently return default results.

FAQ ❓

Is scraping Bing search results legal?
The Actor sends well-formed HTTP requests to the same public, unauthenticated page any browser accesses — no authentication bypass, no paywall, no personal data. Comply with Bing's Terms of Service and your jurisdiction's applicable law.

Can I export results to Google Sheets or a data warehouse?
Yes — download CSV, Excel, JSON, or XML from the Apify Console Export button, or use the ACTOR.RUN.SUCCEEDED webhook to push the dataset into Make, Zapier, or n8n. Raw API access via the Apify Dataset API.

Is there still an official Bing search API?
No. The Bing Web Search API v7 was retired August 11, 2025. Azure AI "Grounding with Bing Search" is a different surface — an LLM-workflow integration, not a raw SERP endpoint for arbitrary queries.

Why are the redirect URLs always decoded?
The bing.com/ck/a?...&u=a1<base64url> wrapper carries no information your workflow can use. Canonical URLs join cleanly with any URL-keyed dataset. The decode is always on; there is no option to keep the raw wrapper.

Try it

The Actor is live on the Apify Store: apify.com/DevilScrapes/bing-search-scraper.

Free $5 trial credit, no credit card. Paste bing search api replacement as your first query and you'll have 30 ranked results in your dataset in under a minute. Building something on top — a rank tracker, a brand-monitoring webhook, a RAG pipeline? Drop the use case in the comments. If there's a feature the README doesn't cover (PAA boxes, news vertical, location targeting), that's how v2 gets scoped.


Built by Devil Scrapes — Apify Actors with attitude. Pay-per-event, transparent pricing, no junk fields. 😈