ScavioScavio
ToolsPricing
Sign InsGet Startedg
Blog
deepseekserperexa

What Powers DeepSeek Search: Serper and Exa Backends

DeepSeek routes search through Serper for Google SERP data and Exa for semantic retrieval. How the architecture works and how to replicate it with any search API.

May 13, 2026
7 min
Try Scavio FreePricing

50 free credits · no credit card

DeepSeek uses Serper for Google SERP data and Exa for semantic web search as its primary search backends. When DeepSeek V4 activates its search tool, queries route to these providers to fetch live results that get injected into the model context window before generating a grounded response. This is the same architecture any developer can replicate with a search API and an LLM.

Serper: the Google data layer

Serper provides Google SERP data at $50/yr (Dev, 50K searches) or $50/mo (Pro, 500K searches). It returns organic results, featured snippets, People Also Ask, knowledge panels, and local results from Google. DeepSeek uses Serper when it needs traditional web search results -- finding documentation, current pricing, news articles, and factual information.

Exa: the semantic search layer

Exa provides neural search that understands meaning rather than just matching keywords. At 1K free searches/month and $5/1K after, it excels at finding conceptually related content. DeepSeek uses Exa when the query is more exploratory -- "papers about transformer efficiency" rather than "transformer model latest version."

How to replicate DeepSeek search locally

Python
import os, requests

def deepseek_style_search(query: str, search_type: str = "auto") -> dict:
    """
    Replicate DeepSeek's search grounding pattern.
    Route to keyword search for factual queries,
    semantic search for exploratory queries.
    """
    # Simple routing heuristic
    factual_signals = ["price", "cost", "version", "release", "how to",
                       "what is", "when did", "latest"]
    is_factual = any(s in query.lower() for s in factual_signals)

    if search_type == "auto":
        search_type = "factual" if is_factual else "semantic"

    if search_type == "factual":
        # Use structured SERP API (like DeepSeek uses Serper)
        resp = requests.post(
            "https://api.scavio.dev/api/v1/search",
            headers={"x-api-key": os.environ["SCAVIO_API_KEY"]},
            json={"query": query, "num_results": 5,
                  "include_ai_overview": True},
        )
        data = resp.json()
        return {
            "type": "factual",
            "results": [
                {"title": r["title"], "url": r["link"],
                 "text": r["snippet"]}
                for r in data.get("organic_results", [])
            ],
            "ai_overview": data.get("ai_overview", {}).get("text", ""),
        }
    else:
        # Same API, different query framing
        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},
        )
        data = resp.json()
        return {
            "type": "semantic",
            "results": [
                {"title": r["title"], "url": r["link"],
                 "text": r["snippet"]}
                for r in data.get("organic_results", [])
            ],
        }

# Factual query (would use Serper in DeepSeek)
pricing = deepseek_style_search("SerpAPI pricing 2026")
print(f"Found {len(pricing['results'])} results (factual)")

# Exploratory query (would use Exa in DeepSeek)
research = deepseek_style_search("approaches to reducing LLM hallucination")
print(f"Found {len(research['results'])} results (semantic)")

Building a full search-grounded agent

Python
from anthropic import Anthropic

client = Anthropic()

def grounded_agent(question: str) -> str:
    """Agent with DeepSeek-style search grounding."""
    # Step 1: Search for context
    search_result = deepseek_style_search(question)

    # Step 2: Build grounding context
    context_parts = []
    if search_result.get("ai_overview"):
        context_parts.append(f"AI Overview: {search_result['ai_overview']}")
    for r in search_result["results"][:5]:
        context_parts.append(f"[{r['title']}]({r['url']}): {r['text']}")
    context = "\\n\\n".join(context_parts)

    # Step 3: Generate grounded response
    response = client.messages.create(
        model="claude-sonnet-4-20250514",
        max_tokens=1024,
        messages=[{"role": "user", "content":
            f"Answer based on these sources:\\n{context}\\n\\nQuestion: {question}"}],
    )
    return response.content[0].text

answer = grounded_agent("What search APIs does DeepSeek use?")
print(answer)

Why you might want a different backend

Serper is Google-only. Exa is semantic-only. Neither provides Google Maps, Shopping, News, Reddit, or TikTok data. A multi-platform search API gives you all of these from one integration, which is more versatile for agents that need diverse data sources.

Cost to replicate DeepSeek search

  • Serper + Exa: $50/yr + $5/1K = ~$10/mo for 1K searches
  • Scavio alone: $30/mo for 7K credits (covers both factual and semantic)
  • Tavily: $30/mo Researcher (1K-ish queries)
  • Brave: $5/1K queries

Key takeaway

DeepSeek V4 search is not magic. It is Serper + Exa behind a tool-calling interface. You can build the same thing with any search API and any LLM. The architecture is simple: route query to search, inject results into context, generate grounded response. The value is in the routing logic and prompt design, not the search provider.

Common questions

What search engine does DeepSeek use? DeepSeek routes its search tool through third-party providers rather than crawling the web itself: Serper for Google SERP results and Exa for semantic retrieval. Results are injected into the context window before the model generates a grounded answer.

Can DeepSeek access the web? Only through its search tool. The model has no live browsing of its own; a provider fetches results and those results are placed in context. Without that tool call it answers from training data alone.

How do I build the same search architecture? Three parts: a SERP provider for ranked results, an extraction step for page content, and a prompt that requires citations. Scavio covers the first two under one key, returning Google results as structured JSON and page content via /api/v1/extract.

Does ChatGPT use the same backends? No. OpenAI operates its own crawler and index for browsing. The pattern of routing to a third-party SERP API is more common among labs that have not built crawling infrastructure.

Continue reading

amazonai-agents

Your Agent's Web Search Tool Cannot See the Price

11 min read
ebayebay-api

eBay Sold Listings Now Require a Login. What Can Price Research Use Instead?

12 min read
ScavioScavio

One scraper API for every social, search and ecommerce platform. Built for AI agents.

Product

  • Features
  • Pricing
  • Dashboard
  • Affiliates

Developers

  • Documentation
  • API Reference
  • Quickstart
  • MCP Integration
  • Python SDK

Alternatives

  • Tavily Alternative
  • SerpAPI Alternative
  • Firecrawl Alternative
  • Exa Alternative
  • Serper Alternative
  • Tavily vs Scavio
  • SerpAPI vs Scavio
  • All alternatives
  • Compare Scavio vs alternatives

Search APIs

  • Google Search API
  • Amazon Product API
  • YouTube API
  • Reddit API
  • Walmart Product API
  • TikTok API
  • Instagram API

Tools

  • All Tools

© 2026 Scavio. All rights reserved.

Featured on TAAFT
Terms of ServicePrivacy Policy