Developer

Bebex API

Free, public REST APIs for accessing real-time prices, supported trading pairs, and on-chain swap quotes on Ethereum mainnet.

No authentication requiredEthereum Mainnet · Decentralized

Overview

Base URL

https://bebex.io/api/v1

Authentication

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

GET/api/v1/pairs

Returns 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
}
GET/api/v1/ticker

Returns 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

ParamTypeRequiredDescription
symbolsstringoptionalComma-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

HeaderValues
X-CacheHIT · MISS · STALE
GET/api/v1/quote

Returns 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.

Note: This is a read-only simulation — no transaction is sent and no gas is spent. The quote reflects the current on-chain pool state and may vary slightly at execution time.

Query Parameters

ParamTypeRequiredDescription
tokenInstringrequiredInput token symbol, e.g. ETH, LINK, UNI
tokenOutstringrequiredOutput token symbol, e.g. USDT, ETH
amountInstringrequiredHuman-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.

BTC
ETH
SHIB
LINK
PEPE
UNI
AAVE
MKR
MATIC
LDO
CRV
SNX
ENS
COMP
GRT
SUSHI
BAL
1INCH
YFI
RPL

Error Codes

HTTP StatusMeaning
200Success — data returned
400Bad request — missing or invalid parameters
404Not found — no pool exists for the requested token pair
503Service 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 →