RealFlow.so
GET /v1/prices/stream Free

Price stream (SSE)

Subscribe to live price updates over Server-Sent Events.

Long-lived `text/event-stream` connection. Pushes a `price` event every time a new swap touches one of your subscribed mints, plus periodic comment-only heartbeat lines so intermediaries don't reap the connection as idle. ### Auth Either auth scheme works: - `X-API-Key: <key>` header — for HTTP clients - `?api_key=<key>` query string — for browsers using `EventSource`, which can't set custom headers ### Wire format Each `price` event is a JSON-encoded payload after `data:`: ```text event: price id: 1730500000000 data: {"mint":"EPjFW...","price_usd":"1.0001","ts":1730500000000} ``` Fields: - `mint`: SPL mint address (string) - `price_usd`: latest USD price as a decimal string — preserves precision; parse with `Decimal` rather than `Number` if you care about sub-cent precision - `ts`: epoch milliseconds at which the price was derived The `id` line is the same epoch-ms; clients should track the most recent one and pass it back as the `Last-Event-ID` header on reconnect to resume from where they were. ### Heartbeats A comment-only line (`: keepalive\n\n`) is emitted every ~15s. EventSource clients ignore comments — they exist purely to keep proxies and load balancers from closing the connection. ### Plan limits - Per-key concurrent connections: enforced via `sse_connections_max` on the API key. Excess connection attempts return `429 rate_limited`. - Per-connection mint count: enforced via `max_tokens_per_sse_conn`. Exceeding it returns `400 validation_failed`. ### Cost Currently 0 credits per message; the `prices_stream` cost is configured centrally and may change.

Pricing note: Free during launch

Request

Query parameters

  • tokensstringrequired

    Comma-separated list of mint addresses to subscribe to.

Example

curl \
  -H "X-API-Key: $REALFLOW_API_KEY" \
  "https://api.realflow.so/v1/prices/stream?tokens=So11111111111111111111111111111111111111112"