Real-time
Multi-DEX
Aggregated Prices

Access aggregated prices, funding rates, liquidation data, and risk metrics from 8+ DEXes and major CEXes. Pay per request with USDC on Base (x402) or Tempo (MPP). No subscriptions, no API keys.

LIVE DEMO
GET /price/ETH
{
  "symbol": "ETH",
  "price_usd": 2450.32,
  "change_24h": "+2.45%",
  "sources": 3,
  "spread": "0.07%",
  "volume_24h": "$12.5M"
}
Cost: $0.01 USDCLatency: <100msCache: 30s TTL

Everything you need for crypto data

Multi-DEX Aggregation

Volume-weighted prices from Uniswap, SushiSwap, Curve, BaseSwap, Aerodrome, and 3 more DEXes.

Arbitrage Detection

Real-time cross-DEX arbitrage opportunities with profit calculations and gas estimates.

Risk Metrics

Volatility, VaR, Sharpe ratio, and sentiment analysis for informed trading decisions.

Real-time Data

30-second cache TTL, up to 500 req/min. Fresh data for high-frequency trading.

Funding Rates

Real-time and historical perpetual funding rates. Track extreme rates for trading signals.

Liquidation Tracking

Liquidation heatmaps, recent cascades, and real-time alerts for risk management.

CEX Market Data

Aggregated CEX prices, market details, and historical data from major exchanges.

Historical OHLCV

Candlestick data with 1m, 5m, 1h, 1d intervals. Up to 1 year history.

Price Alerts

Webhook notifications when price hits your target. Perfect for trading bots.

Futures Analytics

Cross-exchange open interest, long/short ratios, basis, and predicted funding from Binance, OKX, and Bybit.

Pay-as-you-go with x402

No subscriptions, no API keys. Pay per request with USDC on Base. Same request within 30s is free (cached).

DEX Endpoints

EndpointPriceDescription
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

EndpointPriceDescription
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

EndpointPriceDescription
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

CEX Market Data (v1)

EndpointPriceDescription
GET /api/v1/prices$0.005Batch CEX prices via Binance/CoinGecko (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

Futures Analytics

EndpointPriceDescription
GET /futures/funding-compare/:symbol$0.03Cross-exchange funding rate comparison (Binance, OKX, Bybit)
GET /futures/open-interest/:symbol$0.03Aggregated open interest across 3 exchanges
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

Free Endpoints

EndpointPriceDescription
GET /healthFREEHealth check
GET /api/v1/statusFREEDetailed system status
GET /price-alert/:idFREECheck price alert status by ID
DELETE /price-alert/:idFREECancel price alert
GET /price-alertsFREEList all active price alerts
GET /liquidation/alertsFREEList all active liquidation alerts
GET /liquidation/alert/:idFREECheck liquidation alert status
DELETE /liquidation/alert/:idFREECancel a liquidation alert
GET /FREEAPI info and available endpoints
GET /openapi.jsonFREEOpenAPI specification
GET /.well-known/x402.jsonFREEx402 payment discovery
💳

USDC on Base

Chain ID 8453

30s Free Cache

Same request = no charge

🔑

No API Key

Just your wallet

Get started in 5 minutes

// Install: npm install @x402/fetch viem

import { wrapFetchWithPayments } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";
import { createWalletClient, http } from "viem";
import { base } from "viem/chains";

// Setup wallet on Base
const account = privateKeyToAccount("0x...");
const walletClient = createWalletClient({
  account,
  chain: base,
  transport: http("https://mainnet.base.org"),
});

// Create payment-enabled fetch
const fetchWithPayment = wrapFetchWithPayments(fetch, {
  client: walletClient,
});

// Make request (auto-payment!)
const res = await fetchWithPayment(
  "https://api.foursec.xyz/price/ETH"
);
const data = await res.json();
console.log(`ETH: $${data.price_usd}`);
# Step 1: Initial request returns 402
curl -i https://api.foursec.xyz/price/ETH

# Response: 402 Payment Required
# X-PAYMENT: {"scheme":"exact-evm",...}

# Step 2: Use x402 CLI for auto-payment
npx x402-cli fetch \
  https://api.foursec.xyz/price/ETH \
  --key 0x_your_private_key

# Step 3: Response with data
# {"symbol":"ETH","price_usd":2450.32,...}
# Install: pip install httpx web3 eth-account

import httpx

# Step 1: Get payment requirements
resp = httpx.get("https://api.foursec.xyz/price/ETH")
# Returns 402 with X-PAYMENT header

payment = resp.headers.get("x-payment")

# Step 2: Sign USDC transfer on Base
# Step 3: Retry with payment proof
# (Use JavaScript SDK for simpler flow)

# Recommended: Use the JavaScript SDK
# which handles everything automatically

How x402 Works

  1. 1

    Request data

    Your app calls the API endpoint

  2. 2

    402 Payment Required

    API returns payment details in X-PAYMENT header

  3. 3

    Sign USDC transfer

    SDK signs payment from your wallet on Base

  4. 4

    Retry with proof

    Client retries request with payment proof

  5. 5

    Data returned

    API verifies payment and returns data. Cost: $0.01

💡 Pro tip: The @x402/fetch SDK handles all payment logic automatically. Just call fetchWithPayment(url) and it works!

Built for performance

37

API Endpoints

8+

DEX Sources

<100ms

Avg Latency

30s

Cache TTL

Ready to get started?

Start using 4SEC API today. No credit card, no signup form. Just connect your wallet and pay as you go.

✓ No API key required

✓ Pay with USDC on Base

✓ 30s free cache window