Build more with QuickNode - New pricing plans and a free tier! Read the press release

Contents

qn_getTokenMetadataBySymbol RPC method

The API credit value for this method is 4 . To learn more about API credits and each method's value, visit the API Credits page.

Supports ERC-20 compliant contracts (on Ethereum mainnet).

Headers:

  1. x-qn-api-version — (Integer - optional) Provide an optional request header specifying the QuickNode API version you're targeting. Using this header is recommended as it will become mandatory (required) in the future. Current API version is 1.

Parameters:

  1. Object — Custom Object with the following fields:

    symbol — (String) The ERC-20 token symbol you'd like to get details for.

    page — (Integer - optional) The page number you would like returned. Page numbers start at 1 and end at "totalPages". If omitted, defaults to the first page (page 1). If the page number requested is higher than "totalPages", an empty tokens array will be returned. If the page number requested is less than 1, an invalid params response will be returned.

    perPage — (Integer - optional) The maximum amount of tokens to return on each page. You can request up to 100 items per page. If omitted, defaults to 40 items per page.

Returns:

  1. Object — Custom Response Object, or null if no Token details found:

    tokens — An array of objects representing tokens matching the supplied symbol.

    name — The name of this token.

    symbol — The symbol of this token.

    address — The contract address of this token.

    decimals — The number of decimals this token utilizes.

    genesisBlock — The block number in which this contract was deployed.

    genesisTransaction — The hash of the transaction in which this contract was deployed.

    totalItems — The total number of tokens matching the supplied symbol.

    totalPages — The total number of results pages available.

    pageNumber — The page number of results that was returned with this response.

Code Examples:

from web3 import Web3, HTTPProvider
OPTIONS = {
  'headers':
    {
      'x-qn-api-version': '1'
    }
}
w3 = Web3(HTTPProvider('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/', request_kwargs=OPTIONS))
resp = w3.provider.make_request('qn_getTokenMetadataBySymbol', {
  "symbol": "USDC"
})
print(resp)
Ready to try QuickNode? Get Started