search finds URLs, fetch reads them. Neither runs JavaScript and
neither carries a login — when the page needs either of those, you want
the browser.
search
The full record for one result, and the envelope around it:score is the aggregator’s ranking, not a relevance percentage: it falls off as
1, 0.5, 0.33 down the list. engine says which search engine produced the row,
and engine_stats in the full response says which ones were asked and how long
they took — useful exactly once, when results look wrong and you want to know
whether one engine answered for all of them.
string
default:"web"
The vertical:
web, news, images, videos, repos, science, x, tg
or reddit. Picking the right one beats adding “site:” to the query.string
day, week, month or year. Use it for anything where a stale answer is
worse than no answer — prices, releases, what happened.integer
default:"10"
1 to 50.
fetch
fetch reads a page and gives back structured JSON, using an extractor that
knows the site:
kind tells you which extractor ran. There are dedicated ones for Reddit threads
and subreddits, Hacker News items, GitHub repositories, issues and files, arXiv
papers, Wikipedia articles, YouTube transcripts and PDFs; anything else falls
back to a generic browser extraction, and if that fails or answers 4xx/5xx, the
Wayback Machine snapshot is tried automatically.
A batch is one call
Pass a list — up to 32 URLs — and they are fetched in parallel. One bad URL never aborts the batch:When to use the browser instead
fetch sees what an HTTP client sees. Reach for
agent-browser when:
- the content is rendered by JavaScript after load
- the page is behind a login or any session you had to establish
- you need to click, type, scroll or submit something
- the answer is
Just a moment...— that is bot protection, and it needs a real browser with a real pointer
fetch when you just need the text of a public page. It is faster,
it costs a fraction of the tokens, and it does not hold a browser open.
