> ## 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

# Migrate from the Brave Search API to Keenable

> Move a Brave Search API integration to Keenable: map web search query parameters to a POST /v1/search body and web.results to results.

Replace Brave web search calls with Keenable's `POST /v1/search`. This page maps each Brave query parameter and response field to Keenable, and shows the same request on both APIs.

## Migrate with your coding agent

Paste this prompt into your coding agent. Your agent reads this page as markdown and rewrites your calls.

```text theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
Migrate this project from the Brave Search API to Keenable. Read https://docs.keenable.ai/migrate/brave.md for the endpoint, parameter and response maps. Replace every call with the Keenable SDK call or REST request it maps to, remove the parameters marked None, and read KEENABLE_API_KEY from the environment. Then run one request and show me the result. If a call fails, stop and show me the error.
```

Your agent finishes by running one Keenable request and showing you the result. The prompt works with Claude Code, Cursor, Codex and any other agent that can read a URL.

## What changes

| | Brave Search API | Keenable |
| - | - | - |
| Search request | `GET https://api.search.brave.com/res/v1/web/search` with query parameters | `POST https://api.keenable.ai/v1/search` with a JSON body. Only `query` is required. |
| Auth header | `X-Subscription-Token: <YOUR_API_KEY>` | `X-API-Key: $KEENABLE_API_KEY`, or no key on `/v1/search/public` |
| Result shape | Results nested under `web.results`, beside other blocks such as `news` and `videos` | One flat `results` array at the top level |

## Endpoint map

| Brave Search API | Keenable | Match | Notes |
| - | - | - | - |
| `GET /res/v1/web/search` | `POST /v1/search` | Closest | A JSON body instead of query parameters. |

## Parameter map

A parameter Keenable doesn't list returns `400` with `Unknown parameter(s)`, so remove Brave Search API parameters instead of sending them along. "Closest" means the Keenable parameter does a similar job with a different format or behavior, described in the notes.

| Brave Search API parameter | Keenable | Match | Notes |
| - | - | - | - |
| `q` | `query` | Exact | Quoted phrases, `site:` and `-` work as operators in Keenable too. |
| `count` | `max_results` | Exact | Keenable takes `1` to `50`. |
| `freshness` | `published_after` | Closest | `1d` for `pd`, `1w` for `pw`, `1mo` (30 days) for `pm`, `1y` for `py`. For a custom range, also send `published_before`. |
| `safesearch` | `safety_mode` | Closest | Same values: `off`, `moderate`, `strict`. Brave defaults to `moderate`, Keenable to `off`. |
| `extra_snippets` | `snippet_max_length` | Closest | Sets how much page text each `snippet` carries, from `180` to `10000` characters. |
| `offset` | None | None | Ask for up to 50 results in one request. |
| `country` | None | None | Remove it, along with `search_lang`, `ui_lang` and `units`. |
| `spellcheck` | None | None | Remove it. |
| `text_decorations` | None | None | Remove it. `snippet` is markdown. |
| `result_filter` | None | None | Keenable returns web pages only. |
| `goggles` | None | None | Use `site:` operators and `exclude_domains` to shape results. |
| `summary` | None | None | Remove it, along with `enable_rich_callback`. |
| `operators` | None | None | Keenable always reads operators in `query`. |

## Response map

| Brave Search API field | Keenable | Match | Notes |
| - | - | - | - |
| `web.results` | `results` | Closest | At the top level, not under `web`. |
| `web.results[].title` | `results[].title` | Exact | |
| `web.results[].url` | `results[].url` | Exact | |
| `web.results[].description` | `results[].snippet` | Closest | Keenable's own `description` field is deprecated and always empty. |
| `web.results[].extra_snippets` | `results[].snippet` | Closest | One markdown string. Raise `snippet_max_length` for more text. |
| `web.results[].page_age` | `results[].published_at` | Closest | The publish date only, as an ISO 8601 timestamp in UTC. |
| `query.original` | `query` | Exact | |
| `query.more_results_available` | None | None | Ask for up to 50 results in one request. |
| `news` | None | None | Remove code that reads `videos`, `discussions`, `faq`, `infobox` and `locations` too. |
| `summarizer` | None | None | Pass the snippets to your own model. |

## Before and after

This search asks both APIs for 10 pages from the past week. The Keenable request runs without a key.

```bash Brave (before) theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
curl "https://api.search.brave.com/res/v1/web/search?q=machine+learning+tutorials&count=10&freshness=pw" \
  -H "X-Subscription-Token: $BRAVE_API_KEY"
```

```bash Keenable (after) 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": "machine learning tutorials",
    "max_results": 10,
    "published_after": "1w"
  }'
```

The Keenable response has `query`, `mode` and up to 10 `results`. Each result has a `title` and a `url`, and usually a `snippet` and a `published_at`. Read page text from `snippet`, at the top level of each result.

## No equivalent in Keenable

These Brave Search API features have no Keenable counterpart. Remove them from the request, or handle them in your own code as described.

* `offset`: Keenable has no pagination. Ask for up to 50 results in one request with `max_results`.
* `result_filter`: Keenable returns web pages only, with no news, video, FAQ or location blocks.
* `country`: Keenable has no country, language or unit targeting.
* `goggles`: Keenable has no custom reranking. Use `site:` operators and `exclude_domains`.
* `summary`: Keenable returns sources, not a summary. Pass the snippets to your own model.

Mapping checked on 2026-11-19 against [api-dashboard.search.brave.com/documentation/services/web-search](https://api-dashboard.search.brave.com/documentation/services/web-search), [api-dashboard.search.brave.com/api-reference/web/search/get](https://api-dashboard.search.brave.com/api-reference/web/search/get).

## Use an SDK

This program sends the same search as the Keenable tab above with the official SDK. It runs without a key and prints the title and URL of each result.

```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("machine learning tutorials", {
    maxResults: 10,
    publishedAfter: "1w",
  });
  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(
    "machine learning tutorials",
    max_results=10,
    published_after="1w",
)
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(), "machine learning tutorials",
		&keenable.SearchOptions{
			MaxResults:     10,
			PublishedAfter: "1w",
		})
	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(
            "machine learning tutorials",
            &SearchOptions {
                max_results: Some(10),
                published_after: Some("1w".into()),
                ..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": "machine learning tutorials",
    "max_results": 10,
    "published_after": "1w"
  }'
```

You see up to 10 titles and URLs, each from a page published in the past week. Install the SDK for your language from [SDKs](https://docs.keenable.ai/sdks.md).

## Verify the migration

Check each item before you remove the old client:

1. Run the Keenable request from [Before and after](#before-and-after). The status is `200`.
2. `results` has at most as many entries as `max_results`. Each entry has a `title` and a `url`.
3. Your code reads `results` at the top level, not `web.results`.
4. Your code reads `results[].snippet` where it read `description`, and handles a result that has no `snippet`.
5. Your requests send no parameter from a None row. A leftover one returns `400` with `unknown_parameter`.
6. Change the path to `/v1/search` or `/v1/fetch` and send `X-API-Key`. The response gains a `usage` object. See [API keys](https://docs.keenable.ai/api-keys.md).

## Common questions

> [accordion] Trying Keenable without a key
>
> Send the request to `/v1/search/public` or `/v1/fetch/public` with an `X-Keenable-Title` header and no key. Without a key, each endpoint allows 1,000 requests per hour and 10 per second per IP address. See [Rate limits](https://docs.keenable.ai/rate-limits.md).

> [accordion] Paging through results
>
> Keenable has no `offset`. Ask for up to 50 results in one request with `max_results`.

> [accordion] Parameters sent under Brave names
>
> A parameter Keenable doesn't know returns `400` with code `unknown_parameter`. When the name is close to a Keenable one, `did_you_mean` names it: `q` maps to `query`, `count` to `max_results` and `safesearch` to `safety_mode`. See [Errors](https://docs.keenable.ai/errors.md#400-invalid-request).

> [accordion] Cost of each call
>
> Each search mode and each kind of fetch is billed as its own SKU, and a call made with a key returns what it cost in `usage`. See [Pricing](https://docs.keenable.ai/pricing.md) and [Balance and usage](https://docs.keenable.ai/credits.md).

## Related

* [Migrate to Keenable](https://docs.keenable.ai/migrate.md): every provider Keenable has a mapping for.
* [Search API reference](https://docs.keenable.ai/api-reference/search.md): every search parameter and response field.
* [Fetch API reference](https://docs.keenable.ai/api-reference/fetch.md): every fetch parameter and response field.


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