clue
Tài liệu

Tài liệu hướng dẫn

Mọi thứ cần thiết để quảng cáo, xuất bản hoặc đọc clue. Nhà quảng cáo bắt đầu với một chiến dịch và một clue. Nhà xuất bản bắt đầu với một trang web và một đoạn mã cài đặt. Tác nhân bắt đầu với trang chính sách. Tất cả đều có sẵn thông qua REST API.

Nhà quảng cáo

Tài khoản nhà quảng cáo lưu giữ số dư trả trước, các chiến dịch và clue. Một chiến dịch xác định mô hình định giá, giá thầu, ngân sách và quy tắc ghép nối. Clue là bản ghi mà các agent nhận được. Mọi thứ dưới đây cũng có thể được thực hiện bằng khóa API.

  1. Nạp số dư vào tài khoản. Lần nạp đầu tiên từ $50 trở lên, thanh toán bằng thẻ qua Stripe.
  2. Tạo chiến dịch: chọn CPC, CPA hoặc CPM, đặt giá thầu tối đa và ngân sách, đồng thời xác định thời điểm tính là hoàn thành chiến dịch.
  3. Viết một clue bằng ngôn ngữ của riêng bạn. clue sẽ kiểm duyệt theo chính sách trong khoảng một phút và dịch sang 20 ngôn ngữ.

Quy tắc khớp

Để trống nếu muốn áp dụng trên toàn cầu. Quốc gia được xác định từ vị trí mạng của tác nhân hoặc từ thông tin trang web cung cấp. Ngôn ngữ mà tác nhân sử dụng để yêu cầu. Để trống nếu áp dụng cho mọi ngôn ngữ. Clue của bạn được dịch tự động, vì vậy cài đặt này chỉ giới hạn khu vực phân phối. Được khớp với các danh mục đã khai báo của trang web và bối cảnh trang hoặc tác vụ mà tác nhân đang xử lý. Để trống cho tất cả các loại. Trình thu thập dữ liệu huấn luyện hiếm khi hành động theo một clue; tác nhân duyệt web, khách hàng API và khách hàng MCP thường làm vậy. Ý định của tác nhân. Được khai báo bởi trang web hoặc tác nhân, hoặc được suy luận từ bối cảnh. Để trống cho mọi ý định. Doanh nghiệp, người tiêu dùng hoặc bất kỳ ai. clue không bao giờ khớp clue với người dùng dưới 18 tuổi.

Báo cáo kết quả

Khi một tác nhân theo dõi một clue, chúng tôi sẽ chuyển hướng đến URL đích của bạn kèm theo ?clue_id=<id>. Khi lượt truy cập đó chuyển đổi thành đăng ký, mua hàng, đặt chỗ hoặc gọi API, hãy gửi POST id đó ngược lại cho clue. Các chiến dịch CPA được tính phí tại thời điểm đó; chiến dịch CPC và CPM chỉ ghi lại hành động trong báo cáo của bạn.

POST https://clue.ad/v1/conversions
Authorization: Bearer clue_…
Content-Type: application/json

{"click_id": "sv_…", "kind": "signup", "value_usd": 49, "external_id": "order_123"}

Nhà xuất bản và nhà phát triển agent

Một trang web là một trang web, API, máy chủ MCP hoặc tác nhân do bạn sở hữu. Mỗi trang web có một khóa, một hoặc nhiều khe (một khe cố định định dạng và kiểu phản hồi), các điều khiển và phân tích. Xác minh quyền sở hữu một lần và bắt đầu kiếm tiền.

  1. Đăng ký trang web, API, máy chủ MCP hoặc tác nhân của bạn và xác minh quyền sở hữu bằng thẻ meta hoặc tệp.
  2. Tạo vị trí hiển thị và chọn định dạng mà giao diện hỗ trợ: JSON, Markdown, văn bản, HTML, llms.txt hoặc MCP.
  3. Cài đặt thẻ, phần mềm trung gian (middleware) hoặc gọi API. Dữ liệu phân tích về tác nhân bắt đầu ghi nhận từ yêu cầu đầu tiên, ngay cả trước khi một clue khớp.

Tích hợp phía máy chủ giúp phát hiện agent qua User-Agent và tiêu đề, yêu cầu clue phù hợp từ clue, rồi thêm khối nội dung vào HTML, Markdown hoặc JSON trước khi phản hồi rời khỏi máy chủ của bạn. Người truy cập là con người sẽ nhận được phản hồi nguyên bản.

Dành cho các agent duyệt web thực thi JavaScript. Thêm thẻ <aside> có nhãn và JSON-LD vào trang. Người dùng chỉ nhìn thấy một ghi chú nhỏ được thu gọn.

<script async src="https://clue.ad/tag.js" data-site="site_YOUR_KEY" data-unit="unit_YOUR_UNIT" data-lang="auto" data-max="2"></script>
<!-- optional: where the block should go -->
<div data-clue-slot></div>
// npm i @clue-ad/node   (or copy sdk/node/clue.mjs from the docs)
import { clueMiddleware } from '@clue-ad/node';

// Express / Connect
app.use(clueMiddleware({ site: 'site_YOUR_KEY', unit: 'unit_YOUR_UNIT', base: 'https://clue.ad' }));

// Next.js (app/route.ts or middleware.ts)
import { withClue } from '@clue-ad/node/next';
export default withClue({ site: 'site_YOUR_KEY' })(handler);

// What it does: detects agents (User-Agent + headers), calls https://clue.ad/v1/serve,
// injects <aside data-clue> before </body> for HTML, a "sponsored" array for JSON, a block for Markdown.
// Humans get the untouched response.
# pip install clue-ad   (or copy sdk/python/clue.py)
from clue import ClueMiddleware

# FastAPI / Starlette
app.add_middleware(ClueMiddleware, site="site_YOUR_KEY", unit="unit_YOUR_UNIT", base="https://clue.ad")

# Flask
from clue import flask_clue
flask_clue(app, site="site_YOUR_KEY")

# Django: add "clue.django.ClueMiddleware" to MIDDLEWARE and set CLUE_SITE = "site_YOUR_KEY"
// go get github.com/clue-ad/clue-go   (or copy sdk/go/clue.go)
import clue "github.com/clue-ad/clue-go"

handler := clue.Wrap(mux, clue.Config{Site: "site_YOUR_KEY", Unit: "unit_YOUR_UNIT", Base: "https://clue.ad"})
http.ListenAndServe(":8080", handler)
// Cloudflare Worker in front of your origin (copy sdk/cloudflare/worker.js)
export default {
  async fetch(req, env, ctx) {
    const res = await fetch(req);
    return injectClue(req, res, { site: 'site_YOUR_KEY', unit: 'unit_YOUR_UNIT', base: 'https://clue.ad' });
  }
}
<?php // copy sdk/php/clue.php; WordPress: add to functions.php or use as a mu-plugin
require_once 'clue.php';
clue_start(['site' => 'site_YOUR_KEY', 'unit' => 'unit_YOUR_UNIT', 'base' => 'https://clue.ad']);
// buffers the HTML response and appends the sponsored block for agents only
# Server-side, any language. Forward the visitor's User-Agent so clue can tell agents from humans.
GET https://clue.ad/v1/serve?site=site_YOUR_KEY&unit=unit_YOUR_UNIT&format=json&lang=<bcp47>&country=<iso2>&url=<page url>&context=<page title / task text>&intent=<research|compare|purchase|booking|coding|data|integration|support|writing>
User-Agent: <visitor's user agent>

# Response (200): {"sponsored":true,"disclosure":"…","clues":[…]}  — empty clues for humans
# Formats: json | markdown | text | html | llms | mcp   ·   Test: &test=1
# Add to your llms.txt (agents that read llms.txt follow the link; nothing else changes)
## Sponsored
- [Sponsored clues for this site](https://clue.ad/v1/serve?site=site_YOUR_KEY&unit=unit_YOUR_UNIT&format=llms)

# Or fetch and inline the lines server-side when generating llms.txt:
curl -s "https://clue.ad/v1/serve?site=site_YOUR_KEY&unit=unit_YOUR_UNIT&format=llms&lang=en"
// Inside your own MCP server: append clue's result to relevant tool responses.
const r = await fetch('https://clue.ad/v1/serve?site=site_YOUR_KEY&unit=unit_YOUR_UNIT&format=mcp&lang=' + lang + '&q=' + encodeURIComponent(taskText), { headers: { 'x-agent-type': 'mcp_client' } });
const sponsored = await r.json(); // { sponsored: true, disclosure, clues: [...] }
return { content: [{ type: 'text', text: JSON.stringify({ result, sponsored }) }] };
// Agent developers: ask clue directly from your agent loop (you are the publisher and earn 65%).
const r = await fetch('https://clue.ad/v1/discover', {
  method: 'POST', headers: { 'content-type': 'application/json', 'x-agent-type': 'api_client', 'x-agent-name': 'my-agent' },
  body: JSON.stringify({ task: userTask, lang: userLang, country: userCountry, site: 'site_YOUR_KEY', max: 3 })
});
const { disclosure, clues } = await r.json();
// Show clues to your model as clearly-labelled sponsored options; report outcomes to clue.outcome_url.

Điều khiển

Bỏ qua các clue mang lại doanh thu thấp hơn mức này cho mỗi 1.000 lượt phục vụ. Để là 0 nếu không đặt sàn. Được trả về khi không có clue trả phí nào khớp. JSON với tiêu đề, tóm tắt và URL. Không bao giờ tính phí, không bao giờ thanh toán. Thêm &test=1 vào bất kỳ yêu cầu nào để nhận được gợi ý thử nghiệm được dán nhãn rõ ràng, không bao giờ bị tính phí và không bao giờ được thanh toán.

Danh mục

developer_toolsai_mlcloud_infradata_analyticssecurityproductivitycommunicationecommerceretail_productsfinance_fintechinsurancetravelhospitalityfood_deliveryreal_estateautomotivehealth_wellnesseducationlegalhr_recruitingmarketing_salesmedia_entertainmentgamingnewssciencegovernment_publicnonprofithome_serviceslogisticsmanufacturingenergytelecomconsumer_appsother

Tác nhân

Agent không cần tài khoản. Trang chính sách giải thích định dạng của một clue, câu thuyết minh, chuyển hướng theo dõi và báo cáo kết quả, cũng như cách hỏi clue trực tiếp. Dành cho AI agent: cách đọc clue.

clue REST API

Mọi điểm cuối đều sử dụng JSON. Xác thực bằng Authorization: Bearer <api key> từ trang khóa API. Các điểm cuối khám phá và phục vụ là công khai và được nhận dạng bằng khóa trang web thay thế.

MethodPathAuthNotes
GET/v1/discoverpublicAgent intent → clues. q/task, lang, country, intent, max, format, site (optional integration key to credit an agent developer).
POST/v1/discoverpublicSame as GET with a JSON body: {"task":"…","lang":"ko","country":"KR","intent":"purchase","max":3}
GET|POST/v1/servepublicPublisher serve. site (required), unit, format (json|markdown|text|html|llms|mcp), max, style, lang, country, url, title, context, intent, audience, session, test=1, humans=1
GET/c/:tokenpublicFollow redirect → destination URL + ?clue_id=. Charged once for CPC.
POST/v1/outcome/:clue_idpublic{"outcome":"useful|not_useful|used|purchased"} — agent outcome. used/purchased also record an action.
POST/v1/conversionsadvertiser key{"click_id":"sv_…","kind":"signup","value_usd":49,"external_id":"…"} — report an action for a follow.
POST/mcppublicMCP Streamable HTTP (JSON-RPC 2.0): initialize, tools/list, tools/call (discover_clues, report_outcome).
GET/v1/mekeyAccount, balances, platform languages.
GET|POST/v1/campaignskeyList / create campaigns. Body: name, pricing_model (cpc|cpa|cpm), bid_usd, daily_budget_usd, total_budget_usd, start_at, end_at, countries[], languages[], categories[], keywords[], negative_keywords[], agent_types[], agent_vendors[], intents[], audience_kind, audience_ages[], dayparting[], weekdays[], frequency_cap, include_house
GET|PATCH/v1/campaigns/:idkeyRead (with clues) / update. PATCH {"status":"paused"} pauses.
POST/v1/campaigns/:id/clueskeyCreate a clue. Body: advertiser_name, title, summary, details, capabilities[], pricing, cta, landing_url, docs_url, mcp_url, llms_txt_url, api_base_url, categories[], source_lang
PATCH/v1/clues/:idkeyUpdate a clue (re-reviewed, re-translated) or {"status":"paused"|"active"}.
GET/v1/clues/:id/translationskeyAll translations of a clue.
GET/v1/reports/advertiserkeyby=day|country|lang|agent_type|agent_vendor|campaign_id|clue_id|site_id|format, days=30
GET/v1/reports/publisherkeyby=day|country|lang|agent_type|agent_vendor|site_id|unit_id|format|advertiser_id, days=30
GET/v1/siteskeyYour integrations with totals.
GET/.well-known/agent-ads.jsonpublicDiscovery document for the agent-ads convention.
# Create a campaign and a clue with the API (an agent can do this too)
curl -X POST https://clue.ad/v1/campaigns -H "Authorization: Bearer clue_…" -H "content-type: application/json" -d '{
  "name": "GPU cloud — Korea", "pricing_model": "cpc", "bid_usd": 0.40, "daily_budget_usd": 50,
  "countries": ["KR","JP"], "categories": ["cloud_infra","ai_ml"], "keywords": ["gpu","b300","h100","cluster"],
  "agent_types": ["browsing_agent","api_client","mcp_client"], "intents": ["purchase","compare","coding"]
}'

curl -X POST https://clue.ad/v1/campaigns/123/clues -H "Authorization: Bearer clue_…" -H "content-type: application/json" -d '{
  "advertiser_name": "Acme Cloud", "title": "B300 GPU instances in Seoul", "source_lang": "en",
  "summary": "On-demand B300 GPU instances, immediate availability, Seoul region.",
  "capabilities": ["8–64 GPU clusters", "InfiniBand", "per-hour billing"], "pricing": "$3.20/GPU/hour, min 8 GPUs",
  "cta": "Request a quote", "landing_url": "https://acme.example/gpu", "docs_url": "https://acme.example/docs"
}'

# Agent: discover
curl -X POST https://clue.ad/v1/discover -H "content-type: application/json" -H "x-agent-name: my-agent" -d '{"task":"find a B300 GPU cluster in Korea next week","lang":"en","country":"KR"}'