Skip to main content

API Routes

All API routes follow the convention /api/[protocol]/[action]. All routes return { success: true, data } on success or { success: false, error } on failure.

Authentication: Routes marked ⚠️ are unauthenticated and forward requests under your server-side API key — anyone can use them. These are known security gaps. See Internal: Security Findings.


1inch

RouteMethodAuthDescription
/api/1inch/gasGETCurrent gas prices
/api/1inch/eth_rpcPOSTRPC proxy (14 read-only methods allowlisted)
/api/1inch/swap/classic/quotePOST⚠️Get classic swap quote
/api/1inch/charts/candleGET⚠️Candlestick OHLCV chart data
/api/1inch/charts/lineGET⚠️Line chart data
/api/1inch/tokens/searchGET⚠️Search tokens by symbol/name
/api/1inch/orderbook/limit/createPOST⚠️Create limit order
/api/1inch/orderbook/limit/submitPOST⚠️Submit limit order

LiFi

RouteMethodAuthDescription
/api/lifi/routesGETRate-limited onlyGet bridge routes
/api/lifi/step-transactionPOSTPrepare step transaction
/api/lifi/statusGETCheck bridge status
/api/lifi/test-keyGETValidate LiFi API key

Wormhole

RouteMethodAuthDescription
/api/wormhole/quotePOSTDiscover routes via Wormhole SDK
/api/wormhole/bridgePOSTBuild ordered tx list

Stargate

RouteMethodAuthDescription
/api/stargate/quotePOSTGet bridge quote with approve + bridge steps

CoinPaprika

RouteMethodAuthDescription
/api/coinpaprika/ticker/[id]GETNonePrice and market data for a coin
/api/coinpaprika/ohlcv/[id]GETNoneHistorical OHLCV chart data

Parameters for OHLCV: interval (1h, 24h, 7d, 14d, 30d, 90d, 365d), limit (1-366), start, end, quote (usd, btc).


Faucet

RouteMethodAuthDescription
/api/faucet/requestPOSTNone (rate-limited by DB)Request testnet tokens
/api/faucet/statusGETNoneCheck request status
/api/faucet/historyGETNoneView request history
/api/faucet/configGETNone (public)Get faucet configuration

Faucet request body:

{
"network": "sepolia | holesky | optimism-sepolia",
"address": "0x..."
}

Analytics

RouteMethodAuthDescription
/api/analytics/user-historyGET⚠️ NonePaginated transaction history
/api/analytics/protocol-volumeGET⚠️ NoneVolume data by protocol/chain/date
/api/analytics/global-statsGET⚠️ NonePlatform-wide metrics

Security note: Analytics endpoints currently skip authentication. They expose wallet transaction history to anyone. See Internal: Security Findings.

User history parameters: walletAddress (required), protocol, chainId, txType (swap|bridge), limit (max 100), offset.

Protocol volume parameters: protocol, chainId, startDate (ISO), endDate (ISO).


Response Envelope

All routes use the same envelope:

// Success
{ success: true, data: T }

// Error
{ success: false, error: string }

HTTP status codes:

  • 200 — success
  • 400 — bad request (missing/invalid parameters)
  • 401 — unauthorized (missing or invalid x-api-key header)
  • 403 — forbidden (e.g., blocked RPC method)
  • 429 — rate limited
  • 500 — server error

Adding New Routes

See Guides: Add an API Route for the route authoring guide.