Public REST API

All endpoints return JSON. Base URL: cpu-mining.info

Endpoints

MethodPathDescriptionTry
GET/api/overviewAggregate summary of all tracked coins, pools, exchanges and market data.→ open
GET/api/coinsList all tracked coins with consensus price and total volume.→ open
GET/api/coins/search?q=...Search coins by symbol or name (max 10 results, used by header autocomplete).→ ?q=bit
GET/api/coins/{symbol}Coin detail with pools and market pairs.→ BTC
GET/api/coins/{symbol}/poolsPools mining a given coin.→ BTC pools
GET/api/coins/{symbol}/hashrateHashrate breakdown by pool for a given coin.→ BTC hashrate
GET/api/poolsAll pools with latest stat snapshot.→ open
GET/api/exchangesAll exchanges with reputation and pairs.→ open

Example Response — /api/overview

{
  "data": {
    "summary": {
      "coins_count": 5,
      "pools_count": 5,
      "exchanges_count": 4,
      "market_pairs_count": 14,
      "total_network_hashrate": 6.5e20,
      "total_pool_hashrate": 2.7e20,
      "total_workers": 412000,
      "total_volume_24h": 5123456789.0
    },
    "coins": [ ... ],
    "pools": [ ... ],
    "consensus_prices": {
      "BTC": { "price": 67510.5, "total_volume": 4200000000, "exchanges": 4 },
      ...
    },
    "exchanges": [ ... ],
    "top_movers": [ ... ],
    "generated_at": "2024-01-01T00:00:00Z"
  }
}

Authentication

This MVP exposes all endpoints publicly. The original Node.js project adds admin endpoints behind JWT authentication. Adding the same is straightforward via a middleware wrapper around Router::dispatch().

CLI Workers

Run the polling workers manually or via cron:

php scripts/poll_pools.php        # polls all pool APIs, saves pool_stats rows
php scripts/poll_exchanges.php    # polls all exchange APIs, upserts market_pairs
php scripts/migrate.php --seed    # reset and re-seed the SQLite DB