Fomo trader data in Python: a five-minute quickstart
Fetch the fomo leaderboard, look up a trader and resolve a wallet from Python with requests, then read credits from the response headers.
This quickstart takes you from an API key to three working calls in Python: the leaderboard, a trader lookup and a wallet lookup. You need Python 3.9+ and requests.
pip install requests
export API_KEY="your key"
1. A session with your key
import os
import requests
API = "https://provadata.com"
session = requests.Session()
session.headers["Authorization"] = f"Bearer {os.environ['API_KEY']}"
session.headers["User-Agent"] = "my-app/1.0"
A session reuses the connection, which matters when you make many calls.
2. The leaderboard
r = session.get(f"{API}/v2/leaderboard/24h", params={"limit": 10}, timeout=20)
r.raise_for_status()
board = r.json()
for t in board["traders"]:
pnl = t["pnlUsd"]
pnl_text = "unknown" if pnl is None else f"${pnl:,.0f}"
mark = "verified" if t["walletsVerified"] else "unverified"
print(f'{t["rank"]:>3} @{t["handle"]:<20} {pnl_text:>12} {mark}')
Note the None check: a PnL we do not know is null, never zero.
3. One trader, handling 202
A trader we have not seen before returns 202 while we check their wallets. Retry after the suggested delay:
import time
def get_trader(handle, attempts=4):
for _ in range(attempts):
r = session.get(f"{API}/v2/users/{handle}", timeout=30)
if r.status_code == 202:
time.sleep(r.json().get("retryAfterSeconds", 15))
continue
if r.status_code == 404:
return None
r.raise_for_status()
return r.json()
return None # still pending; try again later
trader = get_trader("halvard")
if trader:
for w in trader["walletList"]:
print(w["chain"], w["address"], w["status"])
4. Who owns a wallet
r = session.get(f"{API}/v2/wallets/7xKq…9fQe", timeout=20)
if r.status_code == 404:
print("no known trader")
else:
r.raise_for_status()
owner = r.json()
print(owner["trader"]["handle"], owner["status"])
5. Watch your credits
Every response tells you what it cost and what is left:
print(r.headers["x-credits-cost"], r.headers["x-credits-remaining"])
A leaderboard is 100 credits, a trader or wallet 500. The 202s and 404s above cost nothing. The free plan’s 25,000 credits cover 250 leaderboard calls a month.