Kagi Enrichment
Search Kagi's proprietary enrichment indexes using the Kagi Enrichment API. These are Kagi's "secret sauce" — curated indexes of non-commercial and independent content that complement mainstream search results.
Two indexes are available:
| Index | Backend | Best for |
|---|
| INLINECODE0 | Teclis | Independent websites, personal blogs, open-source projects, non-commercial content |
| INLINECODE1 |
TinyGem | Non-mainstream news sources, interesting discussions, off-the-beaten-path journalism |
This skill uses a Go binary for fast startup and zero runtime dependencies. The binary can be downloaded pre-built or compiled from source.
Setup
Requires a Kagi account with API access enabled. Uses the same KAGI_API_KEY as all other kagi-* skills.
- 1. Create an account at https://kagi.com/signup
- Navigate to Settings → Advanced → API portal: https://kagi.com/settings/api
- Generate an API Token
- Add funds at: https://kagi.com/settings/billing_api
- Add to your shell profile (
~/.profile or ~/.zprofile):
export KAGI_API_KEY="your-api-key-here"
- 6. Install the binary — see Installation below
Pricing
$2 per 1,000 searches ($0.002 per query). Billed only when non-zero results are returned.
Usage
CODEBLOCK1
Options
| Flag | Description |
|---|
| INLINECODE5 | Max results to display (default: all returned) |
| INLINECODE6 |
Emit JSON output |
|
--timeout <sec> | HTTP timeout in seconds (default: 15) |
Output
Default (text)
CODEBLOCK2
JSON (--json)
CODEBLOCK3
When to Use
- - Use
web when you want independent, non-commercial perspectives on a topic — personal blogs, indie projects, academic pages, niche communities — results that mainstream search drowns out with SEO-optimized commercial sites - Use
news when you want news and discussions from sources outside the mainstream media cycle — niche outlets, Hacker News threads, Reddit discussions, independent journalists - Combine with
kagi-search for the most complete picture: kagi-search for high-quality general results, kagi-enrich web for independent voices, kagi-enrich news for alternative news angles - Use
kagi-fastgpt instead when you need a synthesized answer rather than a list of sources
Note on result counts
The enrichment indexes are intentionally niche — they may return fewer results than general search. No results for a query means no relevant content was found in that index (and you won't be billed).
Installation
Option A — Download pre-built binary (no Go required)
CODEBLOCK4
Pre-built binaries are available for Linux and macOS (amd64 + arm64) and Windows (amd64).
Option B — Build from source (requires Go 1.26+)
CODEBLOCK5
Alternatively, just run {baseDir}/kagi-enrich.sh directly — the wrapper auto-builds on first run if Go is available.
The binary has no external dependencies — only the Go standard library.
Kagi 增强搜索
使用 Kagi 增强搜索 API 搜索 Kagi 专有的增强索引。这些是 Kagi 的秘方——精心策划的非商业和独立内容索引,补充主流搜索结果。
提供两个索引:
| 索引 | 后端 | 最佳用途 |
|---|
| web | Teclis | 独立网站、个人博客、开源项目、非商业内容 |
| news |
TinyGem | 非主流新闻来源、有趣讨论、冷门新闻报道 |
此技能使用 Go 二进制文件实现快速启动和零运行时依赖。该二进制文件可以预构建下载或从源代码编译。
设置
需要启用 API 访问的 Kagi 账户。使用与所有其他 kagi-* 技能相同的 KAGIAPIKEY。
- 1. 在 https://kagi.com/signup 创建账户
- 导航至设置 → 高级 → API 门户:https://kagi.com/settings/api
- 生成 API 令牌
- 在 https://kagi.com/settings/billing_api 充值
- 添加到您的 shell 配置文件(~/.profile 或 ~/.zprofile):
bash
export KAGI
APIKEY=your-api-key-here
- 6. 安装二进制文件——参见下面的安装部分
定价
每 1,000 次搜索 2 美元(每次查询 0.002 美元)。仅在返回非零结果时计费。
用法
bash
搜索独立网络(Teclis 索引)——默认
{baseDir}/kagi-enrich.sh web rust async programming
{baseDir}/kagi-enrich.sh rust async programming # web 是默认索引
搜索非主流新闻(TinyGem 索引)
{baseDir}/kagi-enrich.sh news open source AI
限制结果数量
{baseDir}/kagi-enrich.sh web sqlite internals -n 5
JSON 输出
{baseDir}/kagi-enrich.sh web zig programming language --json
{baseDir}/kagi-enrich.sh news climate change solutions --json
自定义超时
{baseDir}/kagi-enrich.sh web query --timeout 30
选项
| 标志 | 描述 |
|---|
| -n <num> | 最大显示结果数(默认:全部返回) |
| --json |
输出 JSON 格式 |
| --timeout
| HTTP 超时秒数(默认:15) |
输出
默认(文本)
--- 结果 1 ---
标题: SQLite Internals: How The Worlds Most Used Database Works
URL: https://www.compileralchemy.com/books/sqlite-internals/
日期: 2023-04-01T00:00:00Z
深入探讨 SQLite 的 B-tree 存储引擎、WAL 日志...
--- 结果 2 ---
...
[API 余额:$9.9980 | 结果数:15]
JSON(--json)
json
{
query: sqlite internals,
index: web,
meta: {
id: abc123,
node: us-east4,
ms: 386,
api_balance: 9.998
},
results: [
{
rank: 1,
title: SQLite Internals: How The Worlds Most Used Database Works,
url: https://www.compileralchemy.com/books/sqlite-internals/,
snippet: 深入探讨 SQLite 的 B-tree...,
published: 2023-04-01T00:00:00Z
}
]
}
何时使用
- - 使用 web 当您想要某个主题的独立、非商业视角——个人博客、独立项目、学术页面、小众社区——这些结果在主流搜索中被 SEO 优化的商业网站淹没
- 使用 news 当您想要主流媒体周期之外的新闻和讨论——小众媒体、Hacker News 讨论、Reddit 讨论、独立记者
- 与 kagi-search 结合使用以获得最完整的图景:kagi-search 用于高质量的一般结果,kagi-enrich web 用于独立声音,kagi-enrich news 用于替代新闻视角
- 使用 kagi-fastgpt 当您需要综合答案而不是来源列表时
关于结果数量的说明
增强索引特意针对小众内容——它们可能返回比一般搜索更少的结果。查询没有结果意味着在该索引中未找到相关内容(并且不会向您收费)。
安装
选项 A — 下载预构建二进制文件(无需 Go)
bash
OS=$(uname -s | tr [:upper:] [:lower:])
ARCH=$(uname -m)
case $ARCH in
x86_64) ARCH=amd64 ;;
aarch64|arm64) ARCH=arm64 ;;
esac
TAG=$(curl -fsSL https://api.github.com/repos/joelazar/kagi-skills/releases/latest | grep tag_name | cut -d -f4)
BINARY=kagi-enrich${TAG}${OS}_${ARCH}
mkdir -p {baseDir}/.bin
curl -fsSL https://github.com/joelazar/kagi-skills/releases/download/${TAG}/${BINARY} \
-o {baseDir}/.bin/kagi-enrich
chmod +x {baseDir}/.bin/kagi-enrich
验证校验和(推荐)
curl -fsSL https://github.com/joelazar/kagi-skills/releases/download/${TAG}/checksums.txt | \
grep ${BINARY} | sha256sum --check
预构建二进制文件适用于 Linux 和 macOS(amd64 + arm64)以及 Windows(amd64)。
选项 B — 从源代码构建(需要 Go 1.26+)
bash
cd {baseDir} && go build -o .bin/kagi-enrich .
或者,直接运行 {baseDir}/kagi-enrich.sh——如果 Go 可用,包装器会在首次运行时自动构建。
该二进制文件没有外部依赖——仅使用 Go 标准库。