实战范例

线索补全

用结构化提取从公司官网补全 CRM 线索

给定一批公司 URL(来自 CRM、注册表单或手动上传),抽取结构化的公司画像数据 —— 行业、员工规模、技术栈、联系渠道 —— 再回写到线索记录。

Schema

{
  "type": "object",
  "properties": {
    "companyName":   { "type": "string" },
    "industry":      { "type": "string", "description": "Primary industry from the homepage / about page" },
    "employeeCount": { "type": "string", "description": "Headcount band, e.g. '11-50'" },
    "headquarters":  { "type": "string", "description": "City, country" },
    "contactEmail":  { "type": "string" },
    "linkedinUrl":   { "type": "string" }
  },
  "required": ["companyName"]
}

实现

import httpx

API = "https://openapi.thunderbit.com/openapi/v1"
H = {"Authorization": "Bearer YOUR_API_KEY"}

leads = [
    {"id": "lead_1", "url": "https://acme.com"},
    {"id": "lead_2", "url": "https://stripe.com"},
]

job = httpx.post(f"{API}/batch/extract",
                 headers=H,
                 json={"urls": [l["url"] for l in leads],
                       "schema": SCHEMA,
                       "webhook": {"url": "https://your-server.com/webhook/leads",
                                   "secret": "whsec_..."}}).json()

Webhook 触发时,把 results[].url 关联回你的 lead ID,再把结构化字段写回 CRM。

小贴士

  • required 保持最小化 —— 很多小公司站点不会包含全部字段
  • 加一个"尽力而为"的兜底:如果 contactEmail 缺失,再 distill 一下 /contact 页面
  • 按域名缓存 —— 同一个域名通常每月补一次就够了

相关

这份 recipe 正在补充 CRM 集成模式(HubSpot / Salesforce),敬请期待。