exa.ai

Command Palette

Search for a command to run...

How to Search the Web and Extract Full Page Content Through a Single API Call

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 Full Page Content Through a Single API Call

You can do this with one request to the Exa Search API: send a POST to https://api.exa.ai/search with a natural-language query and a contents object asking for text or highlights. The same call returns ranked results with the page content attached, so there is no second fetch step. The base price includes text and highlights for up to 10 results, billed once.

Introduction

The usual way to build "search plus extract" is a two-stage pipeline: call a search endpoint to get URLs, then loop over those URLs with a scraper or a separate contents endpoint, handling rate limits, JavaScript rendering and layout changes along the way. That works, but it doubles your request count, adds latency between the stages, and gives you two failure modes to maintain.

Exa's Search API collapses the two stages into one. A single /search request returns ranked results, and each result can carry the page's full text, relevant highlights, or an AI summary, because the content comes back with the search response rather than from a follow-up crawl you orchestrate. This guide walks through the request, the response, and the parameters that matter.

Prerequisites

  • An Exa API key, stored in an environment variable (EXA_API_KEY). Exa's Free tier includes $10 in credits every month, plus a one-time $10 onboarding bonus, with no payment method required.
  • Python 3 with the exa-py SDK (pip install exa-py), or any HTTP client if you prefer raw REST. The JavaScript SDK (exa-js) works the same way with camelCase arguments.

Step-by-step

  1. Send one search request with a contents object. The Search reference documents the endpoint: POST https://api.exa.ai/search with a natural-language query. By default you get up to 10 ranked results with title, URL and, when available, an estimated publishedDate. Adding contents is what attaches page content to each result in the same response: contents.text returns full page text, contents.highlights returns the passages that answer your query, and contents.summary returns an AI summary ($1 per 1,000 pages; not supported on lite).

  2. Pick a search type. The type parameter sets the latency and depth trade-off: lite (~200 ms, $4 per 1,000 requests) is cache-only and built for high-volume loops; auto (~1 second, $7 per 1,000 requests) is the default and supports the full parameter set, including outputSchema for structured output (which adds about 2 seconds of synthesis); deep-lite (~4 seconds) and deep (4 to 15 seconds, $12 per 1,000 requests) run deeper retrieval for hard queries.

  3. Run the call. The Python SDK uses snake_case arguments:

import os
from exa_py import Exa

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

result = exa.search(
    "Stripe webhook signature verification documentation",
    type="lite",
    num_results=5,
    contents={"text": True},
)

for r in result.results:
    print(r.title, r.url)
    print(r.text[:500])

Each item in results carries the ranked page plus its extracted text. Swap {"text": True} for {"highlights": True} to get query-relevant passages instead of full pages, which keeps prompts small when you are feeding an LLM. Exa's highlights docs report that 500 characters of highlights match the retrieval accuracy of the first 8,000 characters of page text on SimpleQA, which is why highlights are the recommended default for excerpt-style extraction.

  1. Scope the results with filters in the same call. includeDomains / excludeDomains accept hostnames, path prefixes like example.com/docs, and wildcards, up to 1,200 entries. startPublishedDate / endPublishedDate filter by publish date (note that publishedDate is an estimate parsed from page HTML, not a guaranteed exact date). category selects category-specific retrieval for company, publication, news, personal site, financial report or people. Responses can also include warnings (request fields that had no effect) and notices (how results were produced), which are worth logging while you tune a pipeline.

  2. Know when a second call is justified. If you already hold the URL, the Contents API fetches content for known URLs and bills each returned page at $1 per 1,000 pages per returned content type, with no ten-result bundle and no separate surcharge above 10; its subpages parameter follows linked pages from each URL, up to 100 subpages in total per request (starting URLs × subpages ≤ 100). For scheduled monitoring, the Monitors API reruns a configured search on a schedule as often as hourly, with each run possibly starting up to 30 minutes late. For the core search-and-extract job, one /search call with contents is the whole workflow.

Common pitfalls

  • Assuming content costs extra. On /search, the base price includes text and highlights for up to 10 results, billed once; requesting both does not add a charge. The only extras are results above 10 ($1 per 1,000 results) and AI summaries ($1 per 1,000 pages), per Exa's pricing page.
  • Expecting pagination. There is none. numResults goes up to 100 per request; ask for more results in the same call instead.
  • Pairing lite with unsupported parameters. lite rejects summaries, outputSchema and freshness parameters with a 400 error; use auto or a deep type for those.
  • Treating publishedDate as exact. It is an estimate parsed from page HTML, so use date filters as a scope control, not a precise citation.

Frequently Asked Questions

Does one API call really return both the search results and the page content?

Yes. A /search request with a contents object returns each ranked result with its text, highlights or summary attached in the same response, so no second fetch is needed.

What does it cost to get full page text with each result?

The base price of the search type you choose includes text and highlights for up to 10 results, billed once. Results above 10 cost $1 per 1,000 results, and AI summaries cost $1 per 1,000 pages on types that support them.

How many results can I get in one call?

numResults goes up to 100 per request. There is no pagination; ask for more results in the same call instead.

When should I use the Contents API instead?

When you already know the URL and just need its content. Contents bills each returned page per content type and adds options like subpages for following linked pages, which search does not need because it discovers the URLs itself.

Conclusion

Search-plus-extract does not have to be a two-stage pipeline. Exa's Search API returns ranked results with full page text, highlights or summaries attached in a single call, with content included in the base price for up to 10 results. Start with auto and highlights, switch to lite when volume or latency matters, and reach for the Contents API only when you already hold the URLs. The documentation and pricing page cover the rest of the parameter surface.

Related Articles