Search a live site

Search any site right now — its homepage, its sections and its own search box.

POST /v1/search/site searches a site live, not the index. It reads the homepage first; if that is not enough, the model picks the sections most likely to cover the topic and tries the site’s own search box, in parallel. The best candidates are read before they are ranked, as in normal mode.

Because it can take up to a minute, it returns a job. Poll it, wait for it with the SDK, or stream it.

Wait for the result

const res = await ts.siteSearchAndWait('lanacion.com.ar', 'el dólar', { mode: 'normal' });
console.log(res.results.length, res.site);

Or handle the job yourself

curl https://api.typesearch.ai/v1/search/site \
  -H "Authorization: Bearer $TYPESEARCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "site": "lanacion.com.ar", "query": "el dólar" }'
# 202 Accepted · Location: /v1/jobs/job_…

curl https://api.typesearch.ai/v1/jobs/job_… \
  -H "Authorization: Bearer $TYPESEARCH_API_KEY"

A job moves from queued to running to succeeded (with result) or failed (with error). Jobs last one day and are visible only to the key that created them.

Or stream it

With stream: true the request returns Server-Sent Events instead of a job: steps, partial results and the final result.

for await (const event of ts.siteSearchStream('lanacion.com.ar', 'el dólar')) {
  if (event.type === 'step') console.log(event.step.text);
}

Limits and errors

We only read the site you ask for and its subdomains, with GET requests, and we never try to get past bot protection.

StatuscodeWhat it means
400invalid_site, site_not_foundThe site is not a valid public address.
403robots_disallowedThe site’s robots.txt disallows it, or it couldn’t be read (we retry after 10 minutes).
502site_unreachable, bot_protectionThe site did not answer, or answered with a bot challenge.
504site_timeoutThe site took too long.

On this page