Live · Live Search API
Search
Search ranks the live web for a query and returns results with snippets, in one request.
Request
Send a POST request to https://api.epochal.com/v1/search with two headers and a JSON body.
| Header | Required | Value |
|---|---|---|
x-api-key | Yes | Your API key. See Authentication. |
Content-Type | Yes | application/json |
curl https://api.epochal.com/v1/search \
-H "x-api-key: $EPOCHAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "european battery gigafactory delays",
"num_results": 5
}'Body fields
| Field | Type | Default | Description |
|---|---|---|---|
query | string, 1 to 1,000 characters | required | What to search the web for. |
num_results | integer, 1 to 20 | 10 | The most results to return. You may get fewer. |
domains | array of strings (up to 2,048 chars each; max 200 combined with exclude_domains) | none | Only return pages from these sites, subdomains included: a host (example.com), a host and path (example.com/blog), or a public suffix (gov.uk). |
exclude_domains | array of strings (same syntax and shared 200 limit) | none | Never return pages from these sites, subdomains included. Cannot overlap with domains. |
languages | array of up to 8 BCP 47 tags | none | Languages you want results in, most preferred first, such as en or pt-BR. Leave it out to get results in the query's language. |
location | country code, or country, latitude and longitude | none | Where your user is, so results are localized: a two-letter country code such as US, or coordinates for a more precise location. |
published_after | RFC 3339 timestamp | none | Only return pages published on or after this time. |
published_before | RFC 3339 timestamp | none | Only return pages published before this time. Must be later than published_after. |
categories | array of category names | none | Only return pages in these categories. See Narrow the results. |
include_text | boolean | false | Return each page's full text in addition to the most relevant snippets. Makes responses much larger. |
Unknown fields are rejected with a 400, not ignored. Sending limit or max_results instead of
num_results fails rather than quietly returning 10 results.
Response
A 200 returns ranked results, best first, and a request id.
JSON
json
{
"request_id": "7c2e5f0a-93b4-4d1e-a6f8-2b0c9e4d7a15",
"results": [
{
"title": "Battery plant start pushed back to late 2027",
"url": "https://news.example.com/energy/battery-plant-delay",
"snippet": "The cell maker said commissioning would slip by three quarters…",
"published_at": "2026-08-19T06:12:00Z",
"domain": "example.com",
"language": "en",
"entity": null
}
]
}| Field | Meaning |
|---|---|
request_id | Identifies this request in Epochal's logs; quote it when reporting a problem. |
results | Ranked results, best first. An empty list is still a 200. |
results[].title | The page's title. |
results[].url | The page's canonical URL. A person shows its LinkedIn profile; Fetch reads the entity from that URL. |
results[].snippet | A short passage from the page that matches the query. |
results[].text | The page's extracted text. Only present when include_text is true and text is available. |
results[].published_at | When the page was published. null when unknown. |
results[].domain | The page's registrable domain, such as example.com. null when unknown. |
results[].language | The page's language as a BCP 47 tag. null when not detected. |
results[].entity | The person, organization, or place when the result is an Epochal World page, as Fetch returns it for url. null for every other result. See World Entities. |
To read a result in full, send its url to Fetch.
Narrow the results
categories limits results to one or more kinds of page, and languages asks for results in
these languages, most preferred first.
JSON
json
{
"query": "fair use transformative work",
"categories": ["legal"],
"languages": ["en"]
}| Category | What it searches |
|---|---|
news | News articles |
finance | SEC filings |
legal | Court opinions, statutes, regulations and sanctions |
publications | Academic articles |
companies | Company profiles |
people | People profiles |
maps | Places |
Leave categories out to search everything.
Best practices
- Keep the query to the one question.
queryis plain text, up to 1,000 characters. - Narrow by site first.
domainsandexclude_domainstake up to 200 entries between them: a host, a host and path, or a public suffix, subdomains included. An entry can't be in both. - Leave
include_textoff unless you need it. Snippets are enough to rank and pick results; Fetch reads the ones worth reading in full.
Errors
Errors use the same JSON shape as every other endpoint. Check type, not message. No error is billed.
| Status | type | What to do |
|---|---|---|
400 | invalid_request | Fix the request. The message names the field. Do not retry. |
401 | invalid_api_key | The x-api-key header is missing, or the key is unknown, revoked, or expired. Fix the key. |
402 | free_quota_exhausted, trial_only | The free requests for this API are used up, or it is in trial for your organization. Contact us. |
402 | insufficient_credits | Add credits in the console. |
403 | organization_suspended | Billing is suspended. Contact us. |
403 | spend_limit_reached | Raise the spend limit in the console, or wait for the next billing period. |
422 | query_refused | The query falls under the usage policy and was not billed. Do not retry the same query. |
429 | rate_limit_exceeded | Rate limit exceeded. Wait for Retry-After before retrying. |
500, 503, 504 | internal_error, service_unavailable, timeout | Something failed on Epochal's side. Retry with backoff. |
For the cause and fix of each, see Errors.
Next steps
Fetch reads one web page and returns its main content as markdown, with its metadata.
Rank the live web for a query and get back results with snippets.
Organization and per-IP rate limits, retry behavior, and pacing guidance.
Standard JSON error envelope, HTTP status codes, sandbox failure types, and retry rules.