Get Price By Pool

Fetch precise, real-time Solana token prices from any liquidity pool by specifying the token mint and pool ID, all via a single CoinVera REST endpoint.

Retrieve the real-time price of a specific token from any supported DEX pool. This is ideal when you need precision pricing or want to target a particular liquidity pool for lowest latency.

Endpoint

GET https://api.coinvera.io/api/v1/price

Authentication Include your API key in the request header:

x-api-key: <YOUR_API_KEY>

Query Parameters

  • ca (string, required) — The token’s mint address.

  • poolId (string, required) — The identifier of the liquidity pool you want to query.

Direct URL Example

https://api.coinvera.io/api/v1/price?ca=<TOKEN_MINT>&poolId=<POOL_ID>&x-api-key=<YOUR_API_KEY>

Code Examples

const axios = require('axios');

const x_api_key = "";

// Add your token addresses and pool IDs here
const tokens = [
    {
        ca: "",
        poolId: ""
    },
];

async function getPrice(ca, poolId) {
    try {
        const url = `https://api.coinvera.io/api/v1/price?x-api-key=${x_api_key}&ca=${ca}&poolId=${poolId}`;
        const response = await axios.get(url);
        return { ca, poolId, ...response.data };
    } catch (err) {
        return { ca, poolId, error: err.message };
    }
}

async function getPricesForAllTokens() {
    const results = await Promise.all(tokens.map(token => getPrice(token.ca, token.poolId)));
    results.forEach(res => {
        if (res.error) {
            console.log(`Error for CA: ${res.ca}, Pool: ${res.poolId}: ${res.error}`);
        } else {
            console.log(`Token: ${res.ca}, Pool: ${res.poolId}`);
            console.log(res);
            console.log('-------------------------');
        }
    });
}

getPricesForAllTokens();

Example Response

{
  ca: '53JxiSEdahWu8FXnkeUbpoS2o2wXumc8ThzviBX7pump',
  poolId: '24hgLhdNLgPmJeUNAQMHJEBdbuZRBknRuaP1trTiBkD4',
  dex: 'pumpfun amm',
  liquidity: '33810.474998006444',
  priceInSol: '0.0000006679153339642684',
  priceInUsd: '0.00010054593656529703'
}

Tip: Omitting poolId will trigger auto-detection across all pools for that token. Specify poolId when you need data from one exact pool.

Last updated