GET
/
v1
/
pricing
/
historical_by_addresses_v2
/
{chainName}
/
{quoteCurrency}
/
{contractAddress}
import { GoldRushClient } from "@covalenthq/client-sdk";

const ApiServices = async () => {
    const client = new GoldRushClient("YOUR_API_KEY");
    const resp = await client.PricingService.getTokenPrices({chainName: "chainName", walletAddress: "walletAddress"});
    console.log(resp.data);
};

ApiServices();
{
  "contract_decimals": 123,
  "contract_name": "<string>",
  "contract_ticker_symbol": "<string>",
  "contract_address": "<string>",
  "supports_erc": [
    "<string>"
  ],
  "logo_url": "<string>",
  "update_at": "2023-11-07T05:31:56Z",
  "quote_currency": "<string>",
  "logo_urls": {
    "token_logo_url": "<string>",
    "protocol_logo_url": "<string>",
    "chain_logo_url": "<string>"
  },
  "prices": [
    {
      "contract_metadata": {
        "contract_decimals": 123,
        "contract_name": "<string>",
        "contract_ticker_symbol": "<string>",
        "contract_address": "<string>",
        "supports_erc": [
          "<string>"
        ],
        "logo_url": "<string>"
      },
      "date": "2023-11-07T05:31:56Z",
      "price": 123,
      "pretty_price": "<string>"
    }
  ],
  "items": [
    {}
  ]
}

Credit Cost

1 per call

Processing

Batch

Supports a comma separated list of token contract addresses.

If no date range is provided, the spot price (with a 5 minute refresh) is provided.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form: Bearer <token>, where <token> is your GoldRush API Key.

Path Parameters

chainName
string
required

The chain name eg: eth-mainnet.

quoteCurrency
string
required

The currency to convert. Supports USD, CAD, EUR, SGD, INR, JPY, VND, CNY, KRW, RUB, TRY, NGN, ARS, AUD, CHF, and GBP.

contractAddress
string
required

Contract address for the token. Passing in an ENS, RNS, Lens Handle, or an Unstoppable Domain resolves automatically. Supports multiple contract addresses separated by commas.

Query Parameters

from
string

The start day of the historical price range (YYYY-MM-DD).

to
string

The end day of the historical price range (YYYY-MM-DD).

prices-at-asc
boolean

Sort the prices in chronological ascending order. By default, it's set to false and returns prices in chronological descending order.

Response

200 - application/json
Successful response

The response is of type object.