> ## 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 SerpApi or Serper to Keenable

> Move a SerpApi or Serper Google search integration to Keenable: map q, tbs and organic results to POST /v1/search, with before and after code.

Replace SerpApi or Serper Google search calls with Keenable's `POST /v1/search`. This page maps the request parameters and organic result fields of both 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 SerpApi or Serper to Keenable. Read https://docs.keenable.ai/migrate/serpapi-serper.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

| | SerpApi and Serper | Keenable |
| - | - | - |
| SerpApi request | `GET https://serpapi.com/search?engine=google&q=...&api_key=...` | `POST https://api.keenable.ai/v1/search` with a JSON body. Only `query` is required. |
| Serper request | `POST https://google.serper.dev/search` with a JSON body and an `X-API-KEY` header | `POST https://api.keenable.ai/v1/search` with a JSON body |
| Auth | SerpApi: `api_key` query parameter. Serper: `X-API-KEY` header. | `X-API-Key: $KEENABLE_API_KEY` header, or no key on `/v1/search/public` |

## Endpoint map

| SerpApi and Serper | Keenable | Match | Notes |
| - | - | - | - |
| `GET /search` (SerpApi) | `POST /v1/search` | Closest | A JSON body instead of query parameters. `engine` is not needed. |
| `POST /search` (Serper) | `POST /v1/search` | Exact | |

## Parameter map

A parameter Keenable doesn't list returns `400` with `Unknown parameter(s)`, so remove SerpApi and Serper 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.

| SerpApi and Serper parameter | Keenable | Match | Notes |
| - | - | - | - |
| `q` | `query` | Exact | Keenable reads quoted phrases, `site:`, `OR`, `-` and parentheses. Other Google operators, such as `inurl:` and `intitle:`, are plain words. |
| `num` | `max_results` | Exact | Keenable takes `1` to `50`. SerpApi stopped supporting `num` on Google in September 2025, but older code may still send it. |
| `tbs` | `published_after` | Closest | These are Google's `tbs` values. `qdr:h` becomes `1h`, `qdr:d` `1d`, `qdr:w` `1w`, `qdr:m` `1mo`, `qdr:y` `1y`. |
| `safe` (SerpApi) | `safety_mode` | Closest | `moderate` or `strict` for `active`, `off` for `off`. |
| `start` (SerpApi) | None | None | Ask for up to 50 results in one request. Serper's `page` is the same. |
| `location` | None | None | Remove it, along with `uule`, `lat` and `lon`. |
| `gl` | None | None | Remove it, along with `hl`, `cr`, `lr` and `google_domain`. |
| `tbm` (SerpApi) | None | None | Keenable searches web pages only. |
| `device` (SerpApi) | None | None | Remove it. |
| `no_cache` (SerpApi) | None | None | Remove it, along with `async`. |
| `nfpr` (SerpApi) | None | None | Remove it, along with `filter` and Serper's `autocorrect`. |
| `output` (SerpApi) | None | None | Not needed. The response is always JSON. |

## Response map

| SerpApi and Serper field | Keenable | Match | Notes |
| - | - | - | - |
| `organic_results` | `results` | Closest | Serper calls it `organic`. |
| `organic_results[].title` | `results[].title` | Exact | |
| `organic_results[].link` | `results[].url` | Exact | |
| `organic_results[].snippet` | `results[].snippet` | Closest | Markdown text from the page, often longer. `snippet_max_length` caps it. |
| `organic_results[].date` | `results[].published_at` | Closest | An ISO 8601 timestamp in UTC, not display text. |
| `organic_results[].position` | None | None | Use the index in `results`: best match first. |
| `organic_results[].displayed_link` | None | None | Build display text from `url`. `favicon`, `thumbnail` and `sitelinks` have no equivalent either. |
| `search_metadata.id` | The `X-Request-Id` response header | Closest | |

## Before and after

This search asks both APIs for pages on github.com from the past month. The Keenable request runs without a key and sends the site as its own parameter.

```bash SerpApi (before) theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
curl -G https://serpapi.com/search \
  --data-urlencode "engine=google" \
  --data-urlencode "q=rust async runtime site:github.com" \
  --data-urlencode "tbs=qdr:m" \
  --data-urlencode "api_key=$SERPAPI_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": "rust async runtime",
    "site": "github.com",
    "published_after": "1mo",
    "max_results": 10
  }'
```

The Keenable response has `query`, `mode` and up to 10 `results`, all on github.com. Each result has a `title`, a `url` and usually a `snippet`. Read `url` where you read `link` before.

## No equivalent in Keenable

These SerpApi and Serper features have no Keenable counterpart. Remove them from the request, or handle them in your own code as described.

* `start`: Keenable has no pagination. Ask for up to 50 results in one request with `max_results`.
* `location`: Keenable has no location, country or language targeting.
* `tbm`: Keenable returns web pages only, with no image, news or shopping verticals.
* `organic_results[].position`: Results come best match first, so the position is the array index.

Mapping checked on 2026-11-19 against [serpapi.com/search-api](https://serpapi.com/search-api), [serper.dev/playground](https://serper.dev/playground), [docs.firecrawl.dev/api-reference/endpoint/search](https://docs.firecrawl.dev/api-reference/endpoint/search).

## 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("rust async runtime", {
    site: "github.com",
    publishedAfter: "1mo",
    maxResults: 10,
  });
  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(
    "rust async runtime",
    site="github.com",
    published_after="1mo",
    max_results=10,
)
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(), "rust async runtime",
		&keenable.SearchOptions{
			Site:           "github.com",
			PublishedAfter: "1mo",
			MaxResults:     10,
		})
	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(
            "rust async runtime",
            &SearchOptions {
                site: Some("github.com".into()),
                published_after: Some("1mo".into()),
                max_results: Some(10),
                ..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": "rust async runtime",
    "site": "github.com",
    "published_after": "1mo",
    "max_results": 10
  }'
```

You see up to 10 titles and URLs, all on github.com and published in the past month. 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[].url` where it read `link`, and `results[].snippet` where it read `snippet`.
4. Your code takes a result's position from its index in `results`.
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] More than 50 results
>
> One request returns at most 50 results, and Keenable has no `start` or `page` parameter. Narrow the query with `site:` operators or date filters instead.

> [accordion] Google operators
>
> Keenable reads quoted phrases, `site:`, `OR`, `-` and parentheses in `query`. Other Google operators, such as `inurl:` and `intitle:`, are read as plain words. See [Search operators](https://docs.keenable.ai/api-reference/search.md#search-operators).

> [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.