Docs

Examples

Copy-paste snippets for the public API. No key required; mind the rate limits.

The read endpoints send Access-Control-Allow-Origin: *, so you can call them directly from third-party browser apps.

curl

bash
# Trending feed (Solana)
curl "https://dexscanner.io/api/feed?type=trending&chain=solana"

# Public site config
curl "https://dexscanner.io/api/config"

Node (fetch)

javascript
// Node 18+ has global fetch
const res = await fetch("https://dexscanner.io/api/feed?type=gainers");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const pairs = await res.json();
for (const p of pairs.slice(0, 5)) {
  console.log(p.baseToken.symbol, p.priceUsd, p.priceChange?.h24 + "%");
}

Browser (fetch)

javascript
async function loadTrending() {
  const res = await fetch("https://dexscanner.io/api/feed?type=trending");
  return res.json();
}
// Poll no more than once every 5–10s, or use the stream below.

Realtime (EventSource)

javascript
const es = new EventSource(
  "https://dexscanner.io/api/feed/stream?type=trending"
);

es.onmessage = (e) => {
  const pairs = JSON.parse(e.data);
  render(pairs); // fresh snapshot pushed as data updates
};

// One connection per client. Close it when done:
// es.close();
Questions? See the FAQ or contact us.Market data sourced from the DexScreener API.