API 文件
CiphLens 提供 REST API,讓你程式化取得 AEO 稽核結果、生成修復文件,以及整合分數 badge。 所有 Free tier endpoint 無需認證即可呼叫。
所有 endpoint 皆支援 CORS。Free tier 不需要 Authorization header。
VIP tier 需要 Authorization: Bearer <API_KEY>。
對指定網域執行完整 AEO 稽核,回傳 9 項檢查的詳細結果與 AEO 分數(0–100)。 Free tier 回傳 mock 示範資料;VIP tier 執行真實即時稽核。
| 參數 | 型別 | 必填 | 說明 |
|---|---|---|---|
| domain | string | 必填 | 要稽核的網域(不含 https://),例如 example.com |
| tier | string | 選填 | free(預設)或 vip |
# Free tier — 無需 API Key curl -X GET \ "https://ciphlens.ifangdar.workers.dev/api/audit?domain=example.com"
{
"domain": "example.com",
"aeo_score": 72,
"started_at": "2025-04-27T10:00:00Z",
"finished_at": "2025-04-27T10:00:04Z",
"findings": [
{
"key": "robots_txt",
"label": "robots.txt AI Policy",
"severity": "warn",
"score_impact": 6,
"max_score": 10,
"details": "robots.txt 存在但缺少 GPTBot 明確規則"
}
// ... 共 9 項
]
} 根據稽核 ID 取得先前執行的稽核結果。稽核結果快取 24 小時。
| 參數 | 型別 | 必填 | 說明 |
|---|---|---|---|
| id | string | 必填 | 由 /api/audit 回傳的稽核 ID(UUID) |
curl -X GET \
"https://ciphlens.ifangdar.workers.dev/api/audit/aef3b2c1-0001-4abc-9def-123456789abc" {
"id": "aef3b2c1-0001-4abc-9def-123456789abc",
"domain": "example.com",
"aeo_score": 72,
"status": "done",
"// same structure as /api/audit"
} 生成符合 llms.txt 規範的文字檔,告訴 ChatGPT、Claude、Perplexity 等 AI 模型你的網站結構與品牌定位。 Free tier 回傳通用模板;VIP tier 根據實際稽核結果客製生成並提供永久託管 URL。
| 參數 | 型別 | 必填 | 說明 |
|---|---|---|---|
| domain | string | 必填 | 目標網域 |
| tier | string | 選填 | free(預設)或 vip |
curl -X GET \
"https://ciphlens.ifangdar.workers.dev/api/llms-txt?domain=example.com&tier=free" \
-o llms.txt # llms.txt for example.com # Generated by CiphLens — https://ciphlens.com # This file helps AI models understand your website structure. > Site: example.com > Description: [Your brand description] > Language: zh-TW ## Pages - /: 首頁 - /about: 關於我們 - /products: 產品
生成給 Claude Code、Cursor、GitHub Copilot 等 AI coding agent 的修復指引 Markdown 檔。 將回傳內容貼入 agent,即可自動修復稽核發現的 AEO 問題。 VIP tier 版本內嵌你的 API Key,讓 agent 呼叫 CiphLens 驗證修復成效。
| 參數 | 型別 | 必填 | 說明 |
|---|---|---|---|
| domain | string | 必填 | 目標網域 |
| tier | string | 選填 | free(預設)或 vip |
curl -X GET \
"https://ciphlens.ifangdar.workers.dev/api/agent-prompt?domain=example.com&tier=free" \
-o aeo-fix-guide.md # AEO Fix Guide for example.com # Generated by CiphLens ## 任務 根據以下 CiphLens AEO 稽核結果,修復 example.com 的 AI 能見度問題。 ## 問題清單 1. [FAIL] robots.txt 缺少 GPTBot 規則 — 新增 Allow: / for GPTBot 2. [FAIL] 缺少 llms.txt — 在根目錄建立 /llms.txt 3. [WARN] Schema.org 標記不完整 — 補充 Organization schema
回傳可嵌入網站的 AEO 分數 badge(SVG 格式)。
使用 <img> 標籤嵌入即可,
每次頁面載入皆顯示最新快取分數。
VIP tier 支援主題客製與即時分數更新。
| 參數 | 型別 | 必填 | 說明 |
|---|---|---|---|
| domain | string | 必填 | 目標網域 |
| theme | string | 選填 | dark(預設)或 light(Pro 支援品牌色) |
| size | string | 選填 | normal(預設)或 compact |
<img src="https://ciphlens.ifangdar.workers.dev/api/badge?domain=example.com" alt="AEO Score" width="160" />
curl -X GET \
"https://ciphlens.ifangdar.workers.dev/api/badge?domain=example.com&theme=dark&size=normal" \
-o badge.svg
永久託管 llms.txt — 把這個 URL 放在你網站任何位置(robots.txt 的 Sitemap: 欄位、footer、README 等),
AI 爬蟲(GPTBot、ClaudeBot、PerplexityBot 等)每次訪問時,CiphLens 會自動將訪問記錄至 crawler_visits,
讓你掌握「AI 何時開始認識這個品牌」的第一手數據。
Free tier 回傳含浮水印的通用模板;加上 ?tier=vip 回傳無浮水印客製版。
| 參數 | 型別 | 必填 | 說明 |
|---|---|---|---|
| domain | string | 必填 | 目標網域,例如 farglory-land.com.tw(URL 形式:/llms/farglory-land.com.tw.txt) |
| 參數 | 型別 | 必填 | 說明 |
|---|---|---|---|
| tier | string | 選填 | free(預設,含浮水印)或 vip(無浮水印 + 客製品牌段落,需 VIP 授權) |
curl -A "GPTBot/1.0" \ "https://ciphlens.ifangdar.workers.dev/llms/farglory-land.com.tw.txt"
curl -A "GPTBot/1.0" \ "https://ciphlens.ifangdar.workers.dev/llms/farglory-land.com.tw.txt?tier=vip"
# Generated by CiphLens — https://ciphlens.ifangdar.workers.dev # Free 版基本範本 — VIP 版含品牌語境、多語、完整 metadata # farglory-land.com.tw > 此 llms.txt 由 CiphLens AEO 稽核工具自動產生… ## 主要頁面 - [首頁](https://farglory-land.com.tw/) — 品牌首頁 - [關於我們](https://farglory-land.com.tw/about) — 公司簡介 …
# farglory-land.com.tw > 此 llms.txt 由 CiphLens AEO 稽核工具(VIP 版)自動產生,提供完整品牌語境… ## 品牌定位 farglory-land.com.tw 致力於提供高品質的解決方案… ## 多語版本連結 - 繁體中文:https://farglory-land.com.tw/zh-TW/ … # Hosted at https://ciphlens.ifangdar.workers.dev/llms/farglory-land.com.tw.txt
# 你的網站 robots.txt User-agent: GPTBot Allow: / Sitemap: https://ciphlens.ifangdar.workers.dev/llms/your-domain.com.txt
取得稽核當時抓取的原始 HTML 快照。每筆稽核完成後,CiphLens 會把 fetched HTML 存入 R2, 供法務存證、歷史對比與 AI detector 訓練使用。若快照不存在(例如舊稽核或 R2 寫入失敗),回傳 404。
| 參數 | 型別 | 必填 | 說明 |
|---|---|---|---|
| id | string | 必填 | 由 POST /api/audit 回傳的稽核 ID(UUID) |
| Header | 說明 |
|---|---|
| Content-Type | text/html; charset=utf-8 |
| X-CiphLens-Audit-Id | 稽核 ID,便於 client 端對照 |
# 1) 先執行稽核取得 ID ID=$(curl -s -X POST \ "https://ciphlens.ifangdar.workers.dev/api/audit" \ -H 'Content-Type: application/json' \ -d '{"domain":"example.com"}' \ | python3 -c "import json,sys; print(json.load(sys.stdin)['id'])") # 2) 下載 HTML 快照 curl -s \ "https://ciphlens.ifangdar.workers.dev/api/audit/$ID/snapshot" \ -o snapshot.html \ -w 'HTTP %{http_code}, %{size_download}B\n'
{ "error": "Snapshot not found" } // 404 — 快照不存在
{ "error": "Audit not found" } // 404 — 找不到此稽核 ID
{ "error": "Snapshot storage not available" } // 503 — SNAPSHOTS binding 未設定
回傳過去 7 天 AI 爬蟲流量聚合資料(JSON)。從 D1 crawler_visits 資料表統計:
classification 總計、vendor 分布、每日趨勢、熱門路徑。無需 API Key,加 Cache-Control: public, max-age=3600。
{
"generated_at": "2026-04-29T12:00:00.000Z",
"window_days": 7,
"totals": {
"ai_bot": 142,
"ai_referral": 38,
"traditional_bot": 91,
"human": 217
},
"by_vendor": [
{ "vendor": "openai", "visits": 87, "share": 0.18 }
],
"daily": [
{ "day": "2026-04-29", "ai_bot": 30, "ai_referral": 5, "human": 20 }
],
"top_paths": [
{ "path": "/audit", "visits": 123 }
],
"data_source": "ciphlens.com — D1 crawler_visits"
} curl -s \ "https://ciphlens.com/api/ai-bot-index" \ | python3 -m json.tool
CiphLens 公開 8 篇繁中 AEO/GEO 深度研究文件,涵蓋 llms.txt 規格、Schema.org 對應表、AI 引擎引用比較等主題。 完整開放下載,AI 爬蟲可直接抓取 raw markdown。
前往深度研究資源庫 →