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.

HeaderRequiredValue
x-api-keyYesYour API key. See Authentication.
Content-TypeYesapplication/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

FieldTypeDefaultDescription
querystring, 1 to 1,000 charactersrequiredWhat to search the web for.
num_resultsinteger, 1 to 2010The most results to return. You may get fewer.
domainsarray of strings (up to 2,048 chars each; max 200 combined with exclude_domains)noneOnly 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_domainsarray of strings (same syntax and shared 200 limit)noneNever return pages from these sites, subdomains included. Cannot overlap with domains.
languagesarray of up to 8 BCP 47 tagsnoneLanguages you want results in, most preferred first, such as en or pt-BR. Leave it out to get results in the query's language.
locationcountry code, or country, latitude and longitudenoneWhere your user is, so results are localized: a two-letter country code such as US, or coordinates for a more precise location.
published_afterRFC 3339 timestampnoneOnly return pages published on or after this time.
published_beforeRFC 3339 timestampnoneOnly return pages published before this time. Must be later than published_after.
categoriesarray of category namesnoneOnly return pages in these categories. See Narrow the results.
include_textbooleanfalseReturn 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
    }
  ]
}
FieldMeaning
request_idIdentifies this request in Epochal's logs; quote it when reporting a problem.
resultsRanked results, best first. An empty list is still a 200.
results[].titleThe page's title.
results[].urlThe page's canonical URL. A person shows its LinkedIn profile; Fetch reads the entity from that URL.
results[].snippetA short passage from the page that matches the query.
results[].textThe page's extracted text. Only present when include_text is true and text is available.
results[].published_atWhen the page was published. null when unknown.
results[].domainThe page's registrable domain, such as example.com. null when unknown.
results[].languageThe page's language as a BCP 47 tag. null when not detected.
results[].entityThe 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"]
}
CategoryWhat it searches
newsNews articles
financeSEC filings
legalCourt opinions, statutes, regulations and sanctions
publicationsAcademic articles
companiesCompany profiles
peoplePeople profiles
mapsPlaces

Leave categories out to search everything.

Best practices

  • Keep the query to the one question. query is plain text, up to 1,000 characters.
  • Narrow by site first. domains and exclude_domains take 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_text off 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.

StatustypeWhat to do
400invalid_requestFix the request. The message names the field. Do not retry.
401invalid_api_keyThe x-api-key header is missing, or the key is unknown, revoked, or expired. Fix the key.
402free_quota_exhausted, trial_onlyThe free requests for this API are used up, or it is in trial for your organization. Contact us.
402insufficient_creditsAdd credits in the console.
403organization_suspendedBilling is suspended. Contact us.
403spend_limit_reachedRaise the spend limit in the console, or wait for the next billing period.
422query_refusedThe query falls under the usage policy and was not billed. Do not retry the same query.
429rate_limit_exceededRate limit exceeded. Wait for Retry-After before retrying.
500, 503, 504internal_error, service_unavailable, timeoutSomething failed on Epochal's side. Retry with backoff.

For the cause and fix of each, see Errors.

Next steps

Fetch API

Fetch reads one web page and returns its main content as markdown, with its metadata.

Search reference

Rank the live web for a query and get back results with snippets.

Rate Limits

Organization and per-IP rate limits, retry behavior, and pacing guidance.

Errors

Standard JSON error envelope, HTTP status codes, sandbox failure types, and retry rules.