A Simple Use Case

To demonstrate the usage of the API, let us show how to retrieve the latest price of the AAVE token.

Request

curl \
-H 'Authorization: Bearer <API KEY>' \
https://gateway.credmark.com/v1/tokens/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/price 

We only need to pass one value in the request header, our API Key.

The request URL construction is straightforward. These are the path segments, in order, and their meaning:

Response

The price endpoint of the Token API will give you a response like this:

{
  "chainId": 1,
  "blockNumber": 15409335,
  "blockTimestamp": 1661434010,
  "tokenAddress": "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",
  "quoteAddress": "0x0000000000000000000000000000000000000348",
  "price": 89.52673237,
  "protocol": "cex",
  "src": "price.quote:cached"
}

Our response body includes the full context of the data we requested, i.e., the price:

Last updated