Overview
Microsoft deprecated the Bing Search API on August 11th, 2025. This guide provides the technical details needed to migrate from Bing Search API to Exa’s search API.Quick Start
Get your API key
Get your Exa API key
Install the SDK
pip install exa-py
npm install exa-js
Replace your API calls
Bingcurl -H "Ocp-Apim-Subscription-Key: YOUR_BING_KEY" \
"https://api.bing.microsoft.com/v7.0/search?q=latest%20AI%20news&count=10"
import requests
response = requests.get(
'https://api.bing.microsoft.com/v7.0/search',
params={'q': 'latest AI news', 'count': 10},
headers={'Ocp-Apim-Subscription-Key': 'YOUR_BING_KEY'}
)
fetch(
"https://api.bing.microsoft.com/v7.0/search?q=latest%20AI%20news&count=10",
{
headers: {
"Ocp-Apim-Subscription-Key": "YOUR_BING_KEY",
},
}
);
curl -X POST https://api.exa.ai/search \
-H "Authorization: Bearer $EXA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "latest AI news",
"numResults": 10
}'
from exa_py import Exa
exa = Exa()
results = exa.search("latest AI news", num_results=10)
import Exa from "exa-js";
const exa = new Exa();
const results = await exa.search("latest AI news", { numResults: 10 });
Parameter Mapping
| Bing Parameter | Exa Parameter | Notes |
|---|---|---|
q | query | Required parameter |
count | numResults | Default: 10, Max: 100 |
mkt, cc | userLocation | Use 2-letter ISO country code |
freshness | startPublishedDateendPublishedDate | Use ISO 8601 date format |
site: operator | includeDomainsexcludeDomains | Use arrays of domain strings |
| Query filters | includeTextexcludeText | Use arrays of phrase filters |
safeSearch | moderation | Disabled by default, set to true to enable |
offset | Not supported |
Response Format Differences
Bing Response Structure{
"webPages": {
"value": [
{
"name": "Page Title",
"url": "https://example.com",
"snippet": "Description...",
"dateLastCrawled": "2025-08-11T00:00:00"
}
]
}
}
{
"results": [
{
"title": "Page Title",
"url": "https://example.com",
"publishedDate": "2025-08-11",
"author": "Author Name",
"text": "Full content when requested...",
"highlights": ["Key sentences..."]
}
],
"requestId": "unique-id"
}
Examples
Fresh Content Search
Bingcurl -H "Ocp-Apim-Subscription-Key: YOUR_KEY" \
"https://api.bing.microsoft.com/v7.0/search?q=AI+news&freshness=Week"
import requests
response = requests.get(
'https://api.bing.microsoft.com/v7.0/search',
params={'q': 'AI news', 'freshness': 'Week'},
headers={'Ocp-Apim-Subscription-Key': 'YOUR_KEY'}
)
fetch("https://api.bing.microsoft.com/v7.0/search?q=AI+news&freshness=Week", {
headers: {
"Ocp-Apim-Subscription-Key": "YOUR_KEY",
},
});
curl -X POST https://api.exa.ai/search \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "AI news",
"startPublishedDate": "2025-08-04T00:00:00Z",
"type": "auto"
}'
from datetime import datetime, timedelta
week_ago = (datetime.now() - timedelta(days=7)).isoformat() + "Z"
results = exa.search(
"AI news",
start_published_date=week_ago,
type="auto"
)
const weekAgo = new Date();
weekAgo.setDate(weekAgo.getDate() - 7);
const results = await exa.search("AI news", {
startPublishedDate: weekAgo.toISOString(),
type: "auto",
});
Domain-Specific Search
Bingcurl -H "Ocp-Apim-Subscription-Key: YOUR_KEY" \
"https://api.bing.microsoft.com/v7.0/search?q=site:arxiv.org+transformers"
import requests
response = requests.get(
'https://api.bing.microsoft.com/v7.0/search',
params={'q': 'site:arxiv.org transformers'},
headers={'Ocp-Apim-Subscription-Key': 'YOUR_KEY'}
)
fetch(
"https://api.bing.microsoft.com/v7.0/search?q=site:arxiv.org+transformers",
{
headers: {
"Ocp-Apim-Subscription-Key": "YOUR_KEY",
},
}
);
curl -X POST https://api.exa.ai/search \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "transformers",
"includeDomains": ["arxiv.org"],
"type": "auto"
}'
results = exa.search(
"transformers",
include_domains=["arxiv.org"],
type="auto"
)
const results = await exa.search("transformers", {
includeDomains: ["arxiv.org"],
type: "auto",
});
Search with Content Extraction
Exa provides integrated content extraction, eliminating the need for separate API calls:curl -X POST https://api.exa.ai/search \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "climate change research",
"numResults": 5,
"contents": {
"text": true,
"highlights": {
"query": "key findings"
}
}
}'
results = exa.search(
"climate change research",
num_results=5,
contents={
"text": True,
"highlights": {
"query": "key findings"
}
}
)
const results = await exa.search("climate change research", {
numResults: 5,
contents: {
text: true,
highlights: {
query: "key findings",
},
},
});