Web search API for programs and agents
Search with page text, page reading, geocoding and knowledge panels over one JSON API. Calls are charged per unit from a relay.fast balance, and empty results and errors are free.
Example from the API reference. It was not run when this page loaded.
curl https://api.websearch.fast/v1/web/search \
-H "Authorization: Bearer $WEBSEARCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"q": "rust async runtime comparison",
"num": 3,
"content": {"pages": 1, "max_chars_per_page": 3000}
}'import os
import httpx
response = httpx.post(
"https://api.websearch.fast/v1/web/search",
headers={"Authorization": f"Bearer {os.environ['WEBSEARCH_API_KEY']}"},
json={
"q": "rust async runtime comparison",
"num": 3,
"content": {"pages": 1, "max_chars_per_page": 3000},
},
timeout=60,
)
response.raise_for_status()
print(response.json())const response = await fetch("https://api.websearch.fast/v1/web/search", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.WEBSEARCH_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
q: "rust async runtime comparison",
num: 3,
content: { pages: 1, max_chars_per_page: 3000 },
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());- Choosing an async runtime in 2026blog.example.comWe benchmarked four runtimes on the same HTTP workload and compared scheduling, I/O and memory use. 2026-09-14
- Async runtimes: a comparison of schedulersdocs.example.orgHow work-stealing and thread-per-core runtimes differ, with notes on when each fits. 2026-06-02
- Moving a service between async runtimeswww.example.netWhat changed in our code when we moved a Rust service from one async runtime to another. 2026-03-21
{
"object": "web.search",
"request_id": "20261128120000123456789a1b2c3d4Kx7Qm2Pz",
"created": 1795867200,
"input": {
"q": "rust async runtime comparison",
"type": "web",
"page": 1,
"num": 3,
"safe": "moderate",
"operators": {},
"content": {
"pages": 1,
"format": "markdown",
"max_chars_per_page": 3000,
"mode": "full"
},
"timeout_ms": 25000
},
"results": [
{
"position": 1,
"title": "Choosing an async runtime in 2026",
"url": "https://blog.example.com/posts/async-runtimes-2026",
"domain": "blog.example.com",
"snippet": "We benchmarked four runtimes on the same HTTP workload and compared scheduling, I/O and memory use.",
"published_at": "2026-09-14T00:00:00Z",
"origin": "index",
"content": {
"status": "ok",
"format": "markdown",
"chars": 3000,
"truncated": true,
"text": "# Choosing an async runtime in 2026\n\n...",
"fetched_at": 1795860000
}
},
{
"position": 2,
"title": "Async runtimes: a comparison of schedulers",
"url": "https://docs.example.org/rust/async/runtimes",
"domain": "docs.example.org",
"snippet": "How work-stealing and thread-per-core runtimes differ, with notes on when each fits.",
"published_at": "2026-06-02T00:00:00Z",
"origin": "live"
},
{
"position": 3,
"title": "Moving a service between async runtimes",
"url": "https://www.example.net/notes/runtime-migration",
"domain": "www.example.net",
"snippet": "What changed in our code when we moved a Rust service from one async runtime to another.",
"published_at": "2026-03-21T00:00:00Z",
"origin": "live"
}
],
"has_more": true,
"usage": {
"charged": true,
"items": [
{"unit": "search_web", "count": 1},
{"unit": "content_page", "count": 1}
]
},
"cache": {"hit": false, "data_age_seconds": 0, "fetched_at": 1795867200}
}Endpoints
Search
POST /searchWeb results, optionally with the text of the top pagesavailablePOST /autocompleteQuery suggestions for a prefixavailablePOST /knowledgeThe knowledge panel of one entityavailablePOST /lensPages that show the same or a similar imageplannedRead
POST /fetchClean Markdown or text of up to 20 pagesavailablePOST /extractStructured data from pages by a JSON SchemaplannedPOST /mapThe URLs of one site from its sitemaps and linksplannedPOST /crawlRead many pages of one site as a jobplannedResearch
POST /researchA sourced report on a question, as a jobplannedPOST /batchUp to 100 calls in one requestavailablePlaces
POST /places/detailsThe full record of one placeplannedPOST /places/reviewsReviews of one place, pagedplannedPOST /geocodeAn address or place name to coordinatesavailablePOST /reverse-geocodeCoordinates to an addressavailableAccount
GET /usageWhat a key spent on web callsavailableGET /statusWhich endpoints are onavailableAlready on the Serper request format?
The compatibility paths accept that format and answer in its shape. Change the host and the key, and keep the request bodies as they are. Not every field of that format is filled, and the migration guide lists which.
Search client
- POST $PREVIOUS_BASE_URL/search
+ POST https://api.websearch.fast/search
- X-API-KEY: $PREVIOUS_API_KEY
+ X-API-KEY: $WEBSEARCH_API_KEYFrom an agent
The MCP server offers web_search, web_fetch, geocode, reverse_geocode, autocomplete and knowledge as tools over streamable HTTP. Any client that accepts a remote server URL and a bearer header can use it.
.mcp.json
{
"mcpServers": {
"websearch": {
"type": "http",
"url": "https://api.websearch.fast/mcp",
"headers": {"Authorization": "Bearer ${WEBSEARCH_API_KEY}"}
}
}
}Agents that read documentation can start from the index of this site.
curl https://websearch.fast/llms.txtBilling
There is no separate subscription. A call is priced in credits by the units it used and paid in USD from the balance of your relay.fast account, the same balance that pays for model calls. Errors, empty results and pages that could not be read are not charged.
Each response lists what was charged in usage. Usage reports the totals of a key by day and endpoint.