Skip to content

API Reference Overview

Base URL: https://api.foursec.xyz

All paid endpoints require payment via x402 (Base USDC) or MPP (Tempo USDC). See Authentication and Payment.

Endpoints

DEX Endpoints

MethodPathCostDescription
GET/price/:symbol$0.01Real-time aggregated price from 8+ DEXes
GET/price/history/:symbol$0.02Historical OHLCV candlestick data
GET/volume/:symbol$0.0224h trading volume across all DEXes
GET/spread/:pair$0.02Bid/ask spread analysis
GET/arbitrage-opportunity$0.05Cross-DEX arbitrage scanner
GET/volatility-index/:symbol$0.03Risk metrics: VaR, Sharpe, volatility
POST/price-alert$0.04Create webhook price alert
POST/price-alert/:id/extend$0.02Extend price alert duration

Funding Rate Endpoints

MethodPathCostDescription
GET/funding-rate/:symbol$0.02Current perpetual funding rate with signal
GET/funding-rate/history/:symbol$0.03Historical funding rate data
GET/funding-rate/extreme$0.02Extreme funding rates scanner across markets

Liquidation Endpoints

MethodPathCostDescription
GET/liquidation/heatmap/:symbol$0.05Liquidation heatmap with cascade risk levels
GET/liquidation/recent$0.03Recent liquidations with long/short breakdown
POST/liquidation/alert$0.06Create liquidation cascade alert webhook
POST/liquidation/alert/:id/extend$0.03Extend liquidation alert duration

Futures Analytics

MethodPathCostDescription
GET/futures/funding-compare/:symbol$0.03Cross-exchange funding rate comparison
GET/futures/open-interest/:symbol$0.03Aggregated open interest (Binance, OKX, Bybit)
GET/futures/long-short/:symbol$0.02Top traders long/short ratio
GET/futures/basis/:symbol$0.02Spot vs perpetual basis (carry-trade signal)
GET/futures/predicted-funding/:symbol$0.02Predicted next funding rate

CEX Market Data (v1)

MethodPathCostDescription
GET/api/v1/prices$0.005Batch CEX prices via CCXT multi-exchange (e.g. ?symbols=btc,eth,sol)
GET/api/v1/market/:id$0.005Market details by CoinGecko ID (e.g. bitcoin)
GET/api/v1/market/:id/history$0.01Historical market data from CEX sources

Free Endpoints

MethodPathDescription
GET/healthHealth check
GET/api/v1/statusDetailed system status
GET/price-alert/:idCheck price alert status by ID
DELETE/price-alert/:idCancel a price alert
GET/price-alertsList all active price alerts
GET/liquidation/alertsList all active liquidation alerts
GET/liquidation/alert/:idCheck liquidation alert status
DELETE/liquidation/alert/:idCancel a liquidation alert
GET/API info and endpoint list
GET/openapi.jsonOpenAPI specification
GET/.well-known/x402.jsonx402 payment discovery
GET/.well-known/mcp.jsonMCP server manifest
POST/mcpMCP JSON-RPC 2.0 endpoint
GET/agent.jsonAI agent card
GET/llms.txtLLM-readable documentation
GET/metricsAPI transaction metrics

Supported Symbols

DEX Symbols (EVM tokens)

Any token actively traded on supported DEXes. Common examples: ETH, BTC, SOL, LINK, UNI, AAVE, ARB, PEPE, USDC.

Symbols are uppercase for DEX endpoints.

CEX Symbols

Use lowercase CoinGecko IDs for /api/v1/market/:id (e.g. bitcoin, ethereum, solana).

Use comma-separated symbols for /api/v1/prices?symbols=btc,eth,sol.

Response Format

All responses are JSON:

json
{
  "success": true,
  "data": {
    "symbol": "ETH",
    "price_usd": 1743.34,
    "price_change_24h": -0.837,
    "volume_24h_usd": 187882.21,
    "liquidity_usd": 45000000,
    "dex_count": 3,
    "sources": {
      "uniswap_v3": 1743.30,
      "sushiswap": 1743.38
    },
    "last_updated": "2026-07-08T12:09:30Z"
  }
}

Error responses:

json
{
  "error": "symbol_not_found",
  "message": "No DEX price data for \"DOGE\"",
  "hint": "Try: ETH, BTC, SOL, LINK, UNI, AAVE"
}

Caching

  • 30-second cache TTL on all paid endpoints
  • Identical requests within 30s are free (no payment, no rate limit count)
  • Cache key = endpoint + query params (not wallet-specific)
  • Cache headers: X-Cache: HIT or X-Cache: MISS

Rate Limits

  • 500 requests/minute per IP address
  • Cached responses do not count toward rate limit
  • Rate limit headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset

Built with x402 protocol on Base