exa.ai

Command Palette

Search for a command to run...

Web Training Data Without Building Your Own Crawler

Last updated: 11/26/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.

Web Training Data Without Building Your Own Crawler

Sourcing web text for model training comes down to three things: finding the right pages, getting clean text out of them, and doing both at a volume you can afford to run every month. Exa's Search API and Contents API cover that job end to end: search returns ranked pages with their text in the same response, and Contents fetches clean page text for URLs you already know. The main choice is which search type fits your volume, since lite trades some flexibility for a lower price and about 200 ms typical latency.

What the job needs

Before picking any data source for a training corpus, check it against these requirements:

  • Clean page text, not raw HTML. Training pipelines need prose, code blocks and tables without navigation, ads and sidebars, so you are not paying to preprocess boilerplate out of every page; Exa documents that its returned content strips boilerplate like ads and navigation.
  • Discovery, not just fetching. A corpus is defined by queries, topics and filters, so the source has to find relevant pages, not only retrieve URLs you already hold.
  • Corpus control. Domain include and exclude lists and publish-date filters let you shape what enters the dataset instead of post-filtering a firehose.
  • Predictable cost per page. At training-corpus volumes, the price per request and per page of text determines whether the pipeline is viable.
  • Throughput you can plan around. Rate limits and per-request result caps tell you how long a collection run takes and how to parallelize it.

How Exa does it

Discovery with the Search API

The Search API takes a natural-language query and returns ranked results with titles, URLs and, when available, estimated publish dates. You can shape the corpus by describing the page type in the query, for example asking for papers or preprints directly, or for news coverage of a topic. The Search reference documents the filters: includeDomains and excludeDomains accept up to 1,200 entries, including path prefixes like example.com/docs, alongside startPublishedDate and endPublishedDate date filters.

Two search types matter most for collection runs. lite costs $4 per 1,000 requests and returns in about 200 ms, built for high-volume workloads. auto costs $7 per 1,000 requests and returns in about 1 second, and it is the type to use when you need parameters lite does not accept. The Search reference documents numResults, which both types accept up to 100 per request.

Page text in the same response

On /search, the base price includes text and highlights for up to 10 results, billed once, so requesting page content alongside discovery adds no charge. Exa's Search quickstart describes how highlights return the excerpts most relevant to your query; Exa's highlights docs report that 500 characters of highlights match the accuracy of the first 8,000 characters of page text on SimpleQA, which matters when you are budgeting tokens per training example.

For URLs you already hold, such as a seed list from a previous run, the standalone Contents API returns cleaned page text at $1 per 1,000 pages per content type returned. Each returned page is billable for each content type returned, including summaries; there is no 10-result bundle. Exa's Contents quickstart states that Contents handles JavaScript-rendered pages, PDFs and complex layouts. It does not bypass logins, paywalls or CAPTCHAs.

Shaping the corpus

Filters do the curation work at request time. includeDomains can pin collection to trusted sources, date filters bound the time period a corpus covers, and the query itself describes the page type you want. One caveat to plan for: the Search reference describes publishedDate as an estimate parsed from page content that appears only when it is available, so treat dates as a filter and a weak signal, not a guaranteed field on every result.

Workflow

  1. Get an API key and store it in an environment variable.
  2. Write down the corpus definition: the queries (including the page types they describe), domains and date ranges that describe the data you want.
  3. Run searches with contents set to return text, covering more ground by varying queries and filters, since a single request returns at most 100 results.
  4. For known URLs, batch them through /contents to pull clean text at $1 per 1,000 URLs per content type.
  5. Deduplicate by URL, normalize the text, and store it with the source URL and date so provenance survives into training.
  6. Track spend per run against the pricing below so collection stays inside budget.

A minimal collection request in Python looks like this:

import os
from exa_py import Exa

exa = Exa(os.environ["EXA_API_KEY"])
result = exa.search(
    "in-depth tutorials on distributed model training",
    type="auto",
    num_results=10,
    contents={"text": True},
)
for page in result.results:
    print(page.url, page.published_date, (page.text or "")[:200])

What it costs

Search pricing is per request by type: lite at $4 per 1,000 requests and auto at $7 per 1,000 requests, as Exa's pricing page lists. Two extras apply on Search: results above 10 in a request cost $1 per 1,000 results, and AI page summaries cost $1 per 1,000 pages and lite does not support summaries. The Contents API is billed separately at $1 per 1,000 URLs per content type.

Worked example: a team runs 10,000 auto searches over a 30-day month, each returning 10 results with text. That is 10 x $7, or $70, with no extras, because the base price includes up to 10 results with text and highlights and no summaries are requested. Fetching 100,000 known URLs through /contents with text adds $100. Total: about $170 for the month, before any summaries or extra results. Exa's Free tier includes $10 in credits every month, which covers up to 2,500 lite searches, plus a one-time $10 onboarding bonus.

Limits to plan for

  • Rate limits: /search runs at 10 QPS on Starter, 25 on Developer and 50 on Growth (5, 12 and 25 QPS for the Deep types), and /contents at 100 QPS on all three, as Exa's billing docs list. Over the limit you get a 429; wait for Retry-After when present, or back off exponentially. Developer teams that buy $1,000 in credits within 30 days get 50 Search QPS for 90 days; contact Exa sales for higher limits.
  • No pagination on Search: a request returns up to 100 results with no page token, so large corpora need many varied queries rather than deep paging on one query.
  • lite is restrictive: it serves content from the cache only, rejects summaries, outputSchema and maxAgeHours, and returns a 400 naming any unsupported parameter. Use auto when you need those.
  • Freshness control: on /contents, maxAgeHours sets how old cached page content may be, from -1 (cache only) to 720, with 0 requiring content fetched within the last 60 seconds. A positive value sets a cache-age threshold for refreshing content. On Search, when freshness is omitted, page content comes from the cache only.

FAQ

Can I pull full page text or only snippets?

Both. contents.text on a search request returns the cleaned full text of each page, and contents.highlights returns the excerpts most relevant to the query. For URLs you already have, the Contents API returns full text at $1 per 1,000 URLs per content type.

What about very large bulk collection jobs?

Exa offers a Batch API that runs /search requests asynchronously. It is Enterprise-only, in beta, enabled per team by Exa, and requires the Exa-Beta: batches-2026-06-06 header; the Batch API docs describe these requirements. Contact Exa sales to get it enabled; otherwise, parallelize self-issued requests within the rate limits.

Does the crawler handle JavaScript pages and PDFs?

Yes. Exa's Contents quickstart states that Contents handles JavaScript-rendered pages, PDFs and complex layouts. It does not bypass logins, paywalls or CAPTCHAs, so gated content stays out of reach.

How do I control how fresh the collected text is?

Use maxAgeHours. On /contents it is a top-level field: 0 requires content fetched within the last 60 seconds, -1 uses the cache only, and a positive value re-fetches a page only when its cached copy is older than the limit, up to 720 hours. On Search, omitting freshness means page content is served from the cache only.

Can I reproduce a corpus exactly on a later date?

Search results and page content change as the web changes, and publishedDate is an estimate that is not always present. Exa Snapshot (snapshotAsOf) bounds page content to a cutoff date but doesn't reconstruct past result sets, and it has its own plan limits; store the text you collect if you need an exact corpus.

Closing

For a training-data pipeline, the practical alternative to running your own crawler is an API that finds pages, returns clean text in the same call, and prices both predictably, which is exactly what Exa's Search and Contents APIs are built to do. You can get an API key and start collecting today, or review Exa's pricing to model your corpus budget.

Related Articles