GET /sol-price
The current SOL/USD price as a one-shot REST read - the same value the subscribe_sol_price stream pushes, derived from the deepest on-chain SOL/USDC market. Use this when you just need the rate once (to convert a WSOL-quoted price to dollars) and don't want to hold a WebSocket open. Takes no parameters. Auth via the x-api-key header or an ?api_key= query string.
| Method | GET |
| Auth | x-api-key header, or ?api_key= query string |
| Cost | 5 calls/min/key free, then priced as metadata (see Pricing) |
Example
- JavaScript
- Python
const res = await fetch("https://api.shrine.trade/sol-price", {
headers: { "x-api-key": "pd_xxxxxxxx…" },
});
const { priceUSD, time } = await res.json();
console.log(`SOL is $${priceUSD}`);
import requests
res = requests.get(
"https://api.shrine.trade/sol-price",
headers={"x-api-key": "pd_xxxxxxxx…"},
)
print(res.json())
Response
{
"priceUSD": 182.45,
"time": 1779812600
}
priceUSD is USD per SOL; time is the unix second of the underlying tick (0 if the gateway hasn't attached one yet).
Try it
Notes
- One global value - there is no
mint/poolargument. - Returns
503 unavailablein the brief window after a cold start, before the first SOL/USD tick has been observed - retry shortly. - Need it continuously? Use the
subscribe_sol_priceWebSocket stream instead: it's free and pushes a new value on every move, versus polling this endpoint.