Skip to content

Get Prices

GET /prices | Auth: Required

Get current USD prices and 24-hour change for one or more token symbols.

Request

Parameters

Query string parameters:

FieldTypeRequiredDescription
symbolsstringYesComma-separated list of token symbols. Max 20 symbols per request. Case-insensitive. Example: "ETH,SOL,USDC".

Supported Symbols

ETH, SOL, BNB, USDC, USDT, BTC, DAI, WBTC, ARB, OP, AVAX, MATIC, WETH, BONK, JUP, RAY

Example

GET /prices?symbols=ETH,SOL,USDC

Response

Status: 200 OK

Fields

FieldTypeDescription
successbooleanAlways true.
pricesobjectMap of symbol to price data.
prices..usdnumberCurrent price in USD.
prices..change_24hnumberPercentage change over the last 24 hours. Positive or negative.
unknown_symbolsarraySymbols from the request that were not recognized. Empty array if all symbols matched.

Example

{

"hl-key">"success": true,

"hl-key">"prices": {

"hl-key">"ETH": {

"hl-key">"usd": 3500.42,

"hl-key">"change_24h": 2.5

},

"hl-key">"SOL": {

"hl-key">"usd": 145.80,

"hl-key">"change_24h": -1.3

},

"hl-key">"USDC": {

"hl-key">"usd": 1.0,

"hl-key">"change_24h": 0.01

}

},

"hl-key">"unknown_symbols": []

}

Example with Unknown Symbols

{

"hl-key">"success": true,

"hl-key">"prices": {

"hl-key">"ETH": {

"hl-key">"usd": 3500.42,

"hl-key">"change_24h": 2.5

}

},

"hl-key">"unknown_symbols": ["FAKECOIN"]

}

Errors

StatusErrorDescription
400"symbols parameter is required"The symbols query parameter is missing.
400"Too many symbols. Maximum 20 per request."More than 20 symbols were provided.
401"Invalid or missing API key"The API key is missing, malformed, or revoked.

Code Examples

curl

-kw">curl -str">"https://api.suwappu.bot/v1/agent/prices?symbols=ETH,SOL,USDC" \

-H -str">"Authorization: Bearer suwappu_sk_your_api_key"

Python

import requests

response = requests.get(

class="hl-str">"https:class="hl-commentclass="hl-str">">//api.suwappu.bot/v1/agent/prices",

headers={class="hl-str">"Authorization": class="hl-str">"Bearer suwappu_sk_your_api_key"},

params={class="hl-str">"symbols": class="hl-str">"ETH,SOL,USDC"},

)

data = response.json()

for symbol, price_data in data[class="hl-str">"prices"].items():

print(fclass="hl-str">"{symbol}: ${price_data[class="hl-str">'usd']:.2f} ({price_data[class="hl-str">'change_24h']:+.1f}%)")

TypeScript

const response = await fetch(

class="hl-str">"https:class="hl-commentclass="hl-str">">//api.suwappu.bot/v1/agent/prices?symbols=ETH,SOL,USDC",

{

headers: { Authorization: class="hl-str">"Bearer suwappu_sk_your_api_key" },

}

);

const { prices, unknown_symbols } = await response.json(); for (const [symbol, data] of Object.entries(prices)) {

console.log(${symbol}: $${data.usd} (${data.change_24h}%));

}

if (unknown_symbols.length > 0) {

console.warn(class="hl-str">"Unknown symbols:", unknown_symbols);

}