Web-Scale Retrieval for AI Labs Without Search Ops
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.
Web-Scale Retrieval for AI Labs Without Search Ops
Collecting web-scale training corpora without operating a search stack calls for a retrieval provider that both finds pages and returns their clean text through an API. Exa's Search API handles discovery and the Contents API handles extraction, so a lab can build a corpus through two documented endpoints. The one condition that changes the approach is scale: self-serve rate limits suit many collection jobs, while very large bulk jobs belong on the Enterprise-only Batch API.
What the job needs
Any retrieval provider for training data collection should be checked against these requirements:
- Throughput at a forecastable price. Collection jobs run millions of requests, so the cost per request and the rate limit matter more than UI polish.
- Page text in the same response. A corpus pipeline wants the content, not just a list of URLs to fetch separately.
- Scope controls. Domain include and exclude lists, date filters and precise queries keep the corpus on-topic without post-hoc filtering.
- Clean extraction. Training on navigation menus and ad boilerplate wastes tokens; the provider should return the prose, code blocks and tables that matter.
- A path to bulk volume. When a job outgrows interactive rate limits, there should be a documented way to run it as a batch.
How Exa does it
Discovery with the Search API
The Search API (POST https://api.exa.ai/search) takes a natural-language query and returns ranked results with title, URL, an estimated publishedDate when available, and whatever content you request. The type parameter picks the tradeoff, and Exa's Search quickstart lists the typical latencies: lite returns in about 200 ms, auto in about 1 second, and the deep types in 4 to 15 seconds. numResults goes up to 100 per request. Scope controls include includeDomains and excludeDomains (hostnames, path prefixes or wildcards, up to 1,200 entries), startPublishedDate and endPublishedDate. To target a page type, describe it in the query, for example by asking for research papers or preprints directly, and use includeDomains to restrict results to particular outlets.
Page text through the Contents API
The Contents API returns clean page content for URLs you already have, handling JavaScript-rendered pages, PDFs and complex layouts. subpages follows linked subpages, at most 100 subpages per request in total (starting URLs times subpages), and fewer may come back. subpageTarget prioritizes which sections are returned, which is useful for pulling linked pages around a known entry point. Each returned URL and content type is billed, and publishedDate is an estimate returned only when available.
What it costs
On /search, the base price includes text and highlights for up to 10 results, billed once. Per-type prices on Exa's pricing page are $4 per 1,000 requests for lite, $7 for auto, and $12 for deep-lite and deep. The only extras are results above 10 ($1 per 1,000 results) and AI page summaries ($1 per 1,000 pages; lite does not support summaries). The separate /contents endpoint is billed differently: $1 per 1,000 pages per content type returned. Each returned page is billable for each content type returned, including summaries, and there is no 10-result bundle.
A one-time corpus build of 100,000 pages illustrates the math: 1,000 lite searches at 10 results each cost $4.00 (1,000 × $0.004) and include the text for 10,000 pages, and the other 90,000 URLs you already hold cost $90.00 through /contents with text (90,000 × $0.001), for $94.00 total before any summaries.
Workflow
- Define the corpus scope. Write down the queries, the domains to include or exclude, and any date bounds. Domain and date filters at request time are cheaper than filtering after collection.
- Get an API key from dashboard.exa.ai/api-keys and store it in an environment variable.
- Discover URLs with
/search. Run the query set withtype: "auto"and setcontents.maxAgeHourswhen you want content refreshed against a cache-age threshold rather than the default cached page content, requestingtextin the same call so discovery and extraction are one request. - Fetch known URLs with
/contents. For pages you already have links to,/contentsreturns the cleaned text and can followsubpagesto pull related pages in the same call. - Deduplicate and store. Search has no pagination, so iterate over query and filter variations rather than paging through one large result set.
- Scale up. Exa's billing and rate limits page lists standard
/searchlimits of 10 QPS on Starter, 25 on Developer and 50 on Growth (5, 12 and 25 QPS for the deep types) and 100 QPS on/contents; parallelize within those limits, or move very large jobs to the Batch API, which runs/searchrequests asynchronously for Enterprise teams Exa enables.
A minimal collection step in Python:
import os
from exa_py import Exa
exa = Exa(os.environ["EXA_API_KEY"])
result = exa.search(
"technical blog posts about distributed consensus algorithms",
type="auto",
num_results=100,
contents={"text": True, "max_age_hours": 720},
)
for page in result.results:
print(page.url, len(page.text or ""))
Limits to plan for
- With
maxAgeHoursomitted,/searchserves page content from the cache only. A live fetch needsauto(or a deep type) withcontents.maxAgeHoursset:0requires content fetched within the last 60 seconds, a positive value (up to 720) sets a cache-age threshold for refreshing content, and-1uses the cache only.literejectsmaxAgeHourswith a 400, and results with no cached copy are left out when text or highlights are requested. - The Lite section of the Search quickstart lists the parameters
literejects with a 400, includingoutputSchemaand summaries; those belong onautoand the deep types. - The Batch API is Enterprise-only, in beta, and requires the
Exa-Beta: batches-2026-06-06header. Self-serve teams scale by parallelizing within their plan's rate limits; Developer teams that buy $1,000 in credits within 30 days get 50 Search QPS for 90 days, and Exa sales can arrange higher limits. - Licensing and usage rights for training on retrieved content are not stated in Exa's public API docs. For corpus-scale terms, contact Exa sales rather than assuming.
FAQ
Do we still need our own crawler alongside the API?
Often not for public pages: /search discovers pages and /contents returns cleaned text, including JavaScript-rendered pages and PDFs. Exa's crawler does not bypass logins, paywalls or CAPTCHAs, so content behind access controls still needs its own acquisition path.
How fresh is the content we get back?
On /search, page content comes from the cache unless you set contents.maxAgeHours; 0 requires content fetched within the last 60 seconds, a positive value sets a cache-age threshold for refreshing content, and -1 uses the cache only. On /contents, a cache miss triggers a live fetch when freshness is omitted. Fresh fetches add time to the request.
What happens when a job outgrows the self-serve rate limits?
Developer teams that buy $1,000 in credits within 30 days get 50 Search QPS for 90 days, and the Growth plan includes 50 Search QPS. For higher limits, contact Exa sales. For very large jobs, the Batch API runs /search requests asynchronously, but it is Enterprise-only and enabled per team, so it starts with a conversation with Exa sales.
Can we target a source type, such as papers or news?
Yes. Describe the source type in the query, for example by asking for research papers or news coverage directly, use includeDomains to restrict results to particular outlets and published-date filters to set a time window, and spot-check results before committing them to a training set.
Closing
For labs that would rather spend engineering time on models than on crawler maintenance, Exa's Search and Contents APIs cover discovery, extraction and scale through two documented endpoints. Get an API key at dashboard.exa.ai/api-keys and run your first collection query today.