# websearch.fast

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.

Get a key in the [console](https://websearch.fast/console/keys) with a relay.fast account, or on https://relay.fast/keys. Documentation: [docs](https://websearch.fast/docs). Try a call in the [playground](https://websearch.fast/playground).

## Example

Example from the API reference.

curl:

```bash
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}
  }'
```

Python:

```python
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())
```

TypeScript:

```typescript
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());
```

Response:

```json
{
  "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

| Endpoint | Use | State |
| --- | --- | --- |
| [`POST /v1/web/search`](https://websearch.fast/docs/search) | Web results, optionally with the text of the top pages | available |
| [`POST /v1/web/autocomplete`](https://websearch.fast/docs/autocomplete) | Query suggestions for a prefix | available |
| [`POST /v1/web/knowledge`](https://websearch.fast/docs/knowledge) | The knowledge panel of one entity | available |
| [`POST /v1/web/lens`](https://websearch.fast/docs/lens) | Pages that show the same or a similar image | planned |
| [`POST /v1/web/fetch`](https://websearch.fast/docs/fetch) | Clean Markdown or text of up to 20 pages | available |
| [`POST /v1/web/extract`](https://websearch.fast/docs/extract) | Structured data from pages by a JSON Schema | planned |
| [`POST /v1/web/map`](https://websearch.fast/docs/map) | The URLs of one site from its sitemaps and links | planned |
| [`POST /v1/web/crawl`](https://websearch.fast/docs/crawl) | Read many pages of one site as a job | planned |
| [`POST /v1/web/research`](https://websearch.fast/docs/research) | A sourced report on a question, as a job | planned |
| [`POST /v1/web/batch`](https://websearch.fast/docs/batch) | Up to 100 calls in one request | available |
| [`POST /v1/web/places/details`](https://websearch.fast/docs/places-details) | The full record of one place | planned |
| [`POST /v1/web/places/reviews`](https://websearch.fast/docs/places-reviews) | Reviews of one place, paged | planned |
| [`POST /v1/web/geocode`](https://websearch.fast/docs/geocode) | An address or place name to coordinates | available |
| [`POST /v1/web/reverse-geocode`](https://websearch.fast/docs/reverse-geocode) | Coordinates to an address | available |
| [`GET /v1/web/usage`](https://websearch.fast/docs/usage) | What a key spent on web calls | available |
| [`GET /v1/web/status`](https://websearch.fast/docs/status) | Which endpoints are on | available |

## Serper request format

The compatibility paths accept the Serper request format. Change the host to `https://api.websearch.fast` and the key; see the [migration guide](https://websearch.fast/docs/migrate).

## MCP

.mcp.json:

```json
{
  "mcpServers": {
    "websearch": {
      "type": "http",
      "url": "https://api.websearch.fast/mcp",
      "headers": {"Authorization": "Bearer ${WEBSEARCH_API_KEY}"}
    }
  }
}
```

