Skip to main content
POST
/
sse
/
prices
Stream real-time prices for multiple assets
curl --request POST \
  --url https://streaming.dexpaprika.com/sse/prices \
  --header 'Content-Type: application/json' \
  --data '
[
  {
    "chain": "ethereum",
    "address": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
    "method": "token_price",
    "request_id": 2147483647,
    "filter": {}
  }
]
'
import requests

url = "https://streaming.dexpaprika.com/sse/prices"

payload = [
{
"chain": "ethereum",
"address": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
"method": "token_price",
"request_id": 2147483647,
"filter": {}
}
]
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([
{
chain: 'ethereum',
address: '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D',
method: 'token_price',
request_id: 2147483647,
filter: {}
}
])
};

fetch('https://streaming.dexpaprika.com/sse/prices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://streaming.dexpaprika.com/sse/prices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'chain' => 'ethereum',
'address' => '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D',
'method' => 'token_price',
'request_id' => 2147483647,
'filter' => [

]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://streaming.dexpaprika.com/sse/prices"

payload := strings.NewReader("[\n {\n \"chain\": \"ethereum\",\n \"address\": \"0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\",\n \"method\": \"token_price\",\n \"request_id\": 2147483647,\n \"filter\": {}\n }\n]")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://streaming.dexpaprika.com/sse/prices")
.header("Content-Type", "application/json")
.body("[\n {\n \"chain\": \"ethereum\",\n \"address\": \"0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\",\n \"method\": \"token_price\",\n \"request_id\": 2147483647,\n \"filter\": {}\n }\n]")
.asString();
require 'uri'
require 'net/http'

url = URI("https://streaming.dexpaprika.com/sse/prices")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"chain\": \"ethereum\",\n \"address\": \"0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\",\n \"method\": \"token_price\",\n \"request_id\": 2147483647,\n \"filter\": {}\n }\n]"

response = http.request(request)
puts response.read_body
{
  "address": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
  "chain": "ethereum",
  "price": "3456.78",
  "timestamp": "2024-05-08T10:00:00Z",
  "timestamp_price": "2024-05-08T09:59:58Z",
  "token_price": "2024-05-08T09:59:58Z"
}
{
"message": "asset not found"
}
{
"message": "asset not found"
}
{
"message": "asset not found"
}

Query Parameters

limit
integer

Close the stream after this many total events. Omit for an indefinite stream.

Required range: x >= 1

Body

application/json
Maximum array length: 25
chain
string
required

Blockchain network identifier.

Example:

"ethereum"

address
string
required

Token smart contract address.

Example:

"0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D"

method
enum<string>
required

Streaming method. Only token_price is accepted on /sse/prices.

Available options:
token_price
request_id
integer

Optional identifier echoed on each event for this subscription. Defaults to the array index if omitted.

Required range: 0 <= x <= 4294967295
filter
object

Response

Multiplexed SSE stream established.

Price update payload. Delivered on the token_price event channel.

address
string

Token smart contract address.

Example:

"0x7a250d5630b4cf539739df2c5dacb4c659f2488d"

chain
string

Blockchain network identifier.

Example:

"ethereum"

price
string

Token price in USD.

Example:

"3456.78"

timestamp
string

Server ingestion timestamp (ISO 8601).

Example:

"2024-05-08T10:00:00Z"

timestamp_price
string

On-chain or oracle price timestamp (ISO 8601).

Example:

"2024-05-08T09:59:58Z"

token_price
string

Alias for timestamp_price.

Example:

"2024-05-08T09:59:58Z"