Code examples

Copy-paste recipes. Set BBO_API_KEY in your environment first.

Setup

export BBO_API_KEY="bbo_your_key_here"
BASE="https://dashboard.martha-honeypot.com"

curl

Headline KPIs (7 days)

curl -H "Authorization: Bearer $BBO_API_KEY" "$BASE/api/kpis/summary?range=7d"

Top impersonated brands

curl -H "Authorization: Bearer $BBO_API_KEY" "$BASE/api/kpis/topn/impersonated_brand?range=30d&n=10"

Download Tier-1 CSV

curl -H "Authorization: Bearer $BBO_API_KEY" "$BASE/api/exports/tier1?range=30d" -o tier1.csv

Ask the Intel Agent

curl -X POST -H "Authorization: Bearer $BBO_API_KEY" -H "Content-Type: application/json" \
  -d '{"question":"Top 3 impersonated brands last week?","dashboard_range":"7d"}' \
  "$BASE/api/agent/ask"

Python

Client with retry/backoff

import os, time, requests

BASE = "https://dashboard.martha-honeypot.com"
KEY  = os.environ["BBO_API_KEY"]
H    = {"Authorization": f"Bearer {KEY}"}

def get(path, **params):
    while True:
        r = requests.get(f"{BASE}{path}", params=params, headers=H, timeout=60)
        if r.status_code == 429:
            time.sleep(int(r.headers.get("Retry-After", "5"))); continue
        r.raise_for_status()
        return r.json()

kpis = get("/api/kpis/summary", range="7d")
print(f"{kpis['calls_received']} calls, {kpis['hook_rate']:.1%} hooked, "
      f"${kpis['total_dollars_asked']:,.0f} asked")

Page through the transcript list

def all_transcripts(range="7d", only_tier1=False, page_size=100):
    page = 1
    while True:
        data = get("/api/transcripts", range=range, only_tier1=only_tier1,
                   page=page, page_size=page_size)
        for row in data["items"]:
            yield row
        if page * page_size >= data["total"]:
            break
        page += 1

for call in all_transcripts(range="30d", only_tier1=True):
    print(call["call_sid"], call.get("mule_bank_name") or "-", call.get("monetary_ask_usd"))

Pull a full call + its insights

detail = get("/api/transcripts/CA0123456789")
fin = detail["insights"].get("infra_sticky_financial", {})
print("payment method:", fin.get("requested_payment_method"))
print("mule bank:", fin.get("mule_bank_name"))
for turn in detail["turns"]:
    print(f"[{turn['speaker']}] {turn['text']}")

Stream Tier-1 CSV to disk

with requests.get(f"{BASE}/api/exports/tier1", params={"range": "30d"},
                  headers=H, stream=True, timeout=300) as r:
    r.raise_for_status()
    with open("tier1.csv", "wb") as f:
        for chunk in r.iter_content(8192):
            f.write(chunk)

TypeScript / Node (fetch)

const BASE = "https://dashboard.martha-honeypot.com";
const H = { Authorization: `Bearer ${process.env.BBO_API_KEY}` };

const res = await fetch(`${BASE}/api/kpis/scam-leaderboard?range=30d&n=9`, { headers: H });
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const { items } = await res.json();
for (const row of items) {
  console.log(row.label, row.calls, `$${row.dollars_asked}`);
}
Generate a typed client from the machine spec at the API reference (openapi.public.json).