# Tavily

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> AI-optimized web search, content extraction, site mapping, and crawling API.

**Category:** Web Search & Scraping | **Website:** [tavily.com](https://tavily.com) | **Docs:** [docs.tavily.com](https://docs.tavily.com)

## Access Methods

| Method | Base URL | Auth |
|--------|----------|------|
| **x402 (Base)** | `https://tavily.x402.paywithlocus.com/tavily/` | HTTP 402 auto-payment |
| **MPP (Tempo)** | `https://tavily.mpp.paywithlocus.com/tavily/` | HTTP 402 auto-payment |
| **Locus Pro Wrapped API** | `https://api.paywithlocus.com/api/wrapped/credits/tavily/` | `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` + `Idempotency-Key` |

**OpenAPI discovery:** `GET https://tavily.x402.paywithlocus.com/openapi.json`

## Endpoints

### Search

Execute a web search query optimized for AI agents. Returns relevant results with optional AI-generated answer.

**Estimated cost:** $0.09 (basic) / $0.16 (advanced)

**Payment:** x402 `exact`

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search query |
| `search_depth` | string | No | Search depth: 'basic' (default) or 'advanced' |
| `topic` | string | No | Topic category: 'general' (default) or 'news' |
| `max_results` | number | No | Maximum number of results (default 5) |
| `include_answer` | boolean \| string | No | Include AI-generated answer: true, false, or 'advanced' |
| `include_raw_content` | boolean | No | Include raw HTML content in results |
| `include_images` | boolean | No | Include related images in results |
| `include_domains` | string[] | No | Only include results from these domains |
| `exclude_domains` | string[] | No | Exclude results from these domains |
| `days` | number | No | Only return results from the last N days |
| `country` | string | No | Country code for search results (e.g. "us", "gb") |

```bash
curl -X POST https://tavily.x402.paywithlocus.com/tavily/search \
  -H "Content-Type: application/json" \
  -H "x-locus-request-id: <UUID from the 402 response>" \
  -d '{"query":"x402 discovery"}'
```

### Extract

Extract clean content from one or more URLs. Returns parsed text optimized for LLM consumption.

**Estimated cost:** $0.11+ (scales with URL count)

**Payment:** x402 `exact`

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `urls` | string[] | Yes | URLs to extract content from (max 20) |
| `extract_depth` | string | No | Extraction depth: 'basic' (default) or 'advanced' |

```bash
curl -X POST https://tavily.x402.paywithlocus.com/tavily/extract \
  -H "Content-Type: application/json" \
  -H "x-locus-request-id: <UUID from the 402 response>" \
  -d '{"urls":["https://example.com"]}'
```

### Map

Discover and enumerate all URLs on a website. Returns a comprehensive sitemap without scraping content.

**Estimated cost:** $0.09

**Payment:** x402 `exact`

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | string | Yes | Website URL to map |
| `max_depth` | number | No | Maximum crawl depth for discovery |
| `max_breadth` | number | No | Maximum breadth per level |
| `limit` | number | No | Maximum number of URLs to return |
| `instructions` | string | No | Natural language instructions to guide URL discovery |

```bash
curl -X POST https://tavily.x402.paywithlocus.com/tavily/map \
  -H "Content-Type: application/json" \
  -H "x-locus-request-id: <UUID from the 402 response>" \
  -d '{"url":"https://docs.tavily.com","limit":3}'
```

### Crawl

Crawl a website and extract content from discovered pages. Combines mapping and extraction in a single call.

**Estimated cost:** $0.21+ (scales with page limit)

**Payment:** x402 `exact`

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | string | Yes | Starting URL to crawl |
| `max_depth` | number | No | Maximum crawl depth |
| `max_breadth` | number | No | Maximum breadth per level |
| `limit` | number | No | Maximum number of pages to crawl (default 10) |
| `instructions` | string | No | Natural language instructions to guide crawling |
| `extract_depth` | string | No | Extraction depth: 'basic' (default) or 'advanced' |

```bash
curl -X POST https://tavily.x402.paywithlocus.com/tavily/crawl \
  -H "Content-Type: application/json" \
  -H "x-locus-request-id: <UUID from the 402 response>" \
  -d '{"url":"https://docs.tavily.com","limit":1,"max_depth":1}'
```

## Next steps

- [All x402 services](https://paywithlocus.com/x402/index.md): pick another service.
- [Tavily with Locus Pro credits](https://paywithlocus.com/wapi/tavily.md): the same provider, billed to a credit balance.
- [Pay With Locus wallet skill](https://paywithlocus.com/wallet/skill.md): an agent wallet that signs x402 payments for you.
- [Agent docs index](https://paywithlocus.com/agent/index.md): every Locus agent page.