> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keenable.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Every page is listed in https://docs.keenable.ai/llms.txt. To pick a product for a job, read https://docs.keenable.ai/choose.md
> Setup steps for agents, covering the SDKs, the MCP server and the CLI: https://docs.keenable.ai/skill.md
> Keenable search and fetch work without an API key. To add them to code, use the official SDK for the project's language: https://docs.keenable.ai/sdks.md
> Without a key, call POST https://api.keenable.ai/v1/search/public or GET https://api.keenable.ai/v1/fetch/public with an X-Keenable-Title header that names your app.
> With a key, send it in the X-API-Key header and read it from the KEENABLE_API_KEY environment variable. Never ask a user to paste a key into chat. Every access method: https://docs.keenable.ai/auth.md
> To get an API key without the console, use device login: https://docs.keenable.ai/authentication.md#device-login
> MCP server: https://api.keenable.ai/mcp (no key, or X-API-Key; keyless Codex uses https://api.keenable.ai/mcp-public), or https://api.keenable.ai/mcp-oauth for OAuth sign-in. These docs are an MCP server at https://docs.keenable.ai/mcp and the OpenAPI spec is at https://docs.keenable.ai/api-reference/openapi.json
> Keenable searches and fetches public web pages. If a question needs no web information, skip the call.
> On 402 with an API key (code insufficient_credits), stop and ask a human to add credits; don't retry. On 429, wait the number of seconds in Retry-After, then retry. Before you ship, follow https://docs.keenable.ai/production.md
> Every error, with its cause and fix, is in https://docs.keenable.ai/errors.md and moving from another search API is covered in https://docs.keenable.ai/migrate.md
> Before you compare Keenable with another search API, read https://docs.keenable.ai/guides/evaluate-search-apis.md

# Web search API for AI agents

> Give your agent ranked web pages with excerpts ready to cite. Try it with no API key. Code, cost per mode, filters by site, date and domain, and gotchas.

Search gives your agent ranked web pages, each with an excerpt of its text, ready for a model to cite. You can try it with no account or API key: see [Keyless access](https://docs.keenable.ai/guides/keyless-access.md).

## Run a search

This sample runs one search with no account or API key and prints the top 3 results as a numbered block you can paste into a prompt:

```typescript TypeScript theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
import { Keenable } from "keenable";

async function main() {
  const client = new Keenable(); // keyless: no API key needed to try it
  const results = await client.search("fastest inference providers 2026", { maxResults: 3 });
  console.log(results.toContext());
}

main();
```

```python Python theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
from keenable import Keenable

client = Keenable()  # keyless: no API key needed to try it
results = client.search("fastest inference providers 2026", max_results=3)
print(results.to_context())
```

```go Go theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
package main

import (
	"context"
	"fmt"
	"log"

	"github.com/keenableai/keenable-sdk/go"
)

func main() {
	client, err := keenable.New(nil) // keyless: no API key needed to try it
	if err != nil {
		log.Fatal(err)
	}
	defer client.Close()

	results, err := client.Search(context.Background(), "fastest inference providers 2026",
		&keenable.SearchOptions{MaxResults: 3})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(results.ToContext(nil))
}
```

```rust Rust theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
use keenable::{Client, SearchOptions};

#[tokio::main]
async fn main() -> Result<(), keenable::Error> {
    let client = Client::new()?; // keyless: no API key needed to try it
    let results = client
        .search_with(
            "fastest inference providers 2026",
            &SearchOptions {
                max_results: Some(3),
                ..Default::default()
            },
        )
        .await?;
    println!("{}", results.to_context());
    Ok(())
}
```

```bash curl theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
curl -X POST https://api.keenable.ai/v1/search/public \
  -H "Content-Type: application/json" \
  -H "X-Keenable-Title: My App" \
  -d '{"query": "fastest inference providers 2026", "max_results": 3}'
```

You see one `[n] Title (url)` header per result, followed by an excerpt of the page:

```text Example output · results vary theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
[1] Hugging Face Inference Providers · Supported Models (https://huggingface.co/inference)
…

[2] Fastest LLM Inference Provider 2026: TTFT, tok/s, p99 (https://openbenchmarks.com/inference/fastest-inference-provider) - published 2026-09-03T00:00:00Z
Baseten recorded the lowest end-to-end p99 latency at 3.23 seconds on this run, with a median of 331 ms…

[3] Best LLM Inference Providers Compared for 2026 - SiliconFlow (https://siliconflow.com/articles/the-best-inference-provider-for-llms)
…
```

The SDK tabs print this block with `to_context()`. The curl tab prints the raw JSON instead: a `results` array whose items have `title`, `url` and `snippet`, in ranked order, most relevant first.

Without an API key, call the `/public` paths and send an `X-Keenable-Title` header that names your app. Without it, the API returns `400` with `missing_app_title`. This command runs a keyless search and prints each result's title and URL:

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
curl -s -X POST https://api.keenable.ai/v1/search/public \
  -H "Content-Type: application/json" \
  -H "X-Keenable-Title: my-app" \
  -d '{"query": "fastest inference providers 2026", "max_results": 3}' \
  | jq -r '.results[] | "\(.title)\t\(.url)"'
```

Your agent cites each source by its number. Map the number back to its URL to show the link. [Ground answers with citations](https://docs.keenable.ai/guides/ground-answers-with-citations.md) shows the whole loop.

## Cost

Each search is billed by the mode that served it. Keyless calls are free. [Rate limits](https://docs.keenable.ai/rate-limits.md) cap them.

| Mode | What you get | SKU |
| - | - | - |
| `pro` (default) | Deeper retrieval | `search.pro` |
| `realtime` | The fastest results | `search.realtime` |

A search costs \$4 per 1,000 at standard prices, and your organization can have its own. Read what a call cost from the `usage` object in the response. See [Balance and usage](https://docs.keenable.ai/credits.md#what-a-call-costs) for the allowance and how usage is reported.

## Key parameters

This sample limits results to one site and to pages published since 1 January 2026, and returns 5 results:

```typescript TypeScript theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
import { Keenable } from "keenable";

async function main() {
  const client = new Keenable(); // keyless: no API key needed to try it
  const results = await client.search("post-training quantization results", {
    site: "arxiv.org",
    publishedAfter: "2026-01-01",
    maxResults: 5,
  });
  for (const result of results.results) {
    console.log(result.title);
    console.log(result.url);
  }
}

main();
```

```python Python theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
from keenable import Keenable

client = Keenable()  # keyless: no API key needed to try it
results = client.search(
    "post-training quantization results",
    site="arxiv.org",
    published_after="2026-01-01",
    max_results=5,
)
for result in results:
    print(result.title)
    print(result.url)
```

```go Go theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
package main

import (
	"context"
	"fmt"
	"log"

	"github.com/keenableai/keenable-sdk/go"
)

func main() {
	client, err := keenable.New(nil) // keyless: no API key needed to try it
	if err != nil {
		log.Fatal(err)
	}
	defer client.Close()

	results, err := client.Search(context.Background(), "post-training quantization results",
		&keenable.SearchOptions{
			Site:           "arxiv.org",
			PublishedAfter: "2026-01-01",
			MaxResults:     5,
		})
	if err != nil {
		log.Fatal(err)
	}
	for _, result := range results.Results {
		fmt.Println(result.Title)
		fmt.Println(result.URL)
	}
}
```

```rust Rust theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
use keenable::{Client, SearchOptions};

#[tokio::main]
async fn main() -> Result<(), keenable::Error> {
    let client = Client::new()?; // keyless: no API key needed to try it
    let results = client
        .search_with(
            "post-training quantization results",
            &SearchOptions {
                site: Some("arxiv.org".into()),
                published_after: Some("2026-01-01".into()),
                max_results: Some(5),
                ..Default::default()
            },
        )
        .await?;
    for result in &results {
        println!("{}", result.title);
        println!("{}", result.url);
    }
    Ok(())
}
```

```bash curl theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
curl -X POST https://api.keenable.ai/v1/search/public \
  -H "Content-Type: application/json" \
  -H "X-Keenable-Title: My App" \
  -d '{
    "query": "post-training quantization results",
    "site": "arxiv.org",
    "published_after": "2026-01-01",
    "max_results": 5
  }'
```

You see 5 titles and URLs, all on `arxiv.org`.

| Parameter | What it does | Example |
| - | - | - |
| `query` | The search query. Required. | `"post-training quantization results"` |
| `site` | Restricts results to one site. | `"arxiv.org"` |
| `exclude_domains` | Leaves these hosts and their subdomains out of the results. A suffix with a leading dot, such as `.gov`, leaves out every host under it. Up to 1,000 entries. | `["pinterest.com", "quora.com"]` |
| `published_after` / `published_before` | Keeps pages published at or after / at or before this point in time. Accepts a date, an ISO 8601 timestamp or a relative delta such as `7d`. | `"2026-01-01"` |
| `acquired_after` / `acquired_before` | Keeps pages Keenable acquired at or after / at or before this point in time. Same formats as above. | `"30d"` |
| `max_results` | Maximum number of results, 1 to 50. Defaults to 10. | `5` |
| `mode` | `pro` for deeper retrieval, `realtime` for the fastest results. Picks the SKU. | `"realtime"` |
| `snippet_max_length` | Maximum length of each result's `snippet`, 180 to 10000 characters. | `500` |
| `disable_cards` | Set to `true` to replace cards (results Keenable writes for prices, exchange rates or company facts) with ordinary web pages. Defaults to `false`. | `true` |
| `safety_mode` | `off`, `moderate` or `strict`. With `moderate` or `strict`, results judged unsafe at that level are removed and not replaced, so fewer can come back. Works only with `mode` `pro` or `realtime`. Defaults to `off`. | `"moderate"` |

`exclude_domains` takes host names, and public suffixes with a leading dot such as `.gov`. A path or a wildcard on a host, such as `*.un.org`, returns `400`. See [Exclude domains](https://docs.keenable.ai/api-reference/search.md#exclude-domains) for the rules.

`safety_mode` with `moderate` or `strict` in any mode other than `pro` or `realtime` returns `400`. See [Safe search](https://docs.keenable.ai/changelog/2026-11-safe-search.md) for a sample request and every error it returns.

The query itself takes operators: `"exact phrase"`, `site:a.com OR site:b.com` for several sites, and `-site:a.com` or `-"phrase"` to leave pages out. See [Search operators](https://docs.keenable.ai/api-reference/search.md#search-operators).

A date on a `_before` bound covers the whole day in UTC. See [Date and time filters](https://docs.keenable.ai/api-reference/search.md#date-and-time-filters) for every accepted format.

For step-by-step examples, see [Filter by date](https://docs.keenable.ai/guides/filter-by-date), [Filter by domain](https://docs.keenable.ai/guides/filter-by-domain.md) and [Choose a search mode](https://docs.keenable.ai/guides/choose-a-search-mode.md).

Every SDK accepts `pro` or `realtime` for `mode`. To send `disable_cards` from an SDK, pass `disable_cards=True` in Python, `disableCards: true` in TypeScript, `DisableCards: true` in Go or `disable_cards: true` in Rust. See [SDKs](https://docs.keenable.ai/sdks.md#methods). In TypeScript, `disableCards` and `mode: "realtime"` need SDK 0.1.5 or later. See [SDK versions](https://docs.keenable.ai/sdks.md#versions).

## Gotchas

Read each result's text from `snippet`. The `description` field is deprecated and always empty. See [Versioning and deprecation](https://docs.keenable.ai/versioning.md).

## Next steps

* [Best practices](https://docs.keenable.ai/best-practices.md): write better queries and keep results small.
* [Guides](https://docs.keenable.ai/guides.md): filter by date or domain, search then fetch, and cite sources.
* [Search API reference](https://docs.keenable.ai/api-reference/search.md): every request parameter and response field.
* [Fetch](https://docs.keenable.ai/products/fetch.md): read the full text of a page you found.
* [Benchmarks](https://docs.keenable.ai/benchmarks.md): speed on Artificial Analysis and the open NEEDLE data, with [Evaluate search APIs](https://docs.keenable.ai/guides/evaluate-search-apis.md) for a comparison on your own queries.
* [RAG with fresh web results](https://docs.keenable.ai/recipes/rag-with-fresh-web-results.md) and [Research loop](https://docs.keenable.ai/recipes/research-loop.md): recipes built on search.
* [Monitors](https://docs.keenable.ai/products/monitors): get new pages about a topic without running the same search again.
* [SDKs](https://docs.keenable.ai/sdks.md): install the Python, TypeScript, Go or Rust client.
* [Tool calling](https://docs.keenable.ai/tool-calling.md): give an LLM search and fetch as tools.
* [Migrate to Keenable](https://docs.keenable.ai/migrate.md): map Tavily, Exa and Brave Search API parameters to Keenable.
* [Errors](https://docs.keenable.ai/errors.md): what each status code means and how to fix it.
* Moving from another search API: see the mappings for [Tavily](https://docs.keenable.ai/migrate/tavily.md), [Exa](https://docs.keenable.ai/migrate/exa.md), [Brave](https://docs.keenable.ai/migrate/brave.md), [Perplexity](https://docs.keenable.ai/migrate/perplexity.md), [SerpApi and Serper](https://docs.keenable.ai/migrate/serpapi-serper.md), [Firecrawl](https://docs.keenable.ai/migrate/firecrawl.md), [Parallel](https://docs.keenable.ai/migrate/parallel.md), [Jina](https://docs.keenable.ai/migrate/jina.md) and [Linkup](https://docs.keenable.ai/migrate/linkup.md), or start from [Migrate to Keenable](https://docs.keenable.ai/migrate.md).

## Related pages

> [card] [Production checklist](https://docs.keenable.ai/production.md)
>
> Ship Keenable search and fetch to production: keys from the environment, rate limits, retries on 429 with Retry-After, stopping on 402, timeouts and status.

> [card] [Pipecat](https://docs.keenable.ai/integrations/pipecat.md)
>
> KeenableWebSearch gives Pipecat voice agents low-latency web search and page fetch.

> [card] [Result size](https://docs.keenable.ai/guides/result-size.md)
>
> How to set max\_results (1 to 50) and snippet\_max\_length (180 to 10,000) so search results fit your context, and when to send disable\_cards for web pages only.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.