API

URL

https://api.benswap.cash/

List of all public API endpoints

*All RPC related API endpoints use UAT's global node as default data source, which could be temporarily unavailable if the UAT global node is down.

BCH

Latest BCH price.
GET /api/bch/price

SmartBCH

General Info.
GET /api/smartbch/info
Latest block height.
GET /api/smartbch/block
Closest block height at Unix timestamp (seconds).
GET /api/smartbch/block/{timestamp}
GET /api/smartbch/block?timestamp={timestamp}
Unix timestamp (seconds) of the latest block.
GET /api/smartbch/timestamp
Unix timestamp (seconds) at specific block.
GET /api/smartbch/timestamp/{block}
GET /api/smartbch/timestamp?block={block}
RPC nodes.
GET /api/smartbch/rpc
Check RPC node by name.
GET /api/smartbch/rpc/{name}
GET /api/smartbch/rpc?name={name}
Health of RPC nodes. Returns "healthy" if all nodes are responsive and have similar blocks.
GET /api/smartbch/rpc_health

SEP20

SEP-20 token information (id is token contract address). Token has to be in the BenSwap asset repository.
GET /api/sep20/token/{id}
GET /api/sep20/token?id={id}

EBEN

Current supply summary.
GET /api/eben/supply
Current total supply.
GET /api/eben/total
Current total burned.
GET /api/eben/burned
Current circulating supply.
GET /api/eben/circulating
Current staked info in major LPs, pools, and DeFi contracts etc.
GET /api/eben/staked
Current EBEN price (USD).
GET /api/eben/priceUsd
Current EBEN price (BCH).
GET /api/eben/priceBch

DEX

Warning: USD based data are missing before block 820000. Statistics like "totalVolumeUsd", "volumeUsd" only include volume after block 820000, and statistics like "priceUsd", "liquidityUsd" will be 0 if you use a block number less than 820000.
DEX stats.
GET /api/dex/stats
DEX stats at specific block.
GET /api/dex/stats/{block}
GET /api/dex/stats?block={block}
Pairs that have enough liquidity.
GET /api/dex/pairs
Single pair data (id is LP address). Must have enough liquidity on DEX.
GET /api/dex/pair/{id}
GET /api/dex/pair?id={id}
Single pair at specific block (id is LP address).
GET /api/dex/pair/{id}/{block}
GET /api/dex/pair?id={id}&block={block}
Tokens that have enough liquidity.
GET /api/dex/tokens
Single token data (id is token address). Must have enough liquidity on DEX.
GET /api/dex/token/{id}
GET /api/dex/token?id={id}
Single token at specific block (id is token address).
GET /api/dex/token/{id}/{block}
GET /api/dex/token?id={id}&block={block}
Latest candlestick trading data for a token (id is token address). "baseCurrency" has to be either "bch" or "usd". "range" has to be one of these ["1min", "15mins", "1h", "1d", "1w"]. Maximum return is 1000 records.
GET /api/dex/trade/{baseCurrency}/{range}/{id}
GET /api/dex/trade/{baseCurrency}/{range}?id={id}
Same as above, but with specific ending time (not inclusive) to get earlier records. "before" has to be a valid Unix timestamp (seconds).
GET /api/dex/trade/{baseCurrency}/{range}/{id}/{before}
GET /api/dex/trade/{baseCurrency}/{range}?id={id}&before={before}

Farms & Pools

IBO

Lottery

BenLock

SEP-20 Factory

Ranches

IBOv2

Governance

Others

Unix timestamp (milliseconds) of server time
GET /api/time