The Kagi API provides programmatic access to data that powers our search results & more.
Get started on the API Dashboard to set up billing, manage API keys, and more.
We offer the following libraries you can use to interact with the Kagi API. These are generated from an OpenAPI spec. If you have a language you would like to use and it's not in the list, send us a message and we will add it to the list if it is supported. Or you can use the spec to build your own custom library.
The v1 API is currently in preview to early access testers.
Our existing API, the "v0" beta API, is being replaced with a new version that will be available publicly soon. As changes are made, we will be updating the documentation below when the new features become available.
See the Support and Community section for details.
See our API Pricing page for standard rates.
This is the preferred venue for bug reports and feature requests.
Join our Discord! Good for quick questions or chatting about things you've made with our APIs!
https://redocly-api-docs.kagi.com/_mock/openapi/
https://kagi.com/api/v1/
The Search API is a feature-rich endpoint for search products and agents. It gives programmable access to Kagi's premium search results pulled from many different sources - including our in-house indexes - and re-ranked to surface accurate answers and interesting finds. You can read about our approach towards search on our blog.
The API supports most of the features that we offer through our web UI, including Lenses.
You can also request full markdown extraction of the top results in a single API request.
Array of pages to extract content from. Must contain 1-10 URLs. Each URL must be a valid HTTPS URL.
Optional timeout in seconds for the extraction operation. Out of range values will be clamped back within range.
All URLs are fetched concurrently. This timeout applies a time budget for the entire bulk fetch operation.
https://redocly-api-docs.kagi.com/_mock/openapi/extract
https://kagi.com/api/v1/extract
curl -i -X POST \
https://redocly-api-docs.kagi.com/_mock/openapi/extract \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"pages": [
{
"url": "https://example.com/article1"
},
{
"url": "https://example.com/article2"
}
],
"timeout": 1.337,
"format": "json"
}'Successful extraction
This object is subject to change as it is provided for debugging purposes. Fields may be added or removed as required. Don't build any hard dependancies on any of this data.
Trace ID that can be used to debug individual API requests. Provide this, if needed, when contacting Kagi support.
Array of extracted page content
{ "meta": { "trace": "abc123def456", "ms": 1250, "node": "us-east-1" }, "data": [ { … } ] }