4UP

API Documentation

4UP's read API for BNB Smart Chain markets. All responses are JSON { data, meta }, proxied from DexScreener / GeckoTerminal / GMGN with a short server-side cache — no key required. Base URL is this deployment's origin. Prices are USD; timestamps are unix seconds.

GET/api/solana/board

Trending BNB Smart Chain tokens — ranked by GMGN (chain: bsc), falling back to DexScreener's latest-activity lists, then hydrated through DexScreener for price / liquidity / volume / 24h change. Cached ~30s. (The /api/solana/* prefix is historical — it serves BSC data now.)

{
  "data": [
    {
      "mint": "0xBe11b6E6a1708a6d8Eb068943cbAfD47E40e7777",
      "symbol": "CowRanch", "name": "CowRanch",
      "pairAddress": "0x259A1f55DB16469C0E1e3034FeBa8733e47DD4Dd",
      "dexId": "pancakeswap",
      "priceUsd": 0.00007173, "marketCap": 71730, "fdv": 71730,
      "liquidityUsd": 26365.89, "volume24hUsd": 834054.88,
      "change24hPct": 89.45, "txns24h": 9660,
      "pairCreatedAt": 1788870671,
      "imageUrl": "https://...", "bannerUrl": "https://...",
      "dexscreenerUrl": "https://dexscreener.com/bsc/0x259A…D4Dd",
      "fromPumpFun": false,
      "badges": [{ "icon": "liq-high", "tone": "accent", "title": "High liquidity" }]
    }
  ],
  "meta": { "asOf": 1788882404, "cached": false }
}
GET/api/solana/search

Live token search over DexScreener — matches by symbol, name, or a pasted 0x address. BNB Smart Chain only, deepest pair per token, top 20.

qquery string, 2+ chars
{
  "data": [
    {
      "mint": "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",
      "symbol": "Cake", "name": "PancakeSwap Token",
      "imageUrl": null, "priceUsd": 2.28,
      "marketCap": 731600036, "liquidityUsd": 20260532.03,
      "dexId": "pancakeswap"
    }
  ],
  "meta": { "asOf": 1788879743 }
}
GET/api/solana/token/{address}

Full DexScreener-backed detail for one BNB Smart Chain token — identity, socials, price (USD + native), market cap / FDV, liquidity, and 5m / 1h / 6h / 24h windows for volume, price change and buy/sell counts. 404 with { data: null } if no pair is indexed.

{
  "data": {
    "mint": "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",
    "symbol": "Cake", "name": "PancakeSwap Token",
    "imageUrl": null, "bannerUrl": null,
    "websites": [], "socials": [],
    "priceUsd": 2.28, "priceNative": 0.003039, "quoteSymbol": "WBNB",
    "dexId": "pancakeswap",
    "pairAddress": "0xAfB2Da14056725E3BA3a30dD846B6BBbd7886c56",
    "marketCap": 730659556, "fdv": 770836588, "liquidityUsd": 1028379.99,
    "volume": { "m5": 8871.9, "h1": 82100, "h6": 470000, "h24": 5441399 },
    "priceChange": { "m5": 0.01, "h1": -0.2, "h6": 0.4, "h24": 0.5 },
    "txns": { "h24": { "buys": 6489, "sells": 7885 } },
    "pairCreatedAt": 1680000000, "fromPumpFun": false,
    "dexscreenerUrl": "https://dexscreener.com/bsc/0xAfB2…6c56",
    "otherPools": [
      { "pairAddress": "0x…", "dexId": "pancakeswap",
        "quoteSymbol": "USDT", "liquidityUsd": 120000 }
    ]
  },
  "meta": { "asOf": 1788879743 }
}
GET/api/solana/pool/{pair}/candles

OHLCV candles for a pool (pair) address — GeckoTerminal networks/bsc. Time is unix seconds. Cached ~20s.

interval1m | 5m | 15m | 1h | 4h | 1d — default 1h
{
  "data": [
    { "time": 1785279600, "open": 1.3756, "high": 1.3782,
      "low": 1.3726, "close": 1.3775, "volume": 27407.12 }
  ],
  "meta": { "asOf": 1788879743 }
}
GET/api/migrations

"New Migration" feed — four.meme tokens on BNB Smart Chain (…4444 address suffix) whose bonding curve has graduated onto a PancakeSwap pool in the last 72h, sourced from DexScreener's latest token profiles / boosts. Cached ~10s.

{
  "data": [
    {
      "chain": "bsc",
      "address": "0x……………………………………………………4444",
      "symbol": "MEME", "name": "Meme Token",
      "imageUrl": "https://...",
      "priceUsd": 0.0000123, "marketCap": 210000,
      "liquidityUsd": 34000, "volume24hUsd": 512000,
      "migratedAt": 1788870000,
      "linkUrl": "https://dexscreener.com/bsc/0x…"
    }
  ],
  "meta": { "asOf": 1788882404, "cached": false }
}
GET/api/rugcheck

Rug-risk report for a BNB Smart Chain token — DexScreener market data + on-chain checks (buy→sell simulation through the PancakeSwap v3 quoter, burn-address balances, liquidity / age / flow heuristics) scored by 4UP Scan. Pass ?q=name to search instead.

address0x… token contract — returns the full report
qname / symbol search — returns { results: [{ address, symbol, name, liquidityUsd }] }
{
  "data": {
    "address": "0x……", "symbol": "MEME", "name": "Meme Token",
    "riskScore": 24, "verdict": "Caution", "scoreKind": "risk",
    "priceUsd": 0.0000123, "liquidityUsd": 34000, "marketCap": 210000,
    "ageDays": 1.4, "volume24hUsd": 512000, "buys24h": 722, "sells24h": 938,
    "change24hPct": -1.73, "burnedPct": 0,
    "checks": [
      { "id": "sell", "label": "Sell tax / round-trip loss",
        "status": "pass", "weight": 0,
        "detail": "Sells simulate fine (~0.4% loss beyond the 0.25% pool fee)." }
    ],
    "notes": [], "pairAddress": "0x……",
    "dexUrl": "https://dexscreener.com/bsc/0x……"
  },
  "meta": { "asOf": 1788148200 }
}
POST/api/lens-ai

4UP AI chat. Send the conversation; the response streams back as Server-Sent Events (text/event-stream). Each data: line is a JSON {"text": "…"} delta, terminated by data: [DONE]. Needs ANTHROPIC_API_KEY set.

body{ "messages": [{ "role": "user", "content": "what's trending on BNB Chain right now?" }] }
data: {"text":"CowRanch is up "}
data: {"text":"89% on the day, but "}
data: {"text":"liquidity is only ~$26k…"}
data: [DONE]
GET/api/health

Liveness: database reachable, price-key (Finnhub) configured, server time. swapCursor is the legacy EVM indexer's block cursor (dormant — MARKETS is empty).

{ "ok": true, "finnhub": true, "swapCursor": null, "ts": 1788148200 }