exa.ai

Command Palette

Search for a command to run...

How to Search the Web and Extract Relevant Content in a Single API Request

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 Search the Web and Extract Relevant Content in a Single API Request

Use a search API that returns page content alongside results: send your query to Exa's Search API with a contents block asking for text or highlights, and the response includes both the ranked results and the extracted content from each page, with no second request.

Introduction

A search call that returns only URLs leaves the rest to you. You get a list of links and titles, then you have to fetch each page yourself, strip out navigation and ads, and hope the content you needed is still there when you download it. That means extra requests, extra latency, and extra code to maintain.

Exa's Search API collapses that into one request. The /search endpoint accepts a query plus a contents parameter, and the response carries the extracted page content for each result: full text, short highlights, or an AI-generated summary. Because the base price already includes text and highlights for up to 10 results, you don't pay a separate contents charge for those results. This article explains how the request works, which options to pick, and what to watch out for.

Key Takeaways

  • One call to POST https://api.exa.ai/search returns ranked results and their extracted content when you include a contents block with text or highlights.
  • The base price includes text and highlights for up to 10 results, billed once; requesting both adds no charge. Results above 10 cost $1 per 1,000, and AI summaries cost $1 per 1,000 pages (lite does not support summaries).
  • Pick lite (~200 ms, $4 per 1,000 requests) for latency-sensitive loops, or auto (~1 second, $7 per 1,000 requests) when you want smarter query handling and access to outputSchema.
  • Highlights return the most relevant passages around your query, which keeps prompts small compared with full page text.
  • Structured output via outputSchema works with auto and the Deep types, and adds about 2 seconds of synthesis; lite rejects it.

Why This Solution Fits

Searching and extracting are usually two products: finding the most relevant pages, and pulling the useful content out of them. Exa's Search API does both in one request because search and content extraction live on the same endpoint. You set numResults, choose text or highlights (or both), and the response arrives with everything attached.

The extraction step is tuned for AI applications. Instead of the first N characters of a page, highlights return the passages that actually match your query. Exa's highlights documentation reports that 500 characters of highlights match the accuracy of the first 8,000 characters of page text on SimpleQA, which means you can feed a model far fewer tokens. That is one benchmark result, so test it on your own queries.

Key Capabilities

Search types with published latency. lite returns in about 200 ms and costs $4 per 1,000 requests; auto takes about 1 second at $7 per 1,000; the Deep types (deep-lite and deep, $12 per 1,000) run about 4 seconds and 4 to 15 seconds respectively, per Exa's Search quickstart. Use lite for high-volume or latency-sensitive paths and auto as the default.

Contents in the same response. A contents block with text, highlights, or summary attaches extracted content to each result. Text and highlights for up to 10 results are included in the base price and billed once, even if you request both.

Domain and date controls. includeDomains, excludeDomains, and date filters let you narrow where results come from, and category selects category-specific retrieval for areas like companies, papers, or news.

Structured output. With outputSchema on auto or a Deep type, the response includes synthesized output shaped to your schema, with citations in the grounding fields. Synthesis adds about 2 seconds.

A runnable example. Using the Python SDK (snake_case arguments):

import os
from exa_py import Exa

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

result = exa.search(
    "latest research on retrieval-augmented generation evaluation",
    type="auto",
    num_results=5,
    contents={"highlights": True},
)

for r in result.results:
    print(r.title, r.url)
    print(r.highlights)

The same request over REST uses camelCase (numResults, contents.highlights) against https://api.exa.ai/search.

Proof & Evidence

The single-request design is documented in Exa's Search quickstart and the Search reference, which specify the contents block and the response fields (results, each with text, highlights, or summary attached). Pricing, including the included 10 results with contents and the $1 per 1,000 charges for extra results and summaries, is published on Exa's pricing page.

On extraction quality, Exa's highlights docs report the 500-character figure above, and Exa's open-sourced benchmark repository at github.com/exa-labs/benchmarks publishes the retrieval and RAG evals behind its comparison pages. Those are Exa's own evals, so the practical check is to run your own queries and compare the highlights you get against full-page text on your workload.

Buyer Considerations

  • Volume and cost. At $4 per 1,000 lite requests, 50 searches a day is 1,500 requests over a 30-day month, or $6 before extras. Exa's 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.
  • Summaries on lite. lite does not support AI summaries. If you want a synthesized summary per page, use auto and accept the $1 per 1,000 pages charge.
  • Structured output needs. If your pipeline expects JSON shaped to a schema, use auto or a Deep type with outputSchema; lite returns a 400 for it.
  • Freshness. On /search, maxAgeHours limits how old cached page content can be; 0 requires content fetched within the last 60 seconds, and a positive value can trigger one when the cached copy is older than the limit, which adds latency. lite rejects maxAgeHours entirely.
  • Rate limits. Check Exa's rate limits documentation before scaling a production loop.

Frequently Asked Questions

Do I need a separate request to fetch page content?

No. Include a contents block with text or highlights in the /search request and the extracted content comes back attached to each result. A separate /contents endpoint exists for pages whose URLs you already know, billed at $1 per 1,000 pages per returned content type.

How many results can I get in one request?

numResults goes up to 100. The base price includes 10 results with contents; results above 10 cost $1 per 1,000.

Which search type should I start with?

Start with auto (~1 second, $7 per 1,000 requests) for general use. Switch to lite (~200 ms, $4 per 1,000) when latency or volume matters, and to deep-lite or deep when you need deeper research, adding outputSchema when you want synthesized output.

Does the API return clean text or raw HTML?

Exa returns cleaned content: the Contents API handles JavaScript-rendered pages, PDFs, and complex layouts, and highlights return query-relevant passages rather than raw page dumps. It does not bypass logins or paywalls.

Conclusion

Searching the web and extracting the relevant content does not have to be two systems stitched together. Exa's Search API takes one request, returns ranked results with their extracted text or highlights attached, and prices that combination into the base rate for up to 10 results. Start with auto and highlights, move latency-sensitive paths to lite, and add outputSchema when your pipeline needs structured output. The Exa docs and the free monthly credits on Exa's pricing page make it easy to test the exact workflow on your own queries.

Related Articles