Microsoft discontinued the Bing Search API in 2025. Azure AI agents that depended on it need a replacement. This tutorial walks the migration to Scavio.
Prerequisites
- Azure Function or Container App with old Bing code
- Scavio API key
Walkthrough
Step 1: Identify Bing calls in code
Most are GET /v7.0/search.
// Before:
// const r = await fetch(`https://api.bing.microsoft.com/v7.0/search?q=${q}`, { headers: { 'Ocp-Apim-Subscription-Key': BING_KEY } });Step 2: Replace with Scavio
POST with x-api-key.
// After:
const r = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST',
headers: { 'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ query: q })
}).then(r => r.json());Step 3: Map response shape
Bing's webPages.value[] becomes organic_results[].
// Bing: r.webPages.value[i].url + .name + .snippet
// Scavio: r.organic_results[i].link + .title + .snippetStep 4: Update Azure Functions config
Swap the env var.
# In Azure Portal: replace BING_KEY with SCAVIO_API_KEY.Step 5: Add Reddit + YouTube as bonus surfaces
Bing never had these cleanly.
// Optional new tools:
// fetch('https://api.scavio.dev/api/v1/reddit/search', ...)Python Example
# Same in Python — the migration is a 5-line diff per call site.JavaScript Example
// Bing migration in Azure Functions: typically 10-30 minutes per function.Expected Output
Azure agents continue functioning post-Bing-shutdown. Multi-surface (Reddit/YouTube) added as bonus.