Get Price Stats
curl --request POST \
--url https://refract.prismapi.io/v1/evm/dex/prices/get-price-stats \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"chain_id": 1,
"tokens": [
"0x6982508145454Ce325dDbE47a25d4ec3d2311933"
]
}
'import requests
url = "https://refract.prismapi.io/v1/evm/dex/prices/get-price-stats"
payload = {
"chain_id": 1,
"tokens": ["0x6982508145454Ce325dDbE47a25d4ec3d2311933"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({chain_id: 1, tokens: ['0x6982508145454Ce325dDbE47a25d4ec3d2311933']})
};
fetch('https://refract.prismapi.io/v1/evm/dex/prices/get-price-stats', 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://refract.prismapi.io/v1/evm/dex/prices/get-price-stats",
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_id' => 1,
'tokens' => [
'0x6982508145454Ce325dDbE47a25d4ec3d2311933'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://refract.prismapi.io/v1/evm/dex/prices/get-price-stats"
payload := strings.NewReader("{\n \"chain_id\": 1,\n \"tokens\": [\n \"0x6982508145454Ce325dDbE47a25d4ec3d2311933\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://refract.prismapi.io/v1/evm/dex/prices/get-price-stats")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chain_id\": 1,\n \"tokens\": [\n \"0x6982508145454Ce325dDbE47a25d4ec3d2311933\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://refract.prismapi.io/v1/evm/dex/prices/get-price-stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chain_id\": 1,\n \"tokens\": [\n \"0x6982508145454Ce325dDbE47a25d4ec3d2311933\"\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"token_address": "<string>",
"pool_address": "<string>",
"usd_price": 123,
"usd_price_change_5m": 123,
"usd_price_change_1h": 123,
"usd_price_change_6h": 123,
"usd_price_change_12h": 123,
"usd_price_change_1d": 123,
"usd_price_change_7d": 123,
"usd_price_change_30d": 123,
"usd_volume_5m": 123,
"usd_volume_1h": 123,
"usd_volume_6h": 123,
"usd_volume_12h": 123,
"usd_volume_1d": 123,
"usd_volume_7d": 123,
"usd_volume_30d": 123,
"usd_volume_change_5m": 123,
"usd_volume_change_1h": 123,
"usd_volume_change_6h": 123,
"usd_volume_change_12h": 123,
"usd_volume_change_1d": 123,
"usd_volume_change_7d": 123,
"usd_volume_change_30d": 123,
"block_number": 123,
"block_time": "2023-11-07T05:31:56Z"
}
]{
"error": "Bad request: Invalid request parameters"
}{
"error": "Unauthorized: Invalid or missing API key"
}{
"error": "Forbidden: Access denied for the current API plan"
}{
"error": "Too many requests: Rate limit exceeded"
}{
"error": "Internal server error"
}Prices
Get Price Stats
Returns price stats for one or more tokens or pools.
POST
/
v1
/
evm
/
dex
/
prices
/
get-price-stats
Get Price Stats
curl --request POST \
--url https://refract.prismapi.io/v1/evm/dex/prices/get-price-stats \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"chain_id": 1,
"tokens": [
"0x6982508145454Ce325dDbE47a25d4ec3d2311933"
]
}
'import requests
url = "https://refract.prismapi.io/v1/evm/dex/prices/get-price-stats"
payload = {
"chain_id": 1,
"tokens": ["0x6982508145454Ce325dDbE47a25d4ec3d2311933"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({chain_id: 1, tokens: ['0x6982508145454Ce325dDbE47a25d4ec3d2311933']})
};
fetch('https://refract.prismapi.io/v1/evm/dex/prices/get-price-stats', 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://refract.prismapi.io/v1/evm/dex/prices/get-price-stats",
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_id' => 1,
'tokens' => [
'0x6982508145454Ce325dDbE47a25d4ec3d2311933'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://refract.prismapi.io/v1/evm/dex/prices/get-price-stats"
payload := strings.NewReader("{\n \"chain_id\": 1,\n \"tokens\": [\n \"0x6982508145454Ce325dDbE47a25d4ec3d2311933\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://refract.prismapi.io/v1/evm/dex/prices/get-price-stats")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chain_id\": 1,\n \"tokens\": [\n \"0x6982508145454Ce325dDbE47a25d4ec3d2311933\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://refract.prismapi.io/v1/evm/dex/prices/get-price-stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chain_id\": 1,\n \"tokens\": [\n \"0x6982508145454Ce325dDbE47a25d4ec3d2311933\"\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"token_address": "<string>",
"pool_address": "<string>",
"usd_price": 123,
"usd_price_change_5m": 123,
"usd_price_change_1h": 123,
"usd_price_change_6h": 123,
"usd_price_change_12h": 123,
"usd_price_change_1d": 123,
"usd_price_change_7d": 123,
"usd_price_change_30d": 123,
"usd_volume_5m": 123,
"usd_volume_1h": 123,
"usd_volume_6h": 123,
"usd_volume_12h": 123,
"usd_volume_1d": 123,
"usd_volume_7d": 123,
"usd_volume_30d": 123,
"usd_volume_change_5m": 123,
"usd_volume_change_1h": 123,
"usd_volume_change_6h": 123,
"usd_volume_change_12h": 123,
"usd_volume_change_1d": 123,
"usd_volume_change_7d": 123,
"usd_volume_change_30d": 123,
"block_number": 123,
"block_time": "2023-11-07T05:31:56Z"
}
]{
"error": "Bad request: Invalid request parameters"
}{
"error": "Unauthorized: Invalid or missing API key"
}{
"error": "Forbidden: Access denied for the current API plan"
}{
"error": "Too many requests: Rate limit exceeded"
}{
"error": "Internal server error"
}Authorizations
Your Prism API key. You can get one for free in the Prism Dashboard.
Body
application/json
Numeric EVM chain ID to query. See Supported Chains.
Token addresses to retrieve price statistics for.
Required array length:
1 - 1000 elementsPool addresses to retrieve price statistics for.
Required array length:
1 - 1000 elementsResponse
List of price stats for the specified tokens.
Was this page helpful?