🔌 DiggerKit 接入 · API & SDK🔌 DiggerKit Integration · API & SDK

三种接入方式,任选一种Three Ways to Integrate DiggerKit

SDK 装进你的 SI Agent · MCP 在 IDE 里说人话 · CLI 敲命令做批处理SDK inside your SI Agent · MCP in your IDE · CLI for batch jobs

Token 客户自购You buy your own tokens
数据客户自抓You fetch your own data
0 留存 0 抽佣Zero retention, zero commission

🧭 怎么选🧭 How to Choose

先看你怎么跑客户开发Start from how you run buyer development
🐍

SDK — Python

你已经有 SI Agent 代码库,想把建材合规知识与买家搜索直接接进流程函数里。 装包、传 key、调函数,没有额外服务。You already have an SI Agent codebase and want to call the building-compliance knowledge and buyer search directly from your own functions. Install, pass a key, call the function — no extra service to run.

🔗

MCP — IDE 内MCP — in your IDE

你在 Claude Code / Cursor 里指挥 Agent,不想写代码。 配一个 server 配置,Agent 就能自己查法规、搜买家。You drive an agent in Claude Code or Cursor and do not want to write code. Add one server config and the agent can look up regulations and search buyers on its own.

⌨️

CLI — 终端CLI — terminal

你做批量排查、跑定时任务、或者想在 SSH 上直接查。 管道友好,JSON 输出。You run batch checks, scheduled jobs, or just want to query over SSH. Pipe-friendly with JSON output.

🌐 REST 接口🌐 REST Interface

建材站公开 API · 无需 SDK 也可直接调Public building-platform API · callable without the SDK
方法Method路径Path用途Purpose
GET/building/api/stats 平台运行统计(段数 / 客户站数 / 画像数 / 法规数 / 市场数)Platform runtime statistics (segments / customer sites / profiles / regulations / markets)
GET/building/api/health服务健康检查Service health check
GET/building/api/chat/kb列出 DiggerChat 全部知识段List all DiggerChat knowledge segments
GET/building/api/chat/health知识库段数与拒答规则数Knowledge segment and refusal rule counts
POST/building/api/chat建材合规问答Building-compliance Q&A
GET/building/api/customer-types7 类客户画像清单List of the 7 customer profiles
POST/building/api/detect-type按 brief 判定客户类型Detect the customer type from a brief
POST/building/api/brief/validate校验蒸馏输入完整度Validate distillation input completeness
GET/building/api/distill/schema蒸馏输入契约Distillation input contract
POST/building/api/distill同步蒸馏,返回 3 件产物Synchronous distillation, returns 3 deliverables
POST/building/api/distill/start异步蒸馏,返回 job_idAsynchronous distillation, returns a job_id
GET/building/api/distill/status/{job_id}异步任务进度Async job progress
GET/building/api/distill/result/{job_id}异步任务结果Async job result
💡 客户网站后台另有独立前缀 /building/api/site/* (manifest / modules / update / diagnose / credential/recompute / rebuild), 用于按模块增量更新客户站,不重建整页。💡 The customer-site backend lives under its own prefix /building/api/site/* (manifest / modules / update / diagnose / credential/recompute / rebuild) and updates customer sites module by module without rebuilding the page.

🧪 3 个可直接跑的请求🧪 3 Runnable Requests

复制即用 · 加 ?cb=<毫秒> 防缓存Copy and run · add ?cb=<ms> to bypass cache
📊

取平台运行统计Fetch platform runtime statistics

GET /building/api/stats
▾
curl "https://golddigger.gold/building/api/stats"

返回 JSON,数字由平台实际文件与数据库统计得出。Returns JSON; the numbers are counted from the platform's actual files and database.

🧠

问建材合规问题Ask a building-compliance question

POST /building/api/chat
▾
curl -X POST "https://golddigger.gold/building/api/chat" \
  -H "Content-Type: application/json" \
  -d '{"message":"What certification does steel structure export need?"}'

回答只来自知识库检索,无检索不回答;高风险问题(代办认证、改分、编造数据)直接拒答。Answers come only from knowledge-base retrieval; no retrieval means no answer. High-risk questions (certification brokering, score editing, fabricated data) are refused outright.

⚗️

跑一次蒸馏Run a distillation

POST /building/api/distill
▾
curl -X POST "https://golddigger.gold/building/api/distill" \
  -H "Content-Type: application/json" \
  -d '{
    "company_name": "Example Building Materials Co.",
    "customer_type": "Steel structure manufacturer",
    "main_products": "Portal frames, steel trusses",
    "capacity": "50,000 t/yr",
    "export_markets": "Saudi Arabia, Brazil",
    "certifications": "ISO 9001, EN 1090-1",
    "contact": "sales@example.invalid"
  }'

返回客户画像 + 物料底账 + 合规凭证 + 智能网站地址。Returns the customer profile, material ledger, compliance credential and smart website URL.

🔌 MCP 配置🔌 MCP Configuration

Claude Code / Cursor 等 MCP 客户端MCP clients such as Claude Code and Cursor
{
  "mcpServers": {
    "golddigger-building": {
      "command": "npx",
      "args": ["-y", "@golddigger/diggerkit-mcp"],
      "env": {
        "GOLDETRUSPHY_API_KEY": "$GOLDETRUSPHY_API_KEY"
      }
    }
  }
}
⚠️ 具体包名与参数以 DiggerKit-C+ 页面公布的版本为准。 API Key 由你自行申请与保管,平台不代持。⚠️ The exact package name and parameters follow the version published on the DiggerKit-C+ page. You apply for and hold the API key yourself; the platform does not hold it.

📐 配额与限流📐 Quota & Rate Limits

4 档订阅 · 详见服务报价页4 subscription tiers · see the pricing page
档位Tier配额Quota适合Suits
Starter先试试水Try it out
Pro稳定跑量的中小工厂Steady-volume small and mid-size factories
Premium多产线 / 多市场Multiple lines / multiple markets
Whitelabel无限Unlimited平台化对外服务Platform resale
💡 超配额返回 429。配额按自然日计算,按 API Key 维度限流。💡 Exceeding the quota returns 429. Quotas are counted per calendar day and rate limited per API key.

🔒 接口约定🔒 API Contract

写代码前先看这 5 条Read these 6 points before coding
1️⃣

认证方式Authentication

请求头带 Authorization: Bearer <你的 key>。 key 在工厂后台自取,平台不代管。Send Authorization: Bearer <your key>. You obtain the key yourself from the factory console; the platform does not hold it.

2️⃣

响应格式Response format

统一 JSON。ok 表示成功, error 字段带可读原因。Always JSON. ok signals success; the error field carries a readable reason.

3️⃣

幂等Idempotency

纯查询接口无副作用,可安全重试。 写入类接口带幂等键,重复提交返回同一 job。Read-only endpoints have no side effects and are safe to retry. Write endpoints take an idempotency key and return the same job on repeat submission.

4️⃣

错误码Error codes

400 参数缺 · 401 key 无效 · 404 资源不存在 · 429 超配额 · 409 状态冲突 · 500 内部错误。400 missing parameter · 401 invalid key · 404 not found · 429 quota exceeded · 409 state conflict · 500 internal error.

5️⃣

不承诺的事What we do not promise

接口不做认证代办、不生成认证编号、不编造碳足迹数值、 不保证通过任何认证。The API does not broker certifications, does not generate certificate numbers, does not fabricate carbon footprint values, and does not guarantee any certification outcome.

6️⃣

数据留存Data retention

接口不接收也不存储买家数据。 挖客在你的 Agent 侧完成。The API neither receives nor stores buyer data. Buyer development happens on your agent side.

💡 还在选?先看 DiggerKit 总览, 或直接 免费注册 拿配额。💡 Still deciding? See the DiggerKit overview, or sign up free to get a quota.
AI 助手
🏠
首页home.html
🧪
蒸馏register.html
📊
看板dashboard.html
📚
知识库kb.html
🔗
供应链supplier.html