DEV Community

Cover image for What Is the Fomo API? A Guide to Programmatic Access
Voren Tai
Voren Tai

Posted on

What Is the Fomo API? A Guide to Programmatic Access

What Is the Fomo API? A Guide to Programmatic Access

The Fomo API is a developer-focused REST API that provides structured access to Fomo Family social and on-chain trading data. It enables applications to retrieve trader profiles, verified wallet addresses, leaderboards, balances, holdings, PnL, swap history, and social activity through consistent JSON responses.

Fomo API can be used to build:

  • Trading dashboards
  • Wallet and portfolio trackers
  • Smart-money alerts
  • Telegram trading bots
  • Copy-trading research tools
  • AI trading agents
  • Automated portfolio analytics

Fomo API is an independent developer service. It is not an official Fomo Family product and does not provide financial advice.

How to Access the API Programmatically

1. Create an API Key

Register at getfomoapi.fun using Google authentication. After signing in, open the dashboard and generate an API key.

API keys use the following format:

fomo_live_YOUR_API_KEY
Enter fullscreen mode Exit fullscreen mode

Keep your API key private and do not expose it in browser-side code or public repositories.

2. Authenticate Requests

Requests must include the API key in either the X-API-Key header or the Authorization header.

curl "https://getfomoapi.fun/api/leaderboard/24h?limit=5" \
  -H "X-API-Key: fomo_live_YOUR_API_KEY"
Enter fullscreen mode Exit fullscreen mode

Bearer authentication is also supported:

curl "https://getfomoapi.fun/api/leaderboard/24h?limit=5" \
  -H "Authorization: Bearer fomo_live_YOUR_API_KEY"
Enter fullscreen mode Exit fullscreen mode

3. Retrieve Trading Data

For example, the following Python code retrieves the 24-hour leaderboard:

import os
import requests

api_key = os.environ["FOMO_API_KEY"]

response = requests.get(
    "https://getfomoapi.fun/api/leaderboard/24h",
    headers={"X-API-Key": api_key},
    params={"limit": 5},
    timeout=30,
)

response.raise_for_status()
data = response.json()

print(data)
Enter fullscreen mode Exit fullscreen mode

4. Resolve a Trader

Trader handles can be resolved into user profiles and wallet addresses:

import os
import requests

handle = "starcatcher444"

response = requests.get(
    f"https://getfomoapi.fun/api/users/{handle}",
    headers={"X-API-Key": os.environ["FOMO_API_KEY"]},
    timeout=30,
)

response.raise_for_status()
trader = response.json()["responseObject"]

print("User ID:", trader.get("id"))
print("Solana wallet:", trader.get("solana"))
print("EVM wallet:", trader.get("evm"))
Enter fullscreen mode Exit fullscreen mode

5. Retrieve Swap History

Once a trader’s user ID is available, applications can request normalized swap activity:

response = requests.get(
    "https://getfomoapi.fun/api/users/USER_ID/swaps",
    headers={"X-API-Key": os.environ["FOMO_API_KEY"]},
    params={"limit": 10},
    timeout=30,
)

response.raise_for_status()
swaps = response.json()

print(swaps)
Enter fullscreen mode Exit fullscreen mode

Available API Resources

The primary Pro endpoints include:

Endpoint Purpose
/api/leaderboard/{window} Retrieve ranked traders
/api/users/{handle} Resolve a trader profile
/api/users/{userId}/balances Retrieve balances and positions
/api/users/{userId}/spotlight Retrieve notable trades and comments
/api/users/{userId}/swaps Retrieve paginated swap history
/api/users/{userId}/leaderboard Retrieve trader rankings
/api/user-tokens/aggregated-snapshot Retrieve historical PnL and equity

Supported leaderboard windows include 24h, 7d, 30d, and all.

Rate Limits and Responsible Use

Pro API keys are limited to five requests per second. When the limit is exceeded, the API returns an HTTP 429 response. Applications should respect the Retry-After header before retrying.

Developers should also:

  • Store API keys securely
  • Validate data before making trading decisions
  • Handle network and upstream errors
  • Avoid abusive scraping
  • Account for delayed or incomplete market data

Resources

With an API key and standard HTTP requests, developers can integrate Fomo trading and social data into applications, analytics platforms, bots, and automated workflows.

Top comments (0)