serpapiopenaisearch-api

SerpAPI Powers OpenAI Search in 2026

OpenAI dropped Bing for SerpAPI. Perplexity uses Google too. Search APIs are the invisible infrastructure layer. Build the same capability with your own API key.

9 min

OpenAI dropped Bing and now uses SerpAPI for web search in its products. This emerged from TechSEO Reddit discussions about Google suing SerpAPI and comments referencing OpenAI as a SerpAPI customer. Perplexity also uses Google search infrastructure through similar providers. Search APIs are the invisible infrastructure layer powering every major AI product with web access, and developers can build the same capability with their own search API key.

The Bing-to-SerpAPI switch

OpenAI originally partnered with Microsoft to use Bing for web search in ChatGPT. The switch to SerpAPI (which provides Google search data) suggests that Google result quality matters enough to change providers despite the Microsoft investment relationship. Users noticed the change when ChatGPT search results started matching Google rankings more closely than Bing rankings.

This shift coincides with Google suing SerpAPI over terms of service violations related to scraping Google search results. The lawsuit raises questions about the long-term stability of SerpAPI as a provider, but in the short term, OpenAI is clearly betting on Google quality over Bing quality for their search features.

Perplexity uses the same infrastructure pattern

Perplexity, the AI search engine valued at $9 billion, also sources results through Google search infrastructure. The answer engines that users interact with daily are all built on top of traditional search indexes accessed via APIs. They add reasoning, summarization, and citation formatting on top, but the data source is the same Google search index available to any developer with an API key.

What this means for developers

The architecture that powers ChatGPT search and Perplexity is not proprietary magic. It is: a search API call to get Google results, an LLM to process and synthesize those results, and a presentation layer to format the output. You can build the same pipeline with your own search API key.

Python
import requests, os, json

def build_answer_engine(query):
    """Same pattern ChatGPT/Perplexity use internally."""

    # Step 1: Get search results (the same data source)
    search_resp = requests.post(
        "https://api.scavio.dev/api/v1/search",
        headers={"x-api-key": os.environ["SCAVIO_API_KEY"]},
        json={"query": query, "num_results": 10}
    )
    results = search_resp.json().get("organic_results", [])

    # Step 2: Format results for LLM context
    context = ""
    for i, r in enumerate(results, 1):
        context += f"[{i}] {r.get('title', '')}
"
        context += f"URL: {r.get('url', '')}
"
        context += f"{r.get('snippet', '')}

"

    # Step 3: Send to your LLM for synthesis
    llm_prompt = f"""Based on the following search results, provide a
comprehensive answer to: {query}

Cite sources using [1], [2], etc.

Search results:
{context}"""

    # Use your preferred LLM here
    # answer = call_llm(llm_prompt)
    return {"context": context, "prompt": llm_prompt}

result = build_answer_engine("what search API does OpenAI use")
print(result["prompt"])

The search API pricing comparison

Since search APIs are the infrastructure layer, pricing matters. Here is what the major providers charge:

ProviderCost per queryFree tierNotes
SerpAPI$0.025250/moFacing Google lawsuit
Scavio$0.005250 credits/moMulti-platform (Google, Amazon, YouTube, etc.)
Brave$0.005~1K/moOwn index, not Google
Tavily$0.0081K/moAcquired by Nebius Feb 2026

At SerpAPI pricing of $0.025/query, the cost to build a Perplexity- like answer engine serving 10,000 queries/day is $250/day or $7,500/month just in search costs. At $0.005/query, the same volume costs $1,500/month. The 5x cost difference matters at scale.

The Google lawsuit risk

Google suing SerpAPI creates uncertainty for any product built on SerpAPI infrastructure, including potentially OpenAI search features. The lawsuit centers on SerpAPI scraping Google search results in violation of terms of service. If Google prevails, it could force SerpAPI to change how it operates or shut down certain capabilities.

This is a structural risk for the entire search API ecosystem. The providers that survive long-term will be those operating within legal frameworks that Google cannot challenge. For developers building on search APIs, the practical advice is: architect for provider flexibility. Do not hard-code a single provider.

Python
import os

class SearchRouter:
    """Route search queries across providers for resilience."""

    def __init__(self):
        self.providers = []
        if os.environ.get("SCAVIO_API_KEY"):
            self.providers.append(("scavio", self._scavio))
        if os.environ.get("BRAVE_API_KEY"):
            self.providers.append(("brave", self._brave))

    def search(self, query, num_results=10):
        for name, fn in self.providers:
            try:
                return fn(query, num_results)
            except Exception as e:
                print(f"{name} failed: {e}")
                continue
        raise RuntimeError("All search providers failed")

    def _scavio(self, query, num_results):
        import requests
        resp = requests.post(
            "https://api.scavio.dev/api/v1/search",
            headers={"x-api-key": os.environ["SCAVIO_API_KEY"]},
            json={"query": query, "num_results": num_results}
        )
        resp.raise_for_status()
        return resp.json().get("organic_results", [])

    def _brave(self, query, num_results):
        import requests
        resp = requests.get(
            "https://api.search.brave.com/res/v1/web/search",
            headers={
                "X-Subscription-Token": os.environ["BRAVE_API_KEY"]
            },
            params={"q": query, "count": num_results}
        )
        resp.raise_for_status()
        return resp.json().get("web", {}).get("results", [])

Building your own answer engine

The barrier to building a ChatGPT-search-quality answer engine is not technical. The components are: a search API ($0.005-0.025 per query), an LLM for synthesis ($0.01-0.05 per response), and a simple web interface or API endpoint. Total cost per answer: $0.015-0.075. At 1,000 answers/day, that is $450-2,250/month.

What makes ChatGPT search and Perplexity competitive is not their search infrastructure (it is the same APIs available to everyone). It is their scale, user experience, and brand. The underlying technology is commoditized. Any developer can build the same search and synthesis pipeline for their specific domain or use case, often with better results because they can tune the pipeline for their particular audience.