API Documentation
REST + JSON for pricing, quotes, swaps and transaction lookups on BNB Smart Chain (chain ID 56).https://token.cripchain.com/api/v1- All responses are JSON:
{"success":true,"data":{…}}or{"success":false,"error":{"code":400,"message":"…"}}. - Amounts are human-readable decimal strings (e.g.
"1.5"), never raw wei. Transaction objects carry a hexvalue. - Rate limit: 60 requests per minute per IP (HTTP 429). CORS is open for GET and POST.
- Non-custodial: the API never receives private keys. Swap endpoints return unsigned transactions that the user's wallet signs.
- Errors: 400 invalid input · 404 not found · 429 rate limited · 502 upstream or RPC failure · 503 not configured, or no liquidity pool yet.
Status
/healthAPI and chain status.
curl "https://token.cripchain.com/api/v1/health"
data{
"status": "ok",
"chainId": 56,
"block": 43123456
}Token & Price
/tokenOn-chain token metadata (name, symbol, decimals, total supply).
curl "https://token.cripchain.com/api/v1/token"
data{
"address": "0x…",
"name": "CripChain",
"symbol": "CRIP",
"decimals": 18,
"totalSupply": "500000000",
"chainId": 56,
"explorer": "https://bscscan.com/token/0x…"
}/priceLive CRIP price from the PancakeSwap V2 pool, in BNB and USD. Cached 10 s.
curl "https://token.cripchain.com/api/v1/price"
data{
"priceBnb": "0.0000021",
"priceUsd": "0.00135",
"bnbUsd": "640.2",
"source": "PancakeSwap V2",
"updatedAt": 1790000000
}Buy & Sell
/quote/buyQuote for buying CRIP with BNB.
Parameters| Name | Type | Required | Description |
|---|---|---|---|
bnb | number | required | BNB to spend |
slippage | number | optional | Percent, 0–50. Default 1 |
curl "https://token.cripchain.com/api/v1/quote/buy?bnb=0.5"
data{
"spendBnb": "0.5",
"expectedTokens": "238095.2",
"minTokens": "235714.2",
"slippagePct": "1"
}/quote/sellQuote for selling CRIP for BNB.
Parameters| Name | Type | Required | Description |
|---|---|---|---|
amount | number | required | CRIP to sell |
slippage | number | optional | Percent, 0–50. Default 1 |
curl "https://token.cripchain.com/api/v1/quote/sell?amount=1000"
data{
"sellTokens": "1000",
"expectedBnb": "0.0021",
"minBnb": "0.0020",
"slippagePct": "1"
}/swap/buyBuilds an unsigned buy transaction. Send tx with the user's wallet (eth_sendTransaction).
| Name | Type | Required | Description |
|---|---|---|---|
address | string | required | Buyer wallet (receives CRIP) |
bnb | number | required | BNB to spend |
slippage | number | optional | Percent, 0–50. Default 1 |
curl -X POST https://token.cripchain.com/api/v1/swap/buy \
-H "Content-Type: application/json" \
-d '{"address":"0xYourWallet","bnb":"0.5"}'data{
"tx": {
"chainId": 56,
"to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
"value": "0x6f05b59d3b20000",
"data": "0xb6f9de95…"
},
"expectedTokens": "238095.2",
"minTokens": "235714.2"
}/swap/sellBuilds an unsigned sell transaction. If the router allowance is too low, approveTx is returned and must be sent and confirmed first.
| Name | Type | Required | Description |
|---|---|---|---|
address | string | required | Seller wallet |
amount | number | required | CRIP to sell |
slippage | number | optional | Percent, 0–50. Default 1 |
curl -X POST https://token.cripchain.com/api/v1/swap/sell \
-H "Content-Type: application/json" \
-d '{"address":"0xYourWallet","amount":"1000"}'data{
"approveTx": {
"chainId": 56,
"to": "0xTOKEN",
"value": "0x0",
"data": "0x095ea7b3…"
},
"tx": {
"chainId": 56,
"to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
"value": "0x0",
"data": "0x791ac947…"
},
"expectedBnb": "0.0021",
"minBnb": "0.0020"
}Wallet & Transactions
/balance/{address}CRIP and BNB balance of a wallet.
Parameters| Name | Type | Required | Description |
|---|---|---|---|
address | string | required | Wallet address (in the path) |
curl "https://token.cripchain.com/api/v1/balance/0xYourWallet"
data{
"address": "0x…",
"token": "15000.5",
"bnb": "0.42"
}/tx/{hash}Transaction status: pending, success or failed, with confirmations.
| Name | Type | Required | Description |
|---|---|---|---|
hash | string | required | Transaction hash (in the path) |
curl "https://token.cripchain.com/api/v1/tx/0xTRANSACTION_HASH"
data{
"hash": "0x…",
"status": "success",
"from": "0x…",
"to": "0x…",
"valueBnb": "0.5",
"blockNumber": 43123400,
"confirmations": 12,
"gasUsed": 152340,
"explorer": "https://bscscan.com/tx/0x…"
}/transfers/{address}CRIP transfer history for a wallet. Needs CRIP_EXPLORER_KEY on the server.
| Name | Type | Required | Description |
|---|---|---|---|
address | string | required | Wallet address (in the path) |
page | int | optional | Default 1 |
limit | int | optional | 1–100, default 20 |
curl "https://token.cripchain.com/api/v1/transfers/0xYourWallet"
data{
"address": "0x…",
"page": 1,
"items": [
{
"hash": "0x…",
"from": "0x…",
"to": "0x…",
"amount": "1000",
"direction": "in",
"block": 43123400,
"timestamp": 1790000000
}
]
}Market data
/market/tickersLive 24h stats for major pairs (BTC, ETH, BNB, SOL, XRP, ADA, DOGE, TRX, AVAX, LINK vs USDT). Source: Binance public feed, cached 10 s.
curl "https://token.cripchain.com/api/v1/market/tickers"
data[
{
"symbol": "BNBUSDT",
"base": "BNB",
"price": "640.20",
"changePct": "1.85",
"high": "652.1",
"low": "628.0",
"volumeUsd": "182345678.12"
}
]/market/klinesCandlestick (OHLCV) data, last 200 candles.
Parameters| Name | Type | Required | Description |
|---|---|---|---|
symbol | string | optional | e.g. BNBUSDT (default) |
interval | string | optional | 5m, 15m, 1h (default), 4h, 1d |
curl "https://token.cripchain.com/api/v1/market/klines"
data[
{
"time": 1790000000,
"open": 638.1,
"high": 641,
"low": 637.5,
"close": 640.2,
"volume": 1523.4
}
]Site content
/sitePublic site content (tokenomics, roadmap, FAQ, buy links) managed in the admin panel.
curl "https://token.cripchain.com/api/v1/site"
data{
"name": "CripChain",
"symbol": "CRIP",
"total_supply": "500000000"
}Wallet example (JavaScript)
const API = 'https://token.cripchain.com/api/v1';
const [from] = await ethereum.request({ method: 'eth_requestAccounts' });
// 1. build the unsigned transaction
const { data } = await (await fetch(`${API}/swap/buy`, {
method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ address: from, bnb: '0.5', slippage: 1 })
})).json();
// 2. the user signs and sends it from their wallet
const hash = await ethereum.request({ method: 'eth_sendTransaction',
params: [{ from, to: data.tx.to, value: data.tx.value, data: data.tx.data }] });
// 3. poll the status
const status = (await (await fetch(`${API}/tx/${hash}`)).json()).data.status;
// Selling: call /swap/sell. If approveTx is not null, send it first and wait
// until /tx/{hash} reports success, then send tx.