/v1/searches endpoint lets you search the web with a natural language query and get back a deduplicated list of relevant links with titles and descriptions.
- Send a query in plain English
- Get back structured links from across the web
- Optionally scrape every returned URL in one round-trip and embed
markdown_content/html_contentdirectly into the response - Filter by domain, control the result count, and bound the scraping wallclock
Installation
Basic usage
Send a natural language query and receive a list of relevant links.Request parameters
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | yes | — | The search query in natural language. |
limit | integer | no | 12 | Maximum number of links to return after deduplication. Must be between 1 and 25. |
include_domains | string[] | no | [] | Restrict results to these domains. Bare hosts only — leading http(s):// and trailing slashes are stripped automatically. |
exclude_domains | string[] | no | [] | Exclude results from these domains. Bare hosts only — leading http(s):// and trailing slashes are stripped automatically. |
scrape_options | object | no | — | When provided, every returned link is also scraped and its content embedded in the response. See scrape_options below. |
Limiting the number of results
Filtering by domain
include_domains narrows results to a whitelist; exclude_domains filters out unwanted sources. They can be combined.
scrape_options
Passscrape_options to scrape every returned URL in parallel and embed the rendered content directly on each link. This saves a round-trip per result vs. calling /v1/searches and /v1/scrapes separately.
| Field | Type | Default | Description |
|---|---|---|---|
formats | string[] | ["markdown"] | Output formats to attach to each link. For /v1/searches, only "html" and "markdown" are supported. Pass ["html", "markdown"] to receive both. |
remove_css_selectors | string | "default" | Forwarded to /v1/scrapes. "default" strips nav/footer/script/style/svg/dialog noise. Use "none" to disable, or pass a JSON-stringified array of selectors to remove. |
timeout | integer | 25 | Wallclock budget in seconds for the entire scrape phase. Must be between 1 and 60. After this elapses, the search returns immediately — content fields will be null for any links that hadn’t finished. |
Behavior
- All links are scraped in parallel. The
timeoutbounds the whole batch, not each individual link. - Per-link scrape failures (network errors, individual page timeouts) leave that link’s
markdown_content/html_contentasnullwhile other links return normally. - If the global
timeoutelapses before all scrapes finish, the search responds immediately with the links it has — already-completed scrapes keep their content; in-flight ones come back withnullcontent. - For
reddit.com/.../comments/...URLs, the request is automatically routed through the@olostep/reddit-postparser and the structured JSON is rendered into clean markdown + basic HTML - If the combined inline content exceeds 9MB, content fields are nulled,
result.size_exceededis set totrue, and you can fetch the full payload fromresult.json_hosted_url.
Example with scraping
Response
You will receive asearch object in response. The search object contains an id, your original query, credits_consumed, and a result with a list of links.
result.links contains:
| Field | Type | Description |
|---|---|---|
url | string | The URL of the search result. |
title | string | The title of the result page. |
description | string | A short snippet describing the result. |
markdown_content | string | Markdown content of the page. Only present when scrape_options.formats includes "markdown". null if the scrape failed, was empty, or hit the global timeout. |
html_content | string | HTML content of the page. Only present when scrape_options.formats includes "html". null on failure/timeout. |
result.json_hosted_url — useful when result.size_exceeded is true.
Retrieving a past search
GET /v1/searches/{search_id} returns whatever was persisted at search time, including any scraped content. It’s a pure idempotent read — no re-scraping, no re-billing. Older searches without scrape_options simply have no per-link content fields.
Pricing
Each search costs 5 credits for the search itself. Whenscrape_options is provided, each scraped page is billed at the standard /v1/scrapes rate (typically 1 credit per page; some parsers cost more). The total is returned in credits_consumed.
Examples:
| Request | credits_consumed |
|---|---|
| Search only | 5 |
| Search + 5 scraped pages (1 credit each) | 10 |