REST API
Last updated
Last updated
https://api.benswap.cash/
*If the public RPC node is down, some API endpoints may be temporarily unavailable.
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. USD data are also distorted between May and September in 2022 due to the de-pegging of the previous de facto stable coin: flexUSD.
Latest BCH price.
GET /api/bch/price
Some history prices in the past 7 days
GET /api/bch/historyPrices
Latest SBCH Price.
GET /api/smartbch/price
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}
SEP-20 token basic information (id is token contract address). Works for all SEP-20 tokens.
GET /api/sep20/tokenbasics/{id}
GET /api/sep20/tokenbasics?id={id}
SEP-20 token information (id is token contract address). The token has to be already registered in the /assets folder of BenSwap assets repository.
GET /api/sep20/token/{id}
GET /api/sep20/token?id={id}
SEP-20 token liquidity detail across multiple DEXes. Works for all SEP-20 tokens.
GET /api/sep20/liquidity/{id}
GET /api/sep20/liquidity?id={id}
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 (per USD).
GET /api/eben/priceUsd
Current EBEN price (per SBCH).
GET /api/eben/priceSbch
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}
Get lottery ticket data by its NFT ID.
GET /api/lotteryTicket/{id}
GET /api/lotteryTicket?id={id}
Get a PokéBen's metadata by PokéBen ID.
GET /api/pokeben/data/{id}
GET /api/pokeben/data?id={id}
Get a PokéBen item's metadata by Item ID.
GET /api/pokeben/item/{id}
GET /api/pokeben/item?id={id}
Current total number of PokéBen.
GET /api/pokeben/supply
Current total number of PokéBen items.
GET /api/pokeben/itemSupply
Top PokéBens ranking by power. 20 items per page.
GET /api/pokeben/ranking/power/{page}
GET /api/pokeben/ranking/power?page={page}
Top PokéBens ranking by level. 20 items per page.
GET /api/pokeben/ranking/level/{page}
GET /api/pokeben/ranking/level?page={page}
Current information of all bridged tokens.
GET /api/bridge
Unix timestamp (milliseconds) of server time
GET /api/time