# Tavily Search API

> AI-optimized web search for agents and RAG: ranked results with titles, URLs and relevant content, depth control, news and finance topics, domain filters and an optional generated answer.

Source: https://www.sandbase.ai/model/tavily/search
API reference: https://www.sandbase.ai/model/tavily/search/docs

## Facts

- Provider: Tavily
- Type: Data API
- Endpoint: `POST https://api.sandbase.ai/v1/api/tavily/search`
- Price: $0.01 per call
- Free allowance: 100 calls per organization per UTC day, shared across eligible APIs
- Capabilities: web search, AI search, research
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

`POST https://api.sandbase.ai/v1/api/tavily/search` with `Authorization: Bearer $SANDBASE_API_KEY` and the parameters as a JSON body.

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `query` | string | yes |  |
| `search_depth` | string | no | basic, advanced |
| `max_results` | integer | no |  |
| `topic` | string | no | general, news, finance |
| `include_answer` | boolean | no |  |
| `include_raw_content` | boolean | no |  |
| `include_domains` | array | no |  |
| `exclude_domains` | array | no |  |

## FAQ

### How do I use the Tavily Search API?

Send a POST request to https://api.sandbase.ai/v1/api/tavily/search with your SandBase API key in the Authorization header (Bearer) and the parameters as a JSON body. You can also try it in the Playground on this page without writing code.

### How much does the Tavily Search API cost?

$0.01 per call. Every organization gets 100 free calls per UTC day, shared across eligible SandBase APIs including this one; after that each call is billed at this price from your SandBase balance. There is no subscription.

### What parameters does the Tavily Search API accept?

Required: query (string). Optional: search_depth (one of basic, advanced), max_results (integer), topic (one of general, news, finance), include_answer (boolean), include_raw_content (boolean) and include_domains (array) and 1 more. The Parameters table and the Playground on this page list every field.

### What does the Tavily Search API return?

A JSON response returned in the same HTTP request (synchronous). The README on this page includes a sample response.

### Do I need a Tavily developer account or API key?

No. Tavily Search runs through SandBase, so one SandBase API key covers this endpoint and every other API and model in the catalog. You do not need to apply for Tavily API access separately.

## README

### Tavily Search API

Tavily returns search results already cleaned for LLMs: each result has a title, URL, relevant content snippet and score. Optionally get a short generated answer or the raw page content.

#### Use cases

- Give agents real-time web access.
- Build RAG pipelines on fresh sources.
- Research news or financial topics.

#### Request

```bash
curl -X POST "https://api.sandbase.ai/v1/api/tavily/search" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "OpenAI Codex documentation", "max_results": 3}'
```

#### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `query` | string | Yes | The search query. |
| `topic` | string | No | Topic category to focus the search. |
| `max_results` | integer | No | Maximum number of results to return. |
| `search_depth` | string | No | Depth of search. 'advanced' returns more comprehensive results. |
| `include_answer` | boolean | No | Include an LLM-generated answer summarizing the results. |
| `exclude_domains` | array | No | Exclude results from these domains. |
| `include_domains` | array | No | Only include results from these domains. |
| `include_raw_content` | boolean | No | Include the full raw page content for each result. |

#### Example response

Real response for the request above, trimmed to the main fields. User names and long IDs are masked.

```json
{
  "query": "OpenAI Codex documentation",
  "results": [
    {
      "title": "Documentation and implementation of Open AI's new Codex model - API -…",
      "url": "https://community.openai.com/t/documentation-and-implementation-of-op…",
      "content": "# Documentation and implementation of Open AI's new Codex model  Hi,  I am look…",
      "score": 0.8624794
    }
  ],
  "response_time": 1.18
}
```

#### Notes

- `search_depth`: basic or advanced (more comprehensive).
- Set `include_answer` to `true` for an LLM-generated summary.
