<!-- twin of https://specstream.ai/bing-search-api-python -->
# Bing Search API in Python: the v7 call that still answers

Compared on Nov 10, 2026. The page: https://specstream.ai/bing-search-api-python

Microsoft retired the Bing Search APIs on August 11, 2025, so the Python samples that call `api.bing.microsoft.com` no longer get an answer. Its replacement, Grounding with Bing Search, gives developers no raw results.

SpecStream answers the same `GET /v7.0/search` in Bing's JSON. In Python, set the address to `https://api.specstream.ai/v7.0/search` and put a SpecStream key in `Ocp-Apim-Subscription-Key`.

It scores 97.9 F-score on all 1,000 SimpleQA Verified questions, on the [benchmarks](https://specstream.ai/benchmarks?utm_source=alternatives&utm_campaign=bing-search-api-python) page. Searches cost $5 per 1,000.

[Get an API key](https://specstream.ai/signup?src=alternatives-bing-search-api-python&utm_source=alternatives-md&utm_campaign=bing-search-api-python&returnTo=%2Fworkspace%2Fsearch%3Froute%3Dbing) New accounts get $10 of credit, no card. It covers 2,000 searches.

## The v7 call from Python: SpecStream, Bing and Grounding with Bing Search

| | SpecStream | Bing Web Search API v7 | Grounding with Bing Search |
|---|---|---|---|
| The call | `GET https://api.specstream.ai/v7.0/search` with the key in `Ocp-Apim-Subscription-Key` | `GET https://api.bing.microsoft.com/v7.0/search` with the key in `Ocp-Apim-Subscription-Key` | A tool an agent calls in Azure AI Agents, while a model writes its response |
| Status on Nov 10, 2026 | Live. New accounts start with $10 of credit, no card | Retired on August 11, 2025. Every existing instance was decommissioned and new customer signup ended | Microsoft's named replacement for the Bing Search APIs |
| What Python reads | `webPages.value[]` with `id`, `name`, `url`, `displayUrl`, `snippet` and `datePublished` when known, `webPages.totalEstimatedMatches`, `queryContext` and `rankingResponse` | `webPages.value` with `name`, `url` and `snippet` for each result | A model's response with citations. Developers and end users have no access to the raw content it returns |
| Results a call | `count` from 1 to 50, 10 by default | `count` defaulted to 10, with a maximum of 50 | `count` defaults to 5, with a maximum of 50 |
| Paging and dates | `offset` from 0 to 10,000. `freshness` takes `Day`, `Week`, `Month`, a date range or one date | `offset` was the zero-based number of results to skip. `freshness` filtered by age | The model might not use every result |
| Price | $5 per 1,000 searches of up to 10 results. `count=50` costs $0.029 a call | Retired. The product is no longer available for new customer signup | $14 per 1,000 transactions, counted by the number of tool calls per run |
| Volume | No daily limit. Up to 8,800 searches a minute on one account; a call over that gets a `429` with `Retry-After` and is not charged | No calls since August 11, 2025 | 150 transactions per second and 1 million transactions a day |

## Why Python code that called Bing moves to SpecStream

### The call with requests

This is Microsoft's Python sample with two values changed: the address and the key. It treats a missing `webPages` as no results, which is how Bing answered a search that found nothing.

```
import os
import requests

SEARCH_URL = "https://api.specstream.ai/v7.0/search"  # was https://api.bing.microsoft.com/v7.0/search
headers = {"Ocp-Apim-Subscription-Key": os.environ["SPECSTREAM_API_KEY"]}
params = {"q": "Who founded Mistral AI and when?", "count": 10, "textFormat": "Raw"}

response = requests.get(SEARCH_URL, headers=headers, params=params, timeout=30)
results = response.json()
if response.status_code != 200:
    raise RuntimeError(results["errors"][0]["message"])

for page in results.get("webPages", {}).get("value", []):
    print(page["name"], page["url"], page["snippet"], sep="\n  ")
```

An error comes back as Bing's `ErrorResponse`: `{"_type": "ErrorResponse", "errors": [{"code", "subCode", "message"}]}`, with Bing's codes such as `InvalidAuthorization` and `InvalidRequest`.

### Paging with offset, and fresh results

`offset` counts results to skip, as on Bing. Add `freshness` for recent pages. Each call of up to 10 results is one search at $0.005.

```
import os
import requests

SEARCH_URL = "https://api.specstream.ai/v7.0/search"
headers = {"Ocp-Apim-Subscription-Key": os.environ["SPECSTREAM_API_KEY"]}

def search(q, pages=3, count=10, freshness=None):
    found = []
    for n in range(pages):
        params = {"q": q, "count": count, "offset": n * count}
        if freshness:
            params["freshness"] = freshness  # Day, Week, Month or 2026-10-01..2026-11-01
        data = requests.get(SEARCH_URL, headers=headers, params=params, timeout=30).json()
        value = data.get("webPages", {}).get("value", [])
        if not value:
            break
        found += value
    return found

for page in search("vector database funding", freshness="Week"):
    print(page.get("datePublished", ""), page["url"])
```

### The parameters your code already sends

`q`, `count`, `offset` and `freshness` work as on Bing, and `textFormat=HTML` escapes the text. `mkt`, `setLang`, `cc`, `safeSearch`, `responseFilter`, `answerCount`, `promote` and `textDecorations` are accepted and do not change the search, so a request your code sends today needs no edit. The key also works as a Bearer token or as `subscription-key=` in the address. `dateLastCrawled` is not returned.

### $5 per 1,000 searches and the best scores published

A call of up to 10 results is $0.005, and each started block of 10 more adds $0.006, so `count=50` is $0.029. Grounding with Bing Search costs $14 per 1,000 transactions. SpecStream scores 97.9 F-score on all 1,000 SimpleQA Verified questions (978 correct) and 64.0 item F1 and 43.4 row F1 on all 200 WideSearch tasks. On production on November 9, 2026, the median call took 0.82 s at 1 search a second and 1.07 s at 20 a second.

### What is kept from a search

Only the charge, on a key with zero retention: no request text and no answer after the reply. Grounding with Bing Search sends your data outside the Azure compliance and Geo boundary, and Microsoft's Data Protection Addendum does not apply to it.

### The same key reads pages and returns rows

The [Extract API](https://specstream.ai/extract-api?utm_source=alternatives&utm_campaign=bing-search-api-python) reads up to 20 pages or documents a call at $0.80 per 1,000 pages and scores 0.908 F1 on WCXB. [Deep Search](https://specstream.ai/deep-search?utm_source=alternatives&utm_campaign=bing-search-api-python) returns every match for a request in plain words as structured rows at 5¢, 15¢ or $1 a row, and quotes the most a run can cost before it starts.

## Other options for Bing Search in Python

### Grounding with Bing Search

Microsoft's named replacement, a tool inside Azure AI Agents at $14 per 1,000 transactions. Your Python code gets the model's response and citations, never the raw results. SpecStream returns `webPages.value[]` to your code at $0.005 a search.

### Brave Search API

A search API on Brave's own index at $5 per 1,000 requests, with $5 in free credits every month and a capacity of 50 queries per second. Its reply has Brave's own shape, so the Python that reads Bing's is rewritten. On SpecStream it stays.

### SerpApi

A search results API sold in monthly plans. The Starter plan is $25 a month for 1,000 searches. On SpecStream $25 pays for 5,000 searches, and credit you top up never expires.

### Tavily

A search API for agents, billed in credits at $0.008 a credit on pay as you go. SpecStream answers Tavily's call too, at `https://api.specstream.ai/tavily/search`, and the Bing call on the same key, for $0.005 a search.

## How to run the Python example

1. Create a key under Agents & API in the workspace. A new account gets $10 of credit, no card, which covers 2,000 searches.

2. Put it in the environment and install `requests`.

```
export SPECSTREAM_API_KEY="your key"
pip install requests
```

3. Run the example above. In code that called Bing, change `https://api.bing.microsoft.com/v7.0/search` to `https://api.specstream.ai/v7.0/search` and the key. The parser stays.

When your product needs every match in place of a results page, write the request in plain words. SpecStream reads it back as the conditions every row must meet and the facts to bring back, quotes the most it can cost, and delivers the rows after you approve.

## Frequently asked questions

### How do I use the Bing Search API in Python?

Send `GET /v7.0/search` with `q` and `count` and the key in `Ocp-Apim-Subscription-Key`, then read `webPages.value[]`. Microsoft retired its endpoint on August 11, 2025, and the same call answers at `https://api.specstream.ai/v7.0/search` with a SpecStream key.

### Does the Microsoft Python sample still work?

Not against `api.bing.microsoft.com`, which was decommissioned on August 11, 2025. Change `search_url` to `https://api.specstream.ai/v7.0/search` and the key, and the rest of the sample runs as written.

### Do I need an Azure SDK?

No. The call is one HTTP GET, so `requests` is enough. Each call of up to 10 results costs $0.005.

### How do I get more than 10 results?

Set `count` up to 50 for one call, which costs $0.029, and page with `offset`. On the same key, `GET https://api.specstream.ai/v1/web-search` returns up to 100 results in one search.

### Why does my code get a KeyError on webPages?

A search with 0 results has no `webPages` key, as on Bing. Read it with `data.get("webPages", {}).get("value", [])`, as the examples here do.

### What does it cost compared with Grounding with Bing Search?

$5 per 1,000 searches at SpecStream against $14 per 1,000 transactions for Grounding with Bing Search. Every SpecStream rate is on the [pricing](https://specstream.ai/pricing?utm_source=alternatives&utm_campaign=bing-search-api-python) page.

## Sources

SpecStream wrote this page. Each figure about Bing comes from Microsoft's own pages, and each other figure from that company's own page.

- [Microsoft: Bing Search APIs retiring on August 11, 2025](https://learn.microsoft.com/en-us/lifecycle/announcements/bing-search-api-retirement), read Nov 9, 2026
- [Microsoft: Bing Web Search API Python quickstart](https://learn.microsoft.com/en-us/bing/search-apis/bing-web-search/quickstarts/rest/python), read Nov 9, 2026
- [Microsoft: Bing Web Search API query parameters](https://learn.microsoft.com/en-us/bing/search-apis/bing-web-search/reference/query-parameters), read Nov 9, 2026
- [Microsoft: Bing Web Search API response objects (archived)](https://learn.microsoft.com/en-us/previous-versions/bing/search-apis/bing-web-search/reference/response-objects), read Nov 9, 2026
- [Microsoft: Grounding with Bing pricing](https://www.microsoft.com/en-us/bing/apis/grounding-pricing), read Nov 9, 2026
- [Microsoft: Grounding with Bing Search tools](https://learn.microsoft.com/en-us/azure/foundry/agents/how-to/tools/bing-tools), read Nov 9, 2026
- [Brave Search API](https://brave.com/search/api/), read Nov 9, 2026
- [SerpApi pricing](https://serpapi.com/pricing), read Nov 9, 2026
- [Tavily pricing](https://tavily.com/pricing), read Nov 9, 2026
- [SpecStream benchmarks](https://specstream.ai/benchmarks), read Nov 10, 2026
- [SpecStream pricing](https://specstream.ai/pricing), read Nov 10, 2026
- [SpecStream for agents](https://specstream.ai/agents.md), read Nov 10, 2026
