Skip to main content

Overview

Stream real-time token USD prices via Server-Sent Events (SSE) with DexPaprika’s public streaming endpoint. Get price updates roughly every 1 second with no API key required. Base URL: https://streaming.dexpaprika.com Endpoint: GET /stream Protocol: HTTP/1.1 with text/event-stream (SSE)

Getting started

Connect in seconds - no authentication required. One connection streams one asset.

Basic example

curl -N "https://streaming.dexpaprika.com/stream?method=t_p&chain=ethereum&address=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
This opens a streaming connection to Ethereum WETH price updates.

Request parameters

ParameterTypeRequiredDescription
methodstringYesStreaming method. Must be t_p (token price)
chainstringYesBlockchain network slug (e.g., ethereum, solana)
addressstringYesToken contract address or canonical address on the chain
limitintegerNoOptional: close stream after emitting N events

Request examples

curl -N "https://streaming.dexpaprika.com/stream?method=t_p&chain=ethereum&address=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2&limit=3"

Response format

Status: 200 OK on success Content-Type: text/event-stream Format: Newline-delimited SSE events

Event payload

data: {"a":"<token_address>","c":"<chain>","p":"<price_usd>","t":<unix_timestamp>}
event: t_p

Response fields

FieldTypeDescription
astringToken address
cstringChain slug
pstringPrice in USD (numeric string for precision)
tintegerSend timestamp (Unix seconds)

Example response

{"a":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","c":"ethereum","p":"3997.5514026436525223","t":1761733397}

Usage examples

Node.js quick listener

const url = new URL('https://streaming.dexpaprika.com/stream');
url.searchParams.set('method', 't_p');
url.searchParams.set('chain', 'ethereum');
url.searchParams.set('address', '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2');
url.searchParams.set('limit', '5');

(async () => {
  const res = await fetch(url.toString());
  if (!res.ok) throw new Error(`HTTP ${res.status}`);
  const reader = res.body.getReader();
  const decoder = new TextDecoder();
  let buf = '';

  for (;;) {
    const { value, done } = await reader.read();
    if (done) break;
    buf += decoder.decode(value, { stream: true });
    const chunks = buf.split('\n\n');
    buf = chunks.pop() || '';

    for (const chunk of chunks) {
      const lines = chunk.split('\n').filter(Boolean);
      const map = Object.fromEntries(lines.map(line => {
        const i = line.indexOf(': ');
        return i > 0 ? [line.slice(0, i), line.slice(i + 2)] : [line, ''];
      }));
      if (map.event && map.data) {
        try {
          const payload = JSON.parse(map.data);
          console.log(`[${map.event}]`, payload);
        } catch (e) {
          console.warn('Bad JSON:', map.data);
        }
      }
    }
  }
})().catch(err => {
  console.error(err);
  process.exit(1);
});

Browser (EventSource)

function startStream() {
  const url = new URL('https://streaming.dexpaprika.com/stream');
  url.searchParams.set('method', 't_p');
  url.searchParams.set('chain', 'ethereum');
  url.searchParams.set('address', '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2');

  const es = new EventSource(url.toString());

  function handle(evt) {
    try {
      const data = JSON.parse(evt.data);
      console.log(`[${evt.type}]`, data);
    } catch (_) {}
  }

  es.addEventListener('t_p', handle);

  es.onerror = () => {
    // Simple reconnect on error
    es.close();
    setTimeout(startStream, 1000);
  };
}

startStream();

Error handling

HTTP status codes

StatusReasonResolution
400 Bad RequestMissing/invalid parametersCheck method, chain, address, limit
400 Unsupported chainChain not supportedUse /networks endpoint to find valid chains
400 Asset not foundToken address invalid for chainVerify address belongs to the specified chain
429 Too Many RequestsGlobal capacity exceededRetry with exponential backoff

Common errors

invalid method: method must be 't_p'
asset address is required
chain is required
unsupported chain
asset not found
invalid limit parameter
limit must be greater than 0
Validation occurs in sequence. When testing limit errors, use a known-valid token address (e.g., WETH on Ethereum) to avoid hitting asset not found before the limit validation.

Integration tips

Supported Networks

Use the Networks endpoint to discover supported chains.

One Asset Per Connection

Open separate connections for multiple assets. This endpoint streams a single token per connection.

Handle Precision

Parse numeric strings as numbers to preserve price precision in your client.

Reconnection Logic

Implement standard SSE reconnection patterns to handle network interruptions gracefully.

Next steps

Get support


FAQs

No. The streaming endpoint is public; no API keys or registration required.
This endpoint streams one asset per connection. For multiple assets, open separate connections.
Target emission is ~1 second per connection, subject to server load and network conditions.
Implement standard SSE reconnection logic with exponential backoff on network failures.
Yes, this endpoint provides prices in USD. Numeric values are provided as strings to preserve precision.