實戰範例

Lead 補全

用結構化擷取從公司網站補全 CRM Lead

給定一份公司 URL 清單(來自 CRM、註冊表單或人工上傳),從中拉出結構化的公司情報 —— 產業、員工數、技術棧、聯絡管道 —— 再寫回 Lead 紀錄。

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 盡量精簡 —— 很多小公司網站不會每個欄位都齊全
  • 加一段「best-effort」流程:若 contactEmail 缺失,順便 distill /contact
  • 以 domain 做快取 —— 同一個 domain 通常每月補一次就夠

相關

本食譜將補充 CRM 整合 pattern(HubSpot/Salesforce)—— 敬請期待。