Get Token Price
Integrate seamlessly with CoinVera’s REST endpoints by authenticating with your x-api-key, either as a query parameter or in the request header.
Authentication
Query Parameter Append your API key to the URL:
?x-api-key=<YOUR_API_KEY>
HTTP Header Include the header in your request:
x-api-key: <YOUR_API_KEY>
Single-Token Price Requests
Replace <TOKEN_MINT>
and <YOUR_API_KEY>
with your token’s mint address and your CoinVera API key.
Auto-Detect (Low-Latency)
GET https://api.coinvera.io/api/v1/price?ca=<TOKEN_MINT>&x-api-key=<YOUR_API_KEY>
PumpFun
GET https://api.coinvera.io/api/v1/pumpfun?ca=<TOKEN_MINT>&x-api-key=<YOUR_API_KEY>
Meteora
GET https://api.coinvera.io/api/v1/meteora?ca=<TOKEN_MINT>&x-api-key=<YOUR_API_KEY>
Raydium (All Pools)
GET https://api.coinvera.io/api/v1/raydium?ca=<TOKEN_MINT>&x-api-key=<YOUR_API_KEY>
Moonshot
GET https://api.coinvera.io/api/v1/moonshot?ca=<TOKEN_MINT>&x-api-key=<YOUR_API_KEY>
Using HTTP Headers
GET /api/v1/price?ca=<TOKEN_MINT> HTTP/1.1
Host: api.coinvera.io
x-api-key: <YOUR_API_KEY>
(Swap /price
for /pumpfun
, /raydium
, etc., as needed.)
Multi-Token Price Requests
Fetch prices for multiple tokens in one call by passing a comma-separated list of mint addresses:
GET https://api.coinvera.io/api/v1/price?ca=<MINT1>,<MINT2>,<MINT3>&x-api-key=<YOUR_API_KEY>
Code Examples
Fetch a single token’s price per request—see the code examples below.
const fetch = require('node-fetch');
const x_api_key = "<YOUR-API-KEY>"; // <-- Replace with your actual API key
const tokenAddresses = [
"<MINT-ADDRESS>"
];
async function getPrice(ca) {
try {
const url = `https://api.coinvera.io/api/v1/price?ca=${ca}`;
const result = await fetch(url, {
headers: {
"Content-Type": "application/json",
"x-api-key": x_api_key,
}
});
const data = await result.json();
return { ca, ...data };
} catch (err) {
return { ca, error: err.message };
}
}
async function getPricesForAllTokens() {
const results = await Promise.all(tokenAddresses.map(getPrice));
results.forEach(res => {
if (res.error) {
console.log(`Error for ${res.ca}: ${res.error}`);
} else {
console.log(`Token: ${res.ca}`);
console.log(res);
console.log('-------------------------');
}
});
}
getPricesForAllTokens();
Example Response
{
ca: '',
dex: '',
priceInSol: ,
priceInUsd: ,
marketCap:
}
Fetch multiple tokens’ prices in a single request—example below.
const fetch = require('node-fetch');
const x_api_key = ""; // <-- Replace with your actual API key
const tokenAddresses = [
"mint-1",
"mint-2"
];
async function getPrice(ca) {
try {
const url = `https://api.coinvera.io/api/v1/price?ca=${ca}`;
const result = await fetch(url, {
headers: {
"Content-Type": "application/json",
"x-api-key": x_api_key,
}
});
const data = await result.json();
return { ca, ...data };
} catch (err) {
return { ca, error: err.message };
}
}
async function getPricesForAllTokens() {
const results = await Promise.all(tokenAddresses.map(getPrice));
results.forEach(res => {
if (res.error) {
console.log(`Error for ${res.ca}: ${res.error}`);
} else {
console.log(`Token: ${res.ca}`);
console.log(res);
console.log('-------------------------');
}
});
}
getPricesForAllTokens();
Example Response
[
{
ca: '',
dex: '',
priceInSol: ,
priceInUsd: ,
marketCap: ,
success: true
},
{
ca: '',
dex: '',
priceInSol: ,
priceInUsd: ,
marketCap: ,
success: true
}
]
Tip: Experiment with different endpoints to find the lowest-latency feed for your use case. If you have questions, see our API Reference or reach out on our community channels.
Last updated