API Reference Overview
Base URL: https://api.foursec.xyz
All paid endpoints use the x402 protocol. See Authentication.
Endpoints
| Method | Path | Cost | Description |
|---|---|---|---|
| GET | /price/:symbol | $0.01 | Real-time aggregated price |
| GET | /price/history/:symbol | $0.02 | Historical OHLCV data |
| GET | /volume/:symbol | $0.01 | 24h volume data |
| GET | /spread/:pair | $0.01 | Bid/ask spread analysis |
| GET | /arbitrage-opportunity | $0.03 | Cross-DEX arbitrage scanner |
| GET | /volatility-index/:symbol | $0.02 | Risk metrics and volatility |
| POST | /price-alert | $0.05 | Create webhook alert |
| GET | /health | Free | Health check |
| GET | / | Free | API info and endpoint list |
Supported Symbols
BTC, ETH, SOL, ARB, OP, MATIC, AVAX, DOT, LINK, UNI
Response Format
All responses are JSON:
{
"symbol": "ETH",
"price_usd": 2450.32,
"timestamp": "2026-07-04T15:30:00Z"
}
Error responses:
{
"error": "symbol_not_found",
"message": "Symbol XYZ is not supported"
}
Caching
- 30-second cache TTL on all paid endpoints
- Identical requests within 30s are free (no payment, no rate limit count)
- Cache headers:
X-Cache: HITorX-Cache: MISS
Rate Limits
- 100 requests/minute per wallet (standard)
- 1000 requests/minute (premium)
- Headers:
X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset