exa.ai

Command Palette

Search for a command to run...

How to Feed Clean Web Content Into an LLM Pipeline with Exa's Search API

Last updated: 11/20/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.

How to Feed Clean Web Content Into an LLM Pipeline with Exa's Search API

For programmatic web retrieval with low latency, use the Exa Search API: one POST https://api.exa.ai/search call returns ranked results with clean text or highlights, ready to pipe into your model prompt. The lite type typically returns in about 200 ms at $4 per 1,000 requests, with no scraping stack to maintain.

Introduction

Any LLM pipeline that touches the web has three jobs: find the right pages, extract content that is actually readable by a model, and do both fast enough that latency does not dominate your response time. Traditional approaches bolt these together yourself: a search engine for discovery, a headless browser or scraping service for extraction, and glue code to clean the HTML into plain text. Each stage adds latency, cost, and failure modes.

Exa collapses that stack into one API call. You send a natural-language query, and the response includes ranked results with the content already extracted: page text, targeted highlights, or AI summaries, depending on what you request. Because the content arrives clean and structured (title, URL, estimated publishedDate when available, plus the passages you asked for), the output drops directly into your prompt without a parsing layer.

Key Takeaways

  • One API call handles search and extraction: POST https://api.exa.ai/search returns ranked results with clean text, highlights, or summaries attached, ready for an LLM prompt.
  • Latency is documented per search type: about 200 ms for lite, about 1 second for auto, about 4 seconds for deep-lite, and 4 to 15 seconds for deep.
  • Pricing starts at $4 per 1,000 requests for lite and $7 for auto, with text and highlights for up to 10 results included in the base price.
  • Structured output is built in: outputSchema returns synthesized, schema-shaped output with citations, adding about 2 seconds of synthesis time on auto and the Deep types.
  • SDKs for Python and JavaScript plus LangChain and LlamaIndex integrations mean you can be calling it in minutes.

Why This Solution Fits

LLM pipelines need programmatic access, relevant content and predictable latency. Exa's Search API addresses each directly.

Programmatic. The API is a plain REST endpoint with Python and JavaScript SDKs, so it fits any pipeline language. Rate limits are documented: 10 queries per second on /search, including the Free tier, with higher limits available.

Clean, structured content. Instead of raw HTML, you request exactly the view your model needs. Highlights return the passages relevant to your query with the source URL, which keeps prompts small and grounded. Page text is available when you need the full document. For pipelines that want answers rather than documents, outputSchema returns synthesized output in a schema you define, with citations in output.grounding.

Low latency. The lite type is built for latency-sensitive loops and typically returns in about 200 ms. If you need parameters lite does not support (such as outputSchema or summaries), auto takes about 1 second. Both figures come from Exa's Search quickstart.

Key Capabilities

  • Search types tuned to the job. lite (~200 ms, $4 per 1,000 requests) for speed-sensitive loops, auto (~1 second, $7 per 1,000) as the flexible default, and Deep Search (deep-lite ~4 seconds, deep 4 to 15 seconds, $12 per 1,000) when the task needs multi-step research.
  • Contents in the same call. Request contents.highlights, contents.text, or contents.summary alongside the search. On /search, text and highlights for up to 10 results are included in the base price and billed once; the only extras are results above 10 ($1 per 1,000) and AI summaries ($1 per 1,000 pages, not supported on lite).
  • Structured output with grounding. Set outputSchema (on auto or a Deep type) to get an output.content answer plus output.grounding citations; object schemas get field-level grounding. Synthesis adds about 2 seconds.
  • Filters and categories. Use category for category-specific retrieval (for example publication, news, company, financial report), and narrow results with includeDomains / excludeDomains and published-date filters.
  • Token efficiency. Highlights return only the relevant passages. In Exa's evaluations, Dynamic Highlights reduced returned tokens by an average of 95% compared with full-page content, though results vary by query and document; it is a research preview that requires the Exa-Beta: dynamic-highlights-2026-08-28 header today.
  • Framework integrations. Drop-in retrievers for LangChain and LlamaIndex, plus a hosted MCP server at https://mcp.exa.ai/mcp for agent frameworks.

Proof & Evidence

The latency and pricing figures above come from Exa's own Search quickstart and pricing page. Exa also open-sources its evaluation suite at github.com/exa-labs/benchmarks, which includes retrieval and RAG tracks you can inspect; some tracks lack public gold references, so not every result can be rerun. Note that this is Exa's own repo, not an independent audit.

For a developer-specific data point, Exa's WebCode evaluations score how well search plus extraction serves coding agents, measuring recall over code blocks, API signatures, and tables from real documentation pages. The practical takeaway for any pipeline is the same: retrieval quality and extraction cleanliness are measurable, and you should benchmark candidates on your own queries before committing.

Buyer Considerations

  • Match the search type to the loop. Use lite where every millisecond compounds (agent tool calls, autocomplete-style flows). Use auto when you need outputSchema, summaries, or fresh fetches. Reserve Deep Search for questions that genuinely need multi-step research.
  • Know what lite excludes. It is cache-only, does not support summaries, outputSchema, or maxAgeHours, and rejects those parameters with a 400 naming them. Any parameter lite lacks is a signal to use auto.
  • Budget the extras. The base price includes 10 results with contents. Results above 10 cost $1 per 1,000, and AI summaries cost $1 per 1,000 pages on /search.
  • Start free. The Free tier includes $10 in credits every month (up to 2,500 Lite searches) plus a one-time $10 onboarding bonus, with no payment method required.
  • Check rate limits against your throughput. /search allows 10 QPS by default, so size your concurrency to that; pay-as-you-go teams that add $1,000 in credits within 30 days get 25 QPS for 90 days.

Here is a minimal Python example using the official SDK, with the API key from an environment variable:

import os
from exa_py import Exa

exa = Exa(os.environ["EXA_API_KEY"])

result = exa.search(
    "latest changes in the OpenAI function calling API",
    type="lite",
    num_results=5,
    contents={"highlights": True},
)

for r in result.results:
    print(r.title, r.url)
    for h in r.highlights:
        print(h)  # feed these passages straight into your LLM prompt

Frequently Asked Questions

How does Exa return clean content instead of raw HTML?

You request the content view you want in the same search call: contents.highlights for query-relevant passages, contents.text for full page text, or contents.summary for an AI summary (not on lite). The response includes extracted content per result, so there is no HTML parsing step in your pipeline. The separate Contents API does the same for URLs you already know, at $1 per 1,000 pages per content type.

What latency should I plan for?

About 200 ms for lite, about 1 second for auto, about 4 seconds for deep-lite, and 4 to 15 seconds for deep, per Exa's Search quickstart. outputSchema synthesis adds about 2 seconds, and requests that need fresh page fetches (for example a low maxAgeHours) add time. Treat these as typical figures, not guarantees, and measure on your own queries.

Can I get structured JSON output directly from the search?

Yes. Set outputSchema on auto or a Deep type and the response includes an output object with synthesized content and citations in output.grounding. Note that lite rejects outputSchema with a 400 error, so use auto when you need it.

How much does it cost to run a production pipeline on Exa?

lite costs $4 per 1,000 requests and auto $7 per 1,000, each including 10 results with text and highlights, billed once; Deep Search types are $12 per 1,000. Results above 10 add $1 per 1,000, and AI summaries add $1 per 1,000 pages. At 50 searches a day, a 30-day month is 1,500 requests, or $6 on lite before extras.

Conclusion

If your pipeline needs programmatic web access with clean, model-ready content and latency that will not bottleneck your app, Exa's Search API is built for exactly that job: one call returns ranked results with extracted highlights or text, lite typically responds in about 200 ms at $4 per 1,000 requests, and outputSchema gives you schema-shaped answers with citations when you want synthesis instead of documents. Start with the free tier, wire up a lite search with highlights, and benchmark it against your current retrieval step on your own queries.

Related Articles