# 拿 5 個成交量最大的台股
curl -H "X-API-Key: YOUR_API_KEY" \
https://taiwan-data-api.harvey3630.workers.dev/api/v1/stock | jq '.data.records[0:5]'
# 反查台北 101 在哪一行政區
curl -H "X-API-Key: YOUR_API_KEY" \
"https://taiwan-data-api.harvey3630.workers.dev/api/v1/address?lat=25.033964&lon=121.565418"
import requests
API_KEY = "YOUR_API_KEY"
BASE = "https://taiwan-data-api.harvey3630.workers.dev"
headers = {"X-API-Key": API_KEY}
# 拿台北市實價登錄
r = requests.get(f"{BASE}/api/v1/realestate", params={"county": "臺北市"}, headers=headers)
data = r.json()["data"]
print(f"{data['count']} 筆,第一筆:{data['records'][0]}")
const API_KEY = 'YOUR_API_KEY';
const BASE = 'https://taiwan-data-api.harvey3630.workers.dev';
// 拿三大法人買賣超
const r = await fetch(`${BASE}/api/v1/institutional`, {
headers: { 'X-API-Key': API_KEY }
});
const { data } = await r.json();
console.log(`${data.total_records} 個股法人籌碼,日期 ${data.date}`);