Price API: Get On-Chain Price For Any Token
Utilizing the powerful Jupiter Price API makes getting precise and real-time pricing for all SPL tokens simple. With the ability to fetch prices for up to 100 tokens, you'll never need another price API again!
The Jupiter Price API comes with the option to specify another token as the base unit (see "vsToken").
We support fetching the prices for up to 100 tokens in one call right now to manage performance. If you have a use case that is not supported yet, let us know in #developer-support
in our discord: discord.gg/jup
Usage
Jupiter Price API will always return the unit buy price for the token specified with the ids
parameter. This price is based on the best pricing data available across all DEXes queried. Please remember the addresses and token tickers are case-sensitive.
For example, the most basic call will provide the unit price for the token based on the buy amount of USDC.
# Unit price of 1 SOL based on the buy amount of USDC
https://price.jup.ag/v6/price?ids=SOL
{
"data": {
"SOL": {
"id": "So11111111111111111111111111111111111111112",
"mintSymbol": "SOL",
"vsToken": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"vsTokenSymbol": "USDC",
"price": 30.389174403
}
},
"timeTaken": 0.0003002400007972028
}
If you include a vsToken
, it will change the buy token. For example, this call will return the unit price for 1 JUP, based on the buy amount of Bonk. Simply put, the vsToken
argument tells you how much of the vsToken
(Bonk in this case) you will need to buy the target token (JUP). So for every one JUP we want to buy, we will need 44,580 Bonk.
# Unit price of 1 JUP based on the buy amount of Bonk
https://price.jup.ag/v6/price?ids=JUP&vsToken=Bonk
{
"data": {
"JUP": {
"id": "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN",
"mintSymbol": "JUP",
"vsToken": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
"vsTokenSymbol": "Bonk",
"price": 44580.353494
}
},
"timeTaken": 0.0002948529999997618
}
Both the ids
and vsToken
can also be specified using input mints.
# Specifying both id and vsToken with mint addresses
https://price.jup.ag/v6/price?ids=7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs&vsToken=So11111111111111111111111111111111111111112
{
"data": {
"7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs": {
"id": "7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs",
"mintSymbol": "ETH",
"vsToken": "So11111111111111111111111111111111111111112",
"vsTokenSymbol": "SOL",
"price": 43.28938739
}
},
"timeTaken": 0.039186676000099396
}
Try it out!
Try the API calls by making simple GET request via your browser or one of the terminal commands below:
Click to play videos
GEThttps://price.jup.ag/v6/price
https://price.jup.ag/v6/price
curl -X 'GET' 'https://price.jup.ag/v6/price?ids=SOL'
Parameters:
ids (required, string)
: Supports symbol or address of a token. You can also pass in an array of ids to with,
as separator.- Address mode are case-sensitive
mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So
mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So
,So11111111111111111111111111111111111111112
- Symbol mode are case-sensitive
SOL
,BTC
,mSOL
- Address mode are case-sensitive
vsToken (string)
: Supports symbol or address of a token.- Defaults to
USDC
- Symbol mode are case-sensitive
SOL
,BTC
,mSOL
- Address mode are case-sensitive
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
- Defaults to
Typings
- id (
string
) - Address of a token - mintSymbol (
string
) - Symbol of id token - vsToken (
string
) - Address of vs token - vsTokenSymbol (
string
) - Symbol of vs token - price (
number
) - Default to 1 unit of the token worth in USDC if vsToken is not specified - timeTaken (
number
) - API internal compute response time
Response
• 200: OKSuccess Response
{
"data": {
"SOL": {
"id": "So11111111111111111111111111111111111111112",
"mintSymbol": "SOL",
"vsToken": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"vsTokenSymbol": "USDC",
"price": 165.827567017
}
},
"timeTaken": 0.0004649519978556782
}
You will get an empty response if the token is not found or there is an error in the params!
• default Error Response
{
"data": {},
"timeTaken": 0.00007273000665009022
}
GEThttps://price.jup.ag/v6/price?ids=SOL&vsToken=mSOL
https://price.jup.ag/v6/price?ids=SOL&vsToken=mSOL
curl -X 'GET' 'https://price.jup.ag/v6/price?ids=SOL&vsToken=mSOL'
Response
• 200: OKSuccess Response
{
"data": {
"SOL": {
"id": "So11111111111111111111111111111111111111112",
"mintSymbol": "SOL",
"vsToken": "mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So",
"vsTokenSymbol": "mSOL",
"price": 0.839028001
}
},
"timeTaken": 0.00020902999676764011
}
Rate Limits: This endpoint is rate limited to 600 requests/min.
HTTP Status Codes
Code | Error Message |
---|---|
400 |
|
404 | Symbol or address not found for either input or vsToken |
409 | Duplicate symbol found for input or vsToken . The server will respond an error structure which contains the conflict addresses. User will have to use address mode instead. { "error": "Duplicated symbol found for PERP, use one of the address instead", "addresses": [ "D68NB5JkzvyNCZAvi6EGtEcGvSoRNPanU9heYTAUFFRa", "9BsnSWDPfbusseZfnXyZ3un14CyPMZYvsKjWY3Y8Gbqn", "EBQ6gWBQNxA2zB4twR5GWP6CkeAhqZZZeDgeP7BTtdM3" ]} |