Bebex API
Free, public REST APIs for accessing real-time prices, supported trading pairs, and on-chain swap quotes on Ethereum mainnet.
Overview
Base URL
https://bebex.io/api/v1Authentication
None — fully public
Rate Limit
60 requests / minute per IP
Response Format
JSON · UTF-8
CORS
Enabled for all origins
Cache
Ticker: 60 s · Pairs: static · Quote: live
/api/v1/pairsReturns the full list of 20 supported spot trading pairs, their ERC-20 contract addresses, decimals, and protocol metadata.
Request
curl "https://bebex.io/api/v1/pairs"JavaScript
const res = await fetch("https://bebex.io/api/v1/pairs");
const { pairs } = await res.json();
pairs.forEach(pair => {
console.log(pair.symbol, pair.address, pair.decimals);
});Response
{
"pairs": [
{
"symbol": "BTC",
"name": "Wrapped Bitcoin",
"address": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
"decimals": 8,
"pairLabel": "BTC/USDT",
"rank": 1
},
{
"symbol": "ETH",
"name": "Ethereum",
"address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"decimals": 18,
"pairLabel": "ETH/USDT",
"rank": 2
}
// ... 18 more
],
"quote_currency": "USDT",
"quote_address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"network": "ethereum",
"chain_id": 1
}/api/v1/tickerReturns live price data for one or more tokens. Data is sourced from CoinMarketCap (primary) with CoinGecko as fallback. Responses are cached for 60 seconds.
Query Parameters
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | string | optional | Comma-separated token symbols. Omit to get all 20. Example: BTC,ETH,LINK |
Request — all pairs
curl "https://bebex.io/api/v1/ticker"Request — specific symbols
curl "https://bebex.io/api/v1/ticker?symbols=BTC,ETH,LINK"JavaScript
const res = await fetch("https://bebex.io/api/v1/ticker?symbols=ETH,LINK");
const tickers = await res.json();
tickers.forEach(t => {
const dir = t.change24hPct >= 0 ? "▲" : "▼";
console.log(`${t.symbol}: $${t.price.toFixed(2)} ${dir}${Math.abs(t.change24hPct).toFixed(2)}%`);
});Response
[
{
"symbol": "ETH",
"name": "Ethereum",
"price": 3456.78,
"change24hPct": 1.23,
"marketCap": 415000000000,
"timestamp": 1711234567890
},
{
"symbol": "LINK",
"name": "Chainlink",
"price": 14.52,
"change24hPct": -0.87,
"marketCap": 8500000000,
"timestamp": 1711234567890
}
]Response Headers
| Header | Values |
|---|---|
| X-Cache | HIT · MISS · STALE |
/api/v1/quoteReturns a live on-chain swap quote from decentralized liquidity pool contracts on Ethereum mainnet. The API automatically tries all fee tiers (0.05%, 0.3%, 1%) and returns the best available quote.
Query Parameters
| Param | Type | Required | Description |
|---|---|---|---|
| tokenIn | string | required | Input token symbol, e.g. ETH, LINK, UNI |
| tokenOut | string | required | Output token symbol, e.g. USDT, ETH |
| amountIn | string | required | Human-readable input amount, e.g. 1.5 or 0.001 |
Request — sell 1 ETH for USDT
curl "https://bebex.io/api/v1/quote?tokenIn=ETH&tokenOut=USDT&amountIn=1"Request — buy LINK with USDT
curl "https://bebex.io/api/v1/quote?tokenIn=USDT&tokenOut=LINK&amountIn=100"JavaScript
const params = new URLSearchParams({
tokenIn: "ETH",
tokenOut: "USDT",
amountIn: "1",
});
const res = await fetch(`https://bebex.io/api/v1/quote?${params}`);
const quote = await res.json();
if (res.ok) {
console.log(`1 ETH ≈ ${Number(quote.amountOut).toLocaleString()} USDT`);
console.log(`Fee tier: ${quote.feeTierPct}`);
} else {
console.error(quote.error);
}Response
{
"tokenIn": "ETH",
"tokenOut": "USDT",
"amountIn": "1",
"amountOut": "3456.781234",
"feeTier": 500,
"feeTierPct": "0.05%",
"network": "ethereum"
}Error Response
{
"error": "No liquidity pool found for this pair across 0.05%, 0.3%, and 1% fee tiers"
}Supported Tokens
All endpoints accept the following token symbols. Each token is traded against USDT.
BTCETHSHIBLINKPEPEUNIAAVEMKRMATICLDOCRVSNXENSCOMPGRTSUSHIBAL1INCHYFIRPLError Codes
| HTTP Status | Meaning |
|---|---|
| 200 | Success — data returned |
| 400 | Bad request — missing or invalid parameters |
| 404 | Not found — no pool exists for the requested token pair |
| 503 | Service unavailable — upstream market data temporarily unavailable |
Ready to trade on-chain?
Use the Bebex Spot DEX to execute real swaps directly from your wallet.
Open Spot Trading →