API Documentation

REST + JSON for pricing, quotes, swaps and transaction lookups on BNB Smart Chain (chain ID 56).
https://token.cripchain.com/api/v1

Status

GET/health

API and chain status.

Request
curl "https://token.cripchain.com/api/v1/health"
Response data
{
    "status": "ok",
    "chainId": 56,
    "block": 43123456
}

Token & Price

GET/token

On-chain token metadata (name, symbol, decimals, total supply).

Request
curl "https://token.cripchain.com/api/v1/token"
Response data
{
    "address": "0x…",
    "name": "CripChain",
    "symbol": "CRIP",
    "decimals": 18,
    "totalSupply": "500000000",
    "chainId": 56,
    "explorer": "https://bscscan.com/token/0x…"
}
GET/price

Live CRIP price from the PancakeSwap V2 pool, in BNB and USD. Cached 10 s.

Request
curl "https://token.cripchain.com/api/v1/price"
Response data
{
    "priceBnb": "0.0000021",
    "priceUsd": "0.00135",
    "bnbUsd": "640.2",
    "source": "PancakeSwap V2",
    "updatedAt": 1790000000
}

Buy & Sell

GET/quote/buy

Quote for buying CRIP with BNB.

Parameters
NameTypeRequiredDescription
bnbnumber requiredBNB to spend
slippagenumber optionalPercent, 0–50. Default 1
Request
curl "https://token.cripchain.com/api/v1/quote/buy?bnb=0.5"
Response data
{
    "spendBnb": "0.5",
    "expectedTokens": "238095.2",
    "minTokens": "235714.2",
    "slippagePct": "1"
}
GET/quote/sell

Quote for selling CRIP for BNB.

Parameters
NameTypeRequiredDescription
amountnumber requiredCRIP to sell
slippagenumber optionalPercent, 0–50. Default 1
Request
curl "https://token.cripchain.com/api/v1/quote/sell?amount=1000"
Response data
{
    "sellTokens": "1000",
    "expectedBnb": "0.0021",
    "minBnb": "0.0020",
    "slippagePct": "1"
}
POST/swap/buy

Builds an unsigned buy transaction. Send tx with the user's wallet (eth_sendTransaction).

Parameters
NameTypeRequiredDescription
addressstring requiredBuyer wallet (receives CRIP)
bnbnumber requiredBNB to spend
slippagenumber optionalPercent, 0–50. Default 1
Request
curl -X POST https://token.cripchain.com/api/v1/swap/buy \
  -H "Content-Type: application/json" \
  -d '{"address":"0xYourWallet","bnb":"0.5"}'
Response data
{
    "tx": {
        "chainId": 56,
        "to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
        "value": "0x6f05b59d3b20000",
        "data": "0xb6f9de95…"
    },
    "expectedTokens": "238095.2",
    "minTokens": "235714.2"
}
POST/swap/sell

Builds an unsigned sell transaction. If the router allowance is too low, approveTx is returned and must be sent and confirmed first.

Parameters
NameTypeRequiredDescription
addressstring requiredSeller wallet
amountnumber requiredCRIP to sell
slippagenumber optionalPercent, 0–50. Default 1
Request
curl -X POST https://token.cripchain.com/api/v1/swap/sell \
  -H "Content-Type: application/json" \
  -d '{"address":"0xYourWallet","amount":"1000"}'
Response 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

GET/balance/{address}

CRIP and BNB balance of a wallet.

Parameters
NameTypeRequiredDescription
addressstring requiredWallet address (in the path)
Request
curl "https://token.cripchain.com/api/v1/balance/0xYourWallet"
Response data
{
    "address": "0x…",
    "token": "15000.5",
    "bnb": "0.42"
}
GET/tx/{hash}

Transaction status: pending, success or failed, with confirmations.

Parameters
NameTypeRequiredDescription
hashstring requiredTransaction hash (in the path)
Request
curl "https://token.cripchain.com/api/v1/tx/0xTRANSACTION_HASH"
Response data
{
    "hash": "0x…",
    "status": "success",
    "from": "0x…",
    "to": "0x…",
    "valueBnb": "0.5",
    "blockNumber": 43123400,
    "confirmations": 12,
    "gasUsed": 152340,
    "explorer": "https://bscscan.com/tx/0x…"
}
GET/transfers/{address}

CRIP transfer history for a wallet. Needs CRIP_EXPLORER_KEY on the server.

Parameters
NameTypeRequiredDescription
addressstring requiredWallet address (in the path)
pageint optionalDefault 1
limitint optional1–100, default 20
Request
curl "https://token.cripchain.com/api/v1/transfers/0xYourWallet"
Response data
{
    "address": "0x…",
    "page": 1,
    "items": [
        {
            "hash": "0x…",
            "from": "0x…",
            "to": "0x…",
            "amount": "1000",
            "direction": "in",
            "block": 43123400,
            "timestamp": 1790000000
        }
    ]
}

Market data

GET/market/tickers

Live 24h stats for major pairs (BTC, ETH, BNB, SOL, XRP, ADA, DOGE, TRX, AVAX, LINK vs USDT). Source: Binance public feed, cached 10 s.

Request
curl "https://token.cripchain.com/api/v1/market/tickers"
Response data
[
    {
        "symbol": "BNBUSDT",
        "base": "BNB",
        "price": "640.20",
        "changePct": "1.85",
        "high": "652.1",
        "low": "628.0",
        "volumeUsd": "182345678.12"
    }
]
GET/market/klines

Candlestick (OHLCV) data, last 200 candles.

Parameters
NameTypeRequiredDescription
symbolstring optionale.g. BNBUSDT (default)
intervalstring optional5m, 15m, 1h (default), 4h, 1d
Request
curl "https://token.cripchain.com/api/v1/market/klines"
Response data
[
    {
        "time": 1790000000,
        "open": 638.1,
        "high": 641,
        "low": 637.5,
        "close": 640.2,
        "volume": 1523.4
    }
]

Site content

GET/site

Public site content (tokenomics, roadmap, FAQ, buy links) managed in the admin panel.

Request
curl "https://token.cripchain.com/api/v1/site"
Response 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.