API Documentation

Build bots, dashboards, and integrations with the Toporio API. Base URL: https://toporio.com/api

Authentication

Most read endpoints are public. Trading requires a Bearer token from login, or an API key.

POST /api/auth/register

Create a new account. Returns access token.

{"email": "you@example.com", "username": "trader1", "password": "min8chars"}
POST /api/auth/login

Login with email/username + password.

{"identifier": "trader1", "password": "yourpassword"}

Market Data (Public)

GET /api/market

List all tradable people. Supports filtering and sorting.

?category=music — filter by category (music, sports, entertainment, gaming, politics, tech)
?subcategory=k-pop — filter by subcategory
?country=US — filter by country code
?search=musk — search by name or ticker
?limit=100 — max results (default 100)
GET /api/market/{ticker}

Get full details for a person: price, change, metrics, social links.

GET /api/market/MUSK
GET /api/market/{ticker}/chart

Get OHLCV candle data for charts.

?timeframe=1h — 1h, 4h, or 1d
GET /api/market/gainers

Top 10 gainers by 24h price change.

GET /api/market/losers

Top 10 losers by 24h price change.

GET /api/market/person-of-day

Today's biggest mover. Cached for 1 hour.

GET /api/market/bulk

Get prices for multiple tickers in one request (max 50).

?tickers=MUSK,SWIFT,TRUMP — comma-separated tickers
GET /api/market/compare

Compare two people side by side.

?a=MUSK&b=TRUMP — compare Elon Musk vs Donald Trump
GET /api/market/categories

Category breakdown: count, avg price, total market cap per category.

GET /api/stats

Platform statistics: people count, users, trades, countries, total market cap.

GET /api/rss

RSS feed of announcements. Subscribe in your RSS reader.

GET /api/announcements

Latest news and announcements.

Trading (Authenticated)

Include Authorization: Bearer YOUR_TOKEN header.

POST /api/trade/buy

Market buy order.

{"ticker": "MUSK", "quantity": 10}
POST /api/trade/sell

Market sell order.

{"ticker": "MUSK", "quantity": 5}
POST /api/orders

Create limit/stop-loss/take-profit order.

{"ticker": "SWIFT", "order_type": "limit", "side": "buy", "quantity": 10, "price": 450.00}
GET /api/portfolio

Your current holdings, P&L, and portfolio value.

Quick Start

Python Example

import requests

# Get market data
r = requests.get("https://toporio.com/api/market?category=music&limit=5")
for person in r.json():
    print(f"{person['ticker']}: ${person['current_price']:.2f} ({person['change_24h']:+.1f}%)")

# Login
auth = requests.post("https://toporio.com/api/auth/login",
    json={"identifier": "your_username", "password": "your_password"})
token = auth.json()["access_token"]

# Buy
buy = requests.post("https://toporio.com/api/trade/buy",
    json={"ticker": "MUSK", "quantity": 10},
    headers={"Authorization": f"Bearer {token}"})
print(buy.json())

Rate Limits

Register: 5 requests/hour per IP
Login: 15 requests/15min per IP
Trading: 60 requests/min per IP
General API: 200 requests/min per IP

Exceeded limits return HTTP 429 with Retry-After header.