Realtime stream (SSE)
A Server-Sent Events endpoint that pushes feed snapshots in near-real-time over a single open connection — the efficient alternative to tight polling.
GET
/api/feed/streamQuery parameters
| Param | Type | Description |
|---|---|---|
type | string | Feed to stream: trending (default), top, gainers, or new. |
chain | string | Restrict to one chain id, or omit for all chains. |
Protocol
Content-Type is text/event-stream. Each message is a data: frame whose payload is the same JSON array returned by /api/feed. The first frame arrives on connect, followed by fresh snapshots as the data updates.
event stream
data: [{"chainId":"solana","baseToken":{"symbol":"BOUNTYHOUSE"}, ...}]
data: [{"chainId":"solana","baseToken":{"symbol":"BOUNTYHOUSE"}, ...}]Browser (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);
};
es.onerror = () => {
// EventSource auto-reconnects; close it when you're done:
// es.close();
};Node / curl
curl
curl -N "https://dexscanner.io/api/feed/stream?type=trending"The connection stays open. The server cleans up the interval when the client disconnects.
Versioning
The API is currently unversioned and may change; see the changelog for breaking changes.