Keep an LLM Training Corpus Current with Web Search Data
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.
Keep an LLM Training Corpus Current with Web Search Data
A training corpus that stays useful needs two things: a way to find newly published web pages on a schedule, and a way to pull their clean text at scale. Exa's Search API finds the pages and can return page content in the same call, and the Contents API fetches clean text for URLs you already know. The one condition that changes the setup is volume: recurring searches fit the standard API, while very large bulk refresh jobs can move to Exa's Batch API on Enterprise.
What the job needs
Before picking a data source, check it against the requirements a continuously refreshed corpus actually has:
- Coverage and recall. The source has to surface the pages your corpus depends on, including pages published since your last pass, not just the ones already in your index.
- Clean page text, not links. A corpus pipeline needs extracted content it can tokenize directly, with boilerplate handled, in the same response or a cheap follow-up call.
- Freshness control. You need a way to bound how old the returned page content is, so a refresh pass does not silently re-serve stale copies.
- Date and domain filters. Narrowing to the domains you trust and to pages published after a cutoff keeps each pass small and deduplicated.
- Predictable cost per page. A refresh runs every day or week, so the price per search and per page has to be forecastable.
How Exa does it
Search finds newly published pages on demand
The Search reference documents the POST /search endpoint, which takes a natural-language query and returns ranked results with title, URL and, when available, an estimated publishedDate, up to 100 results per request with numResults. For a refresh pass, startPublishedDate filters to pages published since the last run, and includeDomains / excludeDomains restrict a pass to the hostnames your corpus actually draws from. The lite type (~200 ms, $4 per 1,000 requests) suits high-volume passes; auto (about 1 second, $7 per 1,000) is the default type when you want a balance of quality and speed.
Contents pulls clean text for known URLs
When your pipeline already knows which URLs to refresh, the separate /contents endpoint fetches page content directly at $1 per 1,000 pages per content type returned (text, highlights or summary). Each returned page is billable for each content type returned, including summaries, and Contents has no 10-result bundle. The Contents quickstart says Exa's crawler handles JavaScript-rendered pages, PDFs and complex layouts, and Exa's changelog notes that boilerplate like ads and navigation is stripped from the extracted text. maxAgeHours bounds how old cached content may be, from -1 to 720: 0 requires content fetched within the last 60 seconds, a positive value sets a cache-age threshold for refreshing content (a cached copy older than the limit is re-fetched), and -1 uses the cache only. On standalone Contents, omitting freshness uses the cache and fetches live on a miss.
Highlights keep token budgets under control
If your corpus pipeline stores passages rather than whole pages, contents.highlights returns only the passage that matches the query instead of full page text. Exa's highlights docs report that, on SimpleQA, 500 characters of highlights match the accuracy of the first 8,000 characters of page text, with 16x fewer tokens, which matters when you are paying to store and re-train on every token.
Workflow
A recurring refresh with Exa's Search and Contents APIs looks like this:
- Get an API key from dashboard.exa.ai/api-keys and store it in an environment variable.
- Define the pass scope. List the domains your corpus draws from, and record the timestamp of the last refresh.
- Search for new pages. Run
/searchwithstartPublishedDateset to the last refresh time andincludeDomainsscoped to your sources, usingautoorlitedepending on volume. - Pull page text. Request
contents.textin the same search call, or fetch known URLs through/contentswithmaxAgeHoursset to bound staleness. - Deduplicate and ingest. Compare returned URLs against your corpus, drop duplicates, and append new documents with their source URLs and dates.
- Schedule the next pass. Repeat daily or weekly, moving the
startPublishedDatecutoff forward each time.
For developer pipelines, the search step looks like this in Python:
import os
from exa_py import Exa
exa = Exa(os.environ["EXA_API_KEY"])
response = exa.search(
"recent documentation on vector database indexing",
type="auto",
num_results=50,
start_published_date="2026-11-12T00:00:00Z",
include_domains=["arxiv.org", "developer.mozilla.org"],
contents={"text": True, "max_age_hours": 24},
)
for result in response.results:
print(result.url, result.published_date)
What it costs
Exa's pricing page lists the rates below. Search costs $4 per 1,000 lite requests and $7 per 1,000 auto requests, each including up to 10 results with text and highlights billed once. Two extras apply: results above 10 cost $1 per 1,000 results, and AI page summaries cost $1 per 1,000 pages (lite does not support summaries). Contents costs $1 per 1,000 URLs per content type.
Worked example: 250 auto searches at 50 results each, run four times over 28 days, makes 1,000 searches ($7.00 at $7 per 1,000) plus 40,000 results above the first 10 per search ($40.00 at $1 per 1,000 results), about $47 for the month before summaries. Fetching those 50,000 pages through /contents as well would add $50.00 at $1 per 1,000 URLs per content type. Exa's Free tier includes $10 in credits every month, enough for up to 2,500 lite searches, which covers testing the pipeline but not a production refresh.
Limits to plan for
liteis cache-only and rejects several parameters. It does not support summaries,outputSchemaormaxAgeHours; useautowhen you need those.- Rate limits differ by endpoint and apply to the team. Exa's billing docs document per-team rate limits; a large backfill should spread requests or use the Batch API, which runs
/searchrequests asynchronously for Enterprise teams and requires theExa-Beta: batches-2026-06-06header. publishedDateis an estimate. Exa derives it from parsing page content, so treat it as a filter aid, not a guarantee on every result.
FAQ
Can Exa replace a crawler I run myself for corpus building?
For many public-web corpus jobs, yes: Search finds the pages and Contents returns extracted text, including JavaScript-rendered pages and PDFs, without you maintaining a crawl stack. Exa's crawler does not bypass logins, paywalls or CAPTCHAs, so content behind those still needs your own access path.
How do I make sure a refresh pass does not re-serve stale pages?
Set maxAgeHours on the content you request. A value of 0 requires content fetched within the last 60 seconds, and a positive value sets a cache-age threshold: a cached copy older than the limit is re-fetched, up to 720 hours. On /search, set it with auto or a Deep type, since Lite does not accept it; omitting maxAgeHours there means page content comes from the cache only.
What keeps a high-volume daily refresh low-cost?
Use the lite type at $4 per 1,000 requests when you only need query, results and highlights, and keep result counts at 10 or below to avoid the $1 per 1,000 extra. Fetch text for the URLs you keep through /contents at $1 per 1,000 URLs per content type, so you pay for full text only on pages that pass your filters.
Can I run the whole refresh as one scheduled job?
The standard API is synchronous, so your scheduler drives the passes. For very large bulk jobs, Exa's Batch API submits many /search requests to run asynchronously, but it is Enterprise-only, in beta and enabled per team, so talk to Exa sales if your refresh outgrows the standard rate limits.
Closing
A corpus that stays current needs cheap, filterable search plus clean page text on demand, and that is exactly the split Exa's Search and Contents APIs are built around. Get an API key at dashboard.exa.ai or review pricing to size your first refresh pass.