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"
}{
"message": "asset not found"
}{
"message": "asset not found"
}{
"message": "asset not found"
}Stream real-time prices for multiple assets
Establishes a multiplexed SSE stream for up to 25 token price subscriptions in a single connection.
Emitted events: token_price · ping · warning · error
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"
}{
"message": "asset not found"
}{
"message": "asset not found"
}{
"message": "asset not found"
}Query Parameters
Close the stream after this many total events. Omit for an indefinite stream.
x >= 1Body
25Blockchain network identifier.
"ethereum"
Token smart contract address.
"0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D"
Streaming method. Only token_price is accepted on /sse/prices.
token_price Optional identifier echoed on each event for this subscription. Defaults to the array index if omitted.
0 <= x <= 4294967295Response
Multiplexed SSE stream established.
- Option 1
- Option 2
- Option 3
- Option 4
Price update payload. Delivered on the token_price event channel.
Token smart contract address.
"0x7a250d5630b4cf539739df2c5dacb4c659f2488d"
Blockchain network identifier.
"ethereum"
Token price in USD.
"3456.78"
Server ingestion timestamp (ISO 8601).
"2024-05-08T10:00:00Z"
On-chain or oracle price timestamp (ISO 8601).
"2024-05-08T09:59:58Z"
Was this page helpful?