Paste-and-go snippets for common integration patterns. Drop into a project and they work. Each recipe is small, single-purpose, and uses only the public TerminalFeed API or the agent-payable premium tier. Nothing here requires a build step.
async function tick() { const r = await fetch('https://terminalfeed.io/api/btc-price'); const d = await r.json(); document.querySelector('#btc').textContent = '$' + d.data.price.toLocaleString() + ' (' + d.data.change24h.toFixed(2) + '%)'; } tick(); setInterval(tick, 30000);
<iframe src="https://terminalfeed.io/bitcoin-ticker" width="320" height="80" frameborder="0"></iframe>
function useBriefing() { const [data, setData] = useState(null); useEffect(() => { let alive = true; fetch('https://terminalfeed.io/api/briefing') .then(r => r.json()) .then(j => { if (alive) setData(j.data); }) .catch(() => {}); return () => { alive = false; }; }, []); return data; }
import requests, json r = requests.get('https://terminalfeed.io/api/briefing') briefing = r.json() # briefing['data'] has crypto, fear_greed, earthquakes, hn, astros print(json.dumps(briefing, indent=2))
import asyncio, httpx URLS = [ 'https://terminalfeed.io/api/btc-price', 'https://terminalfeed.io/api/fear-greed', 'https://terminalfeed.io/api/earthquake', 'https://terminalfeed.io/api/hackernews', ] async def fetch(client, url): r = await client.get(url, timeout=8) return r.json() async def main(): async with httpx.AsyncClient() as c: return await asyncio.gather(*(fetch(c, u) for u in URLS)) results = asyncio.run(main())
import cron from 'node-cron'; cron.schedule('*/5 * * * *', async () => { const r = await fetch('https://terminalfeed.io/api/briefing'); const j = await r.json(); await store('briefing:' + Date.now(), j); });
{
"mcpServers": {
"terminalfeed": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://terminalfeed.io/api/mcp"]
}
}
}
{
"mcpServers": {
"terminalfeed": {
"command": "npx",
"args": [
"-y", "mcp-remote", "https://terminalfeed.io/api/mcp",
"--header", "Authorization: Bearer tf_live_<your_token>"
]
}
}
}
curl https://terminalfeed.io/api/pro/agent-context \
-H "Authorization: Bearer tf_live_<your_token>" | jq
import requests, time from datetime import datetime, timezone last = datetime.now(timezone.utc).isoformat() while True: r = requests.get( 'https://terminalfeed.io/api/pro/world-deltas', params={'since': last}, headers={'Authorization': 'Bearer tf_live_<your_token>'}, ) events = r.json().get('events', []) for e in events: handle(e) last = datetime.now(timezone.utc).isoformat() time.sleep(60)
curl https://terminalfeed.io/api/payment/info | jq
curl -X POST https://terminalfeed.io/api/payment/buy-credits \ -H "Content-Type: application/json" \ -d '{ "tx_hash": "0xabc123...", "amount_usdc": "10.00" }'
curl https://terminalfeed.io/api/payment/balance \
-H "Authorization: Bearer tf_live_<your_token>" | jq