Skip to main content
GET
/
api
/
fetch-price
/
:token
Fetch Price
curl --request GET \
  --url https://api.example.com/api/fetch-price/:token \
  --header 'x-payment-signature: <x-payment-signature>' \
  --header 'x-payment-wallet: <x-payment-wallet>'
{
  "data": {
    "id": "<string>",
    "mintSymbol": "<string>",
    "vsToken": "<string>",
    "vsTokenSymbol": "<string>",
    "price": 123
  }
}
Provides real-time pricing data for SPL tokens by querying the Jupiter aggregator.

Authentication

This endpoint requires an x402 payment. A 402 Payment Required response is returned if the payment signature is missing or invalid. Cost: 0.05 USDC per request.

Header Parameters

x-payment-signature
string
required
A valid Solana transaction signature proving the USDC transfer to the merchant’s vault address.
x-payment-wallet
string
required
The public key of the wallet that made the payment.

Path Parameters

token
string
required
The token symbol (e.g., SOL, BONK, JUP) or mint address.

Response

data
object

Example

# First call returns 402 — discover payment requirements
curl -i http://localhost:3000/api/fetch-price/SOL

# After payment, include signature to receive data
curl -H "x-payment-signature: <TX_SIGNATURE>" \
     -H "x-payment-wallet: <YOUR_PUBKEY>" \
     http://localhost:3000/api/fetch-price/SOL