Appearance
Pricing
Pay-as-you-go. No subscriptions, no API keys. Pay only for what you use.
Payment Protocols
4SEC supports two payment protocols:
| Protocol | Blockchain | Token | Discovery |
|---|---|---|---|
| x402 v2 | Base (Coinbase) | USDC on Base | x402scan.com |
| MPP | Tempo (Stripe) | USDC on Tempo | mppscan.com |
Both protocols are supported automatically — your client library handles the negotiation.
Endpoint Pricing
DEX Endpoints
| Endpoint | Price (USDC) | Description |
|---|---|---|
GET /price/:symbol | 0.01 | Real-time aggregated price from 8+ DEXes |
GET /price/history/:symbol | 0.02 | Historical OHLCV candlestick data |
GET /volume/:symbol | 0.02 | 24h trading volume across all DEXes |
GET /spread/:pair | 0.02 | Bid/ask spread analysis |
GET /arbitrage-opportunity | 0.05 | Cross-DEX arbitrage scanner |
GET /volatility-index/:symbol | 0.03 | Risk metrics: VaR, Sharpe, volatility |
POST /price-alert | 0.04 | Create webhook price alert |
POST /price-alert/:id/extend | 0.02 | Extend price alert duration |
Funding Rate Endpoints
| Endpoint | Price (USDC) | Description |
|---|---|---|
GET /funding-rate/:symbol | 0.02 | Current perpetual funding rate with signal |
GET /funding-rate/history/:symbol | 0.03 | Historical funding rate data |
GET /funding-rate/extreme | 0.02 | Extreme funding rates scanner across markets |
Liquidation Endpoints
| Endpoint | Price (USDC) | Description |
|---|---|---|
GET /liquidation/heatmap/:symbol | 0.05 | Liquidation heatmap with cascade risk levels |
GET /liquidation/recent | 0.03 | Recent liquidations with long/short breakdown |
POST /liquidation/alert | 0.06 | Create liquidation cascade alert webhook |
POST /liquidation/alert/:id/extend | 0.03 | Extend liquidation alert duration |
Futures Analytics
| Endpoint | Price (USDC) | Description |
|---|---|---|
GET /futures/funding-compare/:symbol | 0.03 | Cross-exchange funding rate comparison |
GET /futures/open-interest/:symbol | 0.03 | Aggregated open interest across 3 exchanges |
GET /futures/long-short/:symbol | 0.02 | Top traders long/short ratio |
GET /futures/basis/:symbol | 0.02 | Spot vs perpetual basis (carry-trade signal) |
GET /futures/predicted-funding/:symbol | 0.02 | Predicted next funding rate |
CEX Market Data (v1)
| Endpoint | Price (USDC) | Description |
|---|---|---|
GET /api/v1/prices | 0.005 | Batch CEX prices (e.g. ?symbols=btc,eth,sol) |
GET /api/v1/market/:id | 0.005 | Market details by CoinGecko ID |
GET /api/v1/market/:id/history | 0.01 | Historical market data from CEX sources |
Free Endpoints
| Endpoint | Description |
|---|---|
GET /health | Health check |
GET /api/v1/status | Detailed system status |
GET /price-alert/:id | Check price alert status |
DELETE /price-alert/:id | Cancel a price alert |
GET /price-alerts | List all active price alerts |
GET /liquidation/alerts | List all active liquidation alerts |
GET /liquidation/alert/:id | Check liquidation alert status |
DELETE /liquidation/alert/:id | Cancel a liquidation alert |
GET / | API info and available endpoints |
GET /openapi.json | OpenAPI specification |
GET /.well-known/x402.json | x402 payment discovery |
GET /metrics | Transaction metrics |
Free Cache Window
Same request within 30 seconds returns cached data — no charge.
bash
# First request: 0.01 USDC
curl -i https://api.foursec.xyz/price/ETH
# Same request within 30s: FREE (cached)
curl -i https://api.foursec.xyz/price/ETHJavaScript Example (x402)
javascript
import { wrapFetchWithPayments } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";
import { createWalletClient, http } from "viem";
import { base } from "viem/chains";
const account = privateKeyToAccount("0x_YOUR_KEY");
const walletClient = createWalletClient({
account,
chain: base,
transport: http("https://mainnet.base.org"),
});
const fetchWithPayment = wrapFetchWithPayments(fetch, {
client: walletClient,
});
// Auto-pays 0.01 USDC per unique request
const res = await fetchWithPayment("https://api.foursec.xyz/price/ETH");
const data = await res.json();
console.log("ETH: $" + data.price_usd);Rate Limits
- 500 requests/minute per IP address
- Cached responses (within 30s TTL) do not count toward rate limit
- For higher volume needs, contact: support@foursec.xyz
Payment Details
x402 Protocol (Base USDC)
- Token: USDC on Base (Chain ID 8453)
- Contract:
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 - Protocol: x402 v2
- No API key required — your wallet address is your identity
MPP Protocol (Tempo USDC)
- Token: USDC on Tempo (Stripe's blockchain)
- Protocol: MPP (Machine Payment Protocol)
- Discovery: mppscan.com
- No API key required — compatible with MPP-enabled wallets