What you get
searchreturns ranked pages with their text extracted.fetchreturns one page as markdown.to_context()renders results as numbered[n] Title (url)sources a model can cite.TOOLSholds OpenAI-format definitions forkeenable_searchandkeenable_fetch. A helper runs whichever tool the model calls. See Tool calling, with complete loops for Anthropic, OpenAI, Gemini, Mistral and Ollama or vLLM.- In Python,
AsyncKeenablehas the same methods as the sync client. See Async. The Rust client is async and runs on Tokio. - Search and fetch work with no account and no key. An API key raises your rate limit. Monitors needs a key.
Install
Install the package for your language:pip install. If it does, install the package into a virtual environment: run python3 -m venv .venv, then source .venv/bin/activate. In an empty folder, run go mod init example.com/demo before go get. The Rust samples also need an async runtime: cargo add tokio --features macros,rt-multi-thread.
Versions
These pages describe the SDKs as they are in the SDK repository. A package registry can hold an older release, and the install commands above take the latest one there. This table shows both versions for each language, and the command that prints the version you have:
Release versions checked on 2026-11-19.
These SDK features are not in the latest release yet. The SDK pages mark each one with “Needs SDK” and the version:
On an older release, a method marked “Needs SDK” doesn’t exist, so the call fails. An option marked that way behaves differently in each language. Python raises a
TypeError on the unknown keyword argument. In TypeScript it’s a type error, but the npm package ignores an option it doesn’t know, so plain JavaScript, or code TypeScript doesn’t check, runs the call without it and raises no error. A search then comes back without the filter, and a fetch without the limit or prompt. Until a newer release is out, call the API over HTTP for it. To check a webhook signature without the SDK, follow Verify a webhook.
Run a keyless search
This program runs one search without a key and prints the top 3 results as a citable block:npx tsx index.ts works as is: npx downloads tsx the first time, so you don’t install it. To run the file with plain node, name it index.mjs or add "type": "module" to package.json, because the program uses a top-level import.
You see one
[n] Title (url) header per result, followed by the page text:
Example output · results vary
title, url and snippet, the page text extracted for the query, which is the field to put in a prompt. It also has published_at (publishedAt in TypeScript, PublishedAt in Go) and acquired_at, each an ISO 8601 UTC timestamp when the API has one. Results come back ranked, most relevant first. description is always empty and is deprecated, so read snippet.
To raise your limit, create an API key and set KEENABLE_API_KEY. The code stays the same.
Configuration
Every SDK reads two environment variables:
You can also pass settings to the constructor:
The SDK sends the client source as the
X-Keenable-Title header. It defaults to Keenable SDK. If you build an integration on top of an SDK, set it to your product’s name, so Keenable attributes the traffic to your product.
Methods
Search takes the Search parameters, named in each language’s style:
published_after in Python and Rust, publishedAfter in TypeScript, PublishedAfter in Go. In Rust they are fields on SearchOptions. The same pattern holds for every parameter:
In TypeScript,
disableCards and mode: "realtime" need TypeScript SDK 0.1.5 or later.
The keenable_search tool offers objective and disable_cards to the model too.
In TypeScript, excludeDomains, disableCards and mode: "realtime", and the tool’s exclude_domains and disable_cards, need SDK 0.1.5 or later. objective, on search and in the tool, needs SDK 0.2.0 or later in TypeScript and Python.
fetch takes the Fetch parameters max_chars, live and prompt. Pass them as keyword arguments in Python, as fetch(url, { maxChars, live, prompt }) in TypeScript, through FetchWithOptions and FetchOptions in Go, and through fetch_with and FetchOptions in Rust.
The fetch parameters need Python 0.1.5 or newer and TypeScript 0.1.5 or newer. Check the version you installed with pip show keenable or npm ls keenable. On an older version, fetch takes only the URL.
No SDK has a session_id argument. Send the X-Keenable-Session-Id header through the client’s default headers (TypeScript from keenable 0.2.0). See Group a run with a session ID.
Context size
to_context() keeps a prompt small. It cleans each result’s text first: it drops images, resolves relative links and flattens tables. It then cuts each result’s text at a word boundary near 2,000 characters, ending it with ”…”, so one long page can’t take the whole block. Last, it adds whole results in rank order. If a result would take the block past 12,000 characters, to_context() leaves out that result and every result after it, so the block never ends in the middle of a result. The first result is always kept, even if it’s longer than the limit on its own.
cited() returns the results that to_context() kept, in the same order. Index 0 is the source the model cites as [1].
You can change each limit per call:
To turn off the per-result cap, pass
None in Python, null in TypeScript, a negative number in Go or None in Rust. In Go, 0 means the default.
The limits apply only to the rendered block. Each result’s snippet keeps the full text. To get shorter text for each result from the API, pass snippet_max_length to search, from 180 to 10000 characters.
On a fetched page, to_context() takes only the character limit and cuts the page content at it.
In TypeScript, the per-result limit and the clean-up of images, links and tables need SDK 0.1.5 or later.
Monitors
Every SDK has the Monitors API undermonitors: client.monitors in Python and TypeScript, client.Monitors in Go, client.monitors() in Rust. It needs SDK version 0.2.0 or newer. On an older version there is no monitors property, so upgrade, or call the Monitors API over HTTP with curl. Monitors needs an API key. Without one, a call fails with the SDK’s authentication error and sends no request.
create always sends an Idempotency-Key, either yours or a new one for each call, so the SDK can retry it safely. update, pause, resume, trigger and bulk are retried only after a 429.
To verify a webhook delivery, call the package-level function, not a client method: keenable.verify_webhook(...) in Python, verifyWebhook(...) imported from "keenable" in TypeScript (it returns a promise), keenable.VerifyWebhook(...) in Go and keenable::verify_webhook(...) in Rust. It needs no client or API key. A failed check raises WebhookVerificationError (a *WebhookVerificationError in Go, Error::WebhookVerification in Rust). See Verify a webhook.
Async
In Python, useAsyncKeenable when your code already runs on asyncio. It takes the same constructor settings as Keenable, and you await its search and fetch. If you pass your own HTTP client, pass an httpx.AsyncClient.
This program opens the client with async with, awaits one keyless search and prints each result’s title and URL:
Python
Example output · results vary
async with block closes the connection pool when it ends. If you create the client without async with, call await client.aclose() when you finish.
To run several searches at once with a cap on how many are in flight, see Split a broad question into parallel searches.
TypeScript, Go and Rust have one client each. In TypeScript, search and fetch return promises. In Go, Search and Fetch take a context.Context as their first argument. In Rust, search and fetch are async and need a Tokio runtime, such as #[tokio::main].
Errors
Every SDK raises typed errors that share one base class. In Rust, every call returnskeenable::Error, an enum with one variant per case. See Errors for what each status code means and how to fix it. The SDKs retry retryable errors and connection failures for you, up to 2 times by default. Monitor update, pause, resume, trigger and bulk are the exception: they’re retried only after a 429, as Monitors says. See Retry rules for the waits and how to turn retries off. Each language page says which errors the SDK retries on its own, for example Python errors.
When the API rejects an
exclude_domains entry, the API error carries param (exclude_domains), value (the rejected entry, or the list size for a size limit) and reason. They are value and reason in Python and TypeScript, Value and Reason on an APIError in Go, and value and reason on the ApiError in Rust (err.api_error()). Both are unset on every other error.
In TypeScript, KeenableInsufficientCreditsError, KeenableTimeoutError, value and reason need SDK 0.1.5 or later. So do every API error field other than statusCode, and retryAfterSeconds and limit on KeenableRateLimitError.
A 402 means the organization has used its allowance and its prepaid balance. Retrying fails the same way until someone tops up in the console. The SDKs don’t pay per request: if the API offers a per-request payment, set KEENABLE_API_KEY instead. In Python and TypeScript, a timed-out request raises KeenableTimeoutError, a subclass of KeenableConnectionError.
Source, packages and changelogs
Related pages
Connect your agent (MCP)
Connect the Keenable MCP server to Claude Code, Cursor, Codex and other clients for web search and fetch with no key. Sign in for higher limits and Monitors.
CLI
Install the Keenable CLI, sign in once, add Keenable to Claude Code, Cursor and Codex over MCP, and search, fetch and run monitors from the terminal.
LangChain
Give LangChain agents web search and page fetch with langchain-keenable: the KeenableSearch and KeenableFetch tools.