Looking at the Past

Let’s try to retrieve the price of the AAVE token in EUR, at block 15000000.

Request

curl \
-H 'Authorization: Bearer <API KEY>' \
https://gateway.credmark.com/v1/tokens/1/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9/price?quoteAddress=0x00000000000000000000000000000000000003d2&blockNumber=15000000

Don’t forget to escape the ‘&’ when pasting this into a Unix terminal.

We haven’t changed any part of the request path, but we have added two query parameters:

Response

You will receive a list of response fields identical to those in the Simple Use Case above but with the specifically required information for EUR and the block 15000000:

{
  "chainId": 1,
  "blockNumber": 15000000,
  "blockTimestamp": 1655778500,
  "tokenAddress": "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",
  "quoteAddress": "0x00000000000000000000000000000000000003d2",
  "price": 58.06383150795538,
  "protocol": "cex"
}

Last updated