Skip to main content
GET
/
v1
/
token
/
price
Python (SDK)
from compass_api_sdk import CompassAPI, models


with CompassAPI(
    api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:

    res = compass_api.token.token_price(chain=models.V1TokenPriceChain.ETHEREUM, token="USDC")

    # Handle response
    print(res)
{
  "price": 2000
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Query Parameters

chain
enum<string>
default:ethereum
required
Available options:
arbitrum,
base,
ethereum
block
integer | null

Optional block number (defaults to latest).

token
string
default:AAVE
required

The symbol or address of the token for which to get the price..

Examples:

"USDC"

"WETH"

"0xA0b86a33E6441ccF30EE5DdEF1E9b652C91ac1c8"

Response

Successful Response

price
string
required

Price of the token in USD

Examples:

2000