Links

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:
Query parameter
Value
Meaning
quoteAddress
0x00000000000000000000000000000000000003d2
The address of the token or pseudo-token in which we want the price quoted. In this case, the value represents the fiat currency EUR.
blockNumber
15000000
In the first example we didn’t request a particular block number, so our call returned the latest. Now we are specifically requesting the price at block 15000000.

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"
}