Skip to main content

Utility Endpoints

Get a block

Operation Identity:
  • Operation ID: getBlock
  • GET /v1/{chainName}/block_v2/{blockHeight}/
  • SDK: BaseService.getBlock()
Role: specialized | Credit Cost: 1 per call | API Type: REST Chains: All supported chains

Path Parameters

ParameterTypeRequiredDescription
chainNamestringYesThe chain name eg: eth-mainnet.
blockHeightstringYesThe block height or latest for the latest block available.

Response Fields

FieldTypeDescription
updated_atstringThe timestamp when the response was generated. Useful to show data staleness to users.
chain_idintegerThe requested chain ID eg: 1.
chain_namestringThe requested chain name eg: eth-mainnet.
itemsarrayList of response items.

Item Fields

FieldTypeDescription
block_hashstringThe hash of the block.
signed_atstringThe block signed timestamp in UTC.
heightintegerThe block height.
block_parent_hashstringThe parent block hash.
extra_datastringExtra data written to the block.
miner_addressstringThe address of the miner.
mining_costintegerThe associated mining cost.
gas_usedintegerThe associated gas used.
gas_limitintegerThe associated gas limit.
transactions_linkstringThe link to the related tx by block endpoint.
Credit Cost: 1 per call Processing: Realtime

Get all chain statuses

Operation Identity:
  • Operation ID: getAllChainStatus
  • GET /v1/chains/status/
  • SDK: BaseService.getAllChainStatus()
Role: specialized | Credit Cost: 1 per call | API Type: REST Chains: All supported chains

Response Fields

FieldTypeDescription
updated_atstringThe timestamp when the response was generated. Useful to show data staleness to users.
itemsarrayList of response items.

Item Fields

FieldTypeDescription
namestringThe chain name eg: eth-mainnet.
chain_idstringThe requested chain ID eg: 1.
is_testnetbooleanTrue if the chain is a testnet.
logo_urlstringA png logo url for the chain.
black_logo_urlstringA black png logo url for the chain.
white_logo_urlstringA white png logo url for the chain.
is_appchainbooleanTrue if the chain is an AppChain.
chain_tip_heightintegerThe height of the lastest block available.
chain_tip_signed_atstringThe signed timestamp of lastest block available.
has_databooleanTrue if the chain has data and ready for querying.
Credit Cost: 1 per call Processing: Realtime

Get all chains

Operation Identity:
  • Operation ID: getAllChains
  • GET /v1/chains/
  • SDK: BaseService.getAllChains()
Role: specialized | Credit Cost: 0.01 per call | API Type: REST Chains: All supported chains

Response Fields

FieldTypeDescription
updated_atstringThe timestamp when the response was generated. Useful to show data staleness to users.
itemsarrayList of response items.

Item Fields

FieldTypeDescription
namestringThe chain name eg: eth-mainnet.
chain_idstringThe requested chain ID eg: 1.
is_testnetbooleanTrue if the chain is a testnet.
db_schema_namestringSchema name to use for direct SQL.
labelstringThe chains label eg: Ethereum Mainnet.
category_labelstringThe category label eg: Ethereum.
logo_urlstringA png logo url for the chain.
black_logo_urlstringA black png logo url for the chain.
white_logo_urlstringA white png logo url for the chain.
color_themeobjectThe color theme for the chain.
is_appchainbooleanTrue if the chain is an AppChain.
appchain_ofobjectThe ChainItem the appchain is a part of.
Credit Cost: 0.01 per call Processing: Realtime

Get block heights

Operation Identity:
  • Operation ID: getBlockHeights
  • GET /v1/{chainName}/block_v2/{startDate}/{endDate}/
  • SDK: BaseService.getBlockHeights()
Role: specialized | Credit Cost: 1 per call | API Type: REST Chains: All supported chains

Path Parameters

ParameterTypeRequiredDescription
chainNamestringYesThe chain name eg: eth-mainnet.
startDatestringYesThe start date in YYYY-MM-DD format.
endDatestringYesThe end date in YYYY-MM-DD format or latest for the latest block available.

Query Parameters

ParameterTypeRequiredDefaultDescription
page-sizeintegerNo100Number of items per page. Omitting this parameter defaults to 100.
page-numberintegerNo-0-indexed page number to begin pagination.

Response Fields

FieldTypeDescription
updated_atstringThe timestamp when the response was generated. Useful to show data staleness to users.
chain_idintegerThe requested chain ID eg: 1.
chain_namestringThe requested chain name eg: eth-mainnet.
itemsarrayList of response items.
paginationobjectPagination metadata.

Item Fields

FieldTypeDescription
block_hashstringThe hash of the block.
signed_atstringThe block signed timestamp in UTC.
heightintegerThe block height.
block_parent_hashstringThe parent block hash.
extra_datastringExtra data written to the block.
miner_addressstringThe address of the miner.
mining_costintegerThe associated mining cost.
gas_usedintegerThe associated gas used.
gas_limitintegerThe associated gas limit.
transactions_linkstringThe link to the related tx by block endpoint.

Pagination Fields

FieldTypeDescription
has_morebooleanTrue if there is another page.
page_numberintegerThe requested page number.
page_sizeintegerThe requested number of items on the current page.
total_countintegerThe total number of items across all pages for this request.
Credit Cost: 1 per call Processing: Realtime

Get gas prices

Operation Identity:
  • Operation ID: getGasPrices
  • GET /v1/{chainName}/event/{eventType}/gas_prices/
  • SDK: BaseService.getGasPrices()
Role: primary | Credit Cost: 1 per call | API Type: REST Chains: All supported chains

Path Parameters

ParameterTypeRequiredDescription
chainNamestringYesThe chain name eg: eth-mainnet.
eventTypestringYesThe desired event type to retrieve gas prices for. Supports erc20 transfer events, uniswapv3 swap events and nativetokens transfers.

Query Parameters

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

Response Fields

FieldTypeDescription
chain_idintegerThe requested chain ID eg: 1.
chain_namestringThe requested chain name eg: eth-mainnet.
quote_currencystringThe requested quote currency eg: USD.
updated_atstringThe timestamp when the response was generated. Useful to show data staleness to users.
event_typestringThe requested event type.
gas_quote_ratenumberThe exchange rate for the requested quote currency.
base_feestringb;The lowest gas fee for the latest block height.
itemsarrayList of response items.

Item Fields

FieldTypeDescription
gas_pricestringThe average gas price, in WEI, for the time interval.
gas_spentstringThe average gas spent for the time interval.
gas_quotenumberThe average gas spent in quote-currency denomination for the time interval.
other_feesobjectOther fees, when applicable. For example: OP chain L1 fees.
total_gas_quotenumberThe sum of the L1 and L2 gas spent, in quote-currency, for the specified time interval.
pretty_total_gas_quotestringA prettier version of the total average gas spent, in quote-currency, for the specified time interval, for rendering purposes.
intervalstringThe specified time interval.
Credit Cost: 1 per call Processing: Batch
Note: Currently support these event types: erc20 token transfers, nativetokens transfer, and uniswapv3 swap events.
How to Fetch Onchain Gas Prices and Estimate Gas Costs

Get historical token prices

Operation Identity:
  • Operation ID: getTokenPrices
  • GET /v1/pricing/historical_by_addresses_v2/{chainName}/{quoteCurrency}/{contractAddress}/
  • SDK: PricingService.getTokenPrices()
Role: primary | Credit Cost: 1 per call | API Type: REST Chains: All supported chains

Path Parameters

ParameterTypeRequiredDescription
chainNamestringYesThe chain name eg: eth-mainnet.
quoteCurrencystringYesThe currency to convert. Supports USD, CAD, EUR, SGD, INR, JPY, VND, CNY, KRW, RUB, TRY, NGN, ARS, AUD, CHF, and GBP.
contractAddressstringYesContract 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

ParameterTypeRequiredDefaultDescription
fromstringNo-The start day of the historical price range (YYYY-MM-DD).
tostringNo-The end day of the historical price range (YYYY-MM-DD).
prices-at-ascbooleanNo-Sort the prices in chronological ascending order. By default, it’s set to false and returns prices in chronological descending order.

Response Fields

FieldTypeDescription
contract_decimalsintegerUse contract decimals to format the token balance for display purposes - divide the balance by 10^{contract_decimals}.
contract_namestringThe string returned by the name() method.
contract_ticker_symbolstringThe ticker symbol for this contract. This field is set by a developer and non-unique across a network.
contract_addressstringUse the relevant contract_address to lookup prices, logos, token transfers, etc.
supports_ercarrayA list of supported standard ERC interfaces, eg: ERC20 and ERC721.
update_atstring
quote_currencystringThe requested quote currency eg: USD.
logo_urlsobjectThe contract logo URLs.
itemsarrayList of response items.

Logo Url Fields

FieldTypeDescription
token_logo_urlstringThe token logo URL.
protocol_logo_urlstringThe protocol logo URL.
chain_logo_urlstringThe chain logo URL.

Item Fields

FieldTypeDescription
datestringThe date of the price capture.
pricenumberThe price in the requested quote-currency.
pretty_pricestringA prettier version of the price for rendering purposes.
Credit Cost: 1 per call Processing: Batch
Note: 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.

Get log events by contract address

Operation Identity:
  • Operation ID: getLogEventsByAddress
  • GET /v1/{chainName}/events/address/{contractAddress}/
  • SDK: BaseService.getLogEventsByAddress()
Role: specialized | Credit Cost: 0.01 per item | API Type: REST Chains: All supported chains

Path Parameters

ParameterTypeRequiredDescription
chainNamestringYesThe chain name eg: eth-mainnet.
contractAddressstringYesThe requested contract address. Passing in an ENS, RNS, Lens Handle, or an Unstoppable Domain resolves automatically.

Query Parameters

ParameterTypeRequiredDefaultDescription
starting-blockintegerNo-The first block to retrieve log events with. Accepts decimals, hexadecimals, or the strings earliest and latest.
ending-blockstringNo-The last block to retrieve log events with. Accepts decimals, hexadecimals, or the strings earliest and latest.
page-sizeintegerNo100Number of items per page. Omitting this parameter defaults to 100.
page-numberintegerNo-0-indexed page number to begin pagination.

Response Fields

FieldTypeDescription
updated_atstringThe timestamp when the response was generated. Useful to show data staleness to users.
chain_idintegerThe requested chain ID eg: 1.
chain_namestringThe requested chain name eg: eth-mainnet.
itemsarrayList of response items.
paginationobjectPagination metadata.

Item Fields

FieldTypeDescription
block_signed_atstringThe block signed timestamp in UTC.
block_heightintegerThe height of the block.
tx_offsetintegerThe offset is the position of the tx in the block.
log_offsetintegerThe offset is the position of the log entry within an event log.
tx_hashstringThe requested transaction hash.
raw_log_topicsarray<string>The log topics in raw data.
sender_contract_decimalsintegerUse contract decimals to format the token balance for display purposes - divide the balance by 10^{contract_decimals}.
sender_namestringThe name of the sender.
sender_contract_ticker_symbolstring
sender_addressstringThe address of the sender.
sender_logo_urlstringThe contract logo URL.
supports_ercarray<string>A list of supported standard ERC interfaces, eg: ERC20 and ERC721.
sender_factory_addressstringThe address of the deployed UniswapV2 like factory contract for this DEX.
raw_log_datastringThe log events in raw.
decodedobjectThe decoded item.

Pagination Fields

FieldTypeDescription
has_morebooleanTrue if there is another page.
page_numberintegerThe requested page number.
page_sizeintegerThe requested number of items on the current page.
total_countintegerThe total number of items across all pages for this request.
Credit Cost: 0.01 per item Processing: Realtime

Get log events by topic hash(es)

Operation Identity:
  • Operation ID: getLogEventsByTopicHash
  • GET /v1/{chainName}/events/topics/{topicHash}/
  • SDK: BaseService.getLogEventsByTopicHash()
Role: specialized | Credit Cost: 0.01 per item | API Type: REST Chains: All supported chains

Path Parameters

ParameterTypeRequiredDescription
chainNamestringYesThe chain name eg: eth-mainnet.
topicHashstringYesThe endpoint will return event logs that contain this topic hash.

Query Parameters

ParameterTypeRequiredDefaultDescription
starting-blockintegerNo-The first block to retrieve log events with. Accepts decimals, hexadecimals, or the strings earliest and latest.
ending-blockstringNo-The last block to retrieve log events with. Accepts decimals, hexadecimals, or the strings earliest and latest.
secondary-topicsstringNo-Additional topic hash(es) to filter on - padded & unpadded address fields are supported. Separate multiple topics with a comma.
page-sizeintegerNo100Number of items per page. Omitting this parameter defaults to 100.
page-numberintegerNo-0-indexed page number to begin pagination.

Response Fields

FieldTypeDescription
updated_atstringThe timestamp when the response was generated. Useful to show data staleness to users.
chain_idintegerThe requested chain ID eg: 1.
chain_namestringThe requested chain name eg: eth-mainnet.
chain_tip_heightintegerThe latest block height of the blockchain at the time this response was provided.
chain_tip_signed_atstringThe timestamp of the latest signed block at the time this response was provided.
itemsarrayList of response items.
paginationobjectPagination metadata.

Item Fields

FieldTypeDescription
block_signed_atstringThe block signed timestamp in UTC.
block_heightintegerThe height of the block.
tx_offsetintegerThe offset is the position of the tx in the block.
log_offsetintegerThe offset is the position of the log entry within an event log.
tx_hashstringThe requested transaction hash.
raw_log_topicsarray<string>The log topics in raw data.
sender_contract_decimalsintegerUse contract decimals to format the token balance for display purposes - divide the balance by 10^{contract_decimals}.
sender_namestringThe name of the sender.
sender_contract_ticker_symbolstring
sender_addressstringThe address of the sender.
sender_logo_urlstringThe contract logo URL.
supports_ercarray<string>A list of supported standard ERC interfaces, eg: ERC20 and ERC721.
sender_factory_addressstringThe address of the deployed UniswapV2 like factory contract for this DEX.
raw_log_datastringThe log events in raw.
decodedobjectThe decoded item.

Pagination Fields

FieldTypeDescription
has_morebooleanTrue if there is another page.
page_numberintegerThe requested page number.
page_sizeintegerThe requested number of items on the current page.
total_countintegerThe total number of items across all pages for this request.
Credit Cost: 0.01 per item Processing: Realtime

Get logs

Operation Identity:
  • Operation ID: getLogs
  • GET /v1/{chainName}/events/
  • SDK: BaseService.getLogs()
Role: primary | Credit Cost: 0.01 per item | API Type: REST Chains: All supported chains

Path Parameters

ParameterTypeRequiredDescription
chainNamestringYesThe chain name eg: eth-mainnet.

Query Parameters

ParameterTypeRequiredDefaultDescription
starting-blockintegerNo-The first block to retrieve log events with. Accepts decimals, hexadecimals, or the strings earliest and latest.
ending-blockstringNo-The last block to retrieve log events with. Accepts decimals, hexadecimals, or the strings earliest and latest.
addressstringNo-The address of the log events sender contract.
topicsstringNo-The topic hash(es) to retrieve logs with.
block-hashstringNo-The block hash to retrieve logs for.
skip-decodebooleanNo-Omit decoded log events.

Response Fields

FieldTypeDescription
updated_atstringThe timestamp when the response was generated. Useful to show data staleness to users.
chain_idintegerThe requested chain ID eg: 1.
chain_namestringThe requested chain name eg: eth-mainnet.
chain_tip_heightintegerThe latest block height of the blockchain at the time this response was provided.
chain_tip_signed_atstringThe timestamp of the latest signed block at the time this response was provided.
itemsarrayList of response items.

Item Fields

FieldTypeDescription
block_signed_atstringThe block signed timestamp in UTC.
block_heightintegerThe height of the block.
block_hashstringThe hash of the block.
tx_offsetintegerThe offset is the position of the tx in the block.
log_offsetintegerThe offset is the position of the log entry within an event log.
tx_hashstringThe requested transaction hash.
raw_log_topicsarray<string>The log topics in raw data.
sender_contract_decimalsintegerUse contract decimals to format the token balance for display purposes - divide the balance by 10^{contract_decimals}.
sender_namestringThe name of the sender.
sender_contract_ticker_symbolstringThe ticker symbol for the sender. This field is set by a developer and non-unique across a network.
sender_addressstringThe address of the sender.
supports_ercarray<string>A list of supported standard ERC interfaces, eg: ERC20 and ERC721.
sender_logo_urlstringThe contract logo URL.
sender_factory_addressstringThe address of the deployed UniswapV2 like factory contract for this DEX.
raw_log_datastringThe log events in raw.
decodedobjectThe decoded item.
Credit Cost: 0.01 per item Processing: Realtime
Note: Limits:
  • For a block range of 2,000 blocks or less, the response will include all logs within the range.
  • For a block range greater than 2,000 blocks:- The response will include up to 10,000 logs.
  • If the number of logs exceeds 10,000, no logs will be included in the response. Instead, the response will contain a suggested range within the info object, including a link and message.

Get pool spot prices

Operation Identity:
  • Operation ID: getPoolSpotPrices
  • GET /v1/pricing/spot_prices/{chainName}/pools/{contractAddress}/
  • SDK: PricingService.getPoolSpotPrices()
Role: specialized | Credit Cost: 1 per call | API Type: REST Chains: eth-mainnet, matic-mainnet, base-mainnet, optimism-mainnet, bsc-mainnet, gnosis-mainnet

Path Parameters

ParameterTypeRequiredDescription
chainNamestringYesThe chain name eg: eth-mainnet.
contractAddressstringYesThe pool contract address.

Query Parameters

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

Response Fields

FieldTypeDescription
updated_atstringThe timestamp when the response was generated.
pool_addressstringThe deployed pool contract address.
token_0_addressstringThe deployed contract address of token_0 in the token pair making up the pool.
token_0_namestringThe deployed contract name of token_0 in the token pair making up the pool.
token_0_tickerstringThe deployed contract symbol of token_0 in the token pair making up the pool.
token_0_pricestringPrice of token_0 in units of token_1.
token_0_price_24hstringPrice of token_0 in units of token_1 as of 24 hours ago.
token_0_price_quotestringPrice of token_0 in the selected quote currency (defaults to USD).
token_0_price_24h_quotestringPrice of token_0 in the selected quote currency (defaults to USD) as of 24 hours ago.
token_1_addressstringThe deployed contract address of token_1 in the token pair making up the pool.
token_1_namestringThe deployed contract name of token_1 in the token pair making up the pool.
token_1_tickerstringThe deployed contract symbol of token_1 in the token pair making up the pool.
token_1_pricestringPrice of token_1 in units of token_0.
token_1_price_24hstringPrice of token_1 in units of token_0 as of 24 hours ago.
token_1_price_quotestringPrice of token_1 in the selected quote currency (defaults to USD).
token_1_price_24h_quotestringPrice of token_1 in the selected quote currency (defaults to USD) as of 24 hours ago.
quote_currencystringThe currency to convert. Supports USD, CAD, EUR, SGD, INR, JPY, VND, CNY, KRW, RUB, TRY, NGN, ARS, AUD, CHF, GBP, BTC and ETH.
Credit Cost: 1 per call Processing: Batch
Note: Supports pools on Uniswap V2, V3 and their forks on all Foundational Chains.

Get resolved address for registered address

Operation Identity:
  • Operation ID: getResolvedAddress
  • GET /v1/{chainName}/address/{walletAddress}/resolve_address/
  • SDK: BaseService.getResolvedAddress()
Role: primary | Credit Cost: 1 per call | API Type: REST Chains: eth-mainnet, axie-mainnet, base-mainnet, matic-mainnet

Path Parameters

ParameterTypeRequiredDescription
chainNamestringYesThe chain name eg: eth-mainnet.
walletAddressstringYesThe requested address. Passing in an ENS, RNS, Lens Handle, or an Unstoppable Domain resolves automatically.

Response Fields

FieldTypeDescription
updated_atstringThe timestamp when the response was generated. Useful to show data staleness to users.
chain_idintegerThe requested chain ID eg: 1.
chain_namestringThe requested chain name eg: eth-mainnet.
itemsarrayList of response items.

Item Fields

FieldTypeDescription
addressstringThe requested address.
namestring
Credit Cost: 1 per call Processing: Realtime How to Resolve a Wallet Address Given an ENS Domain

Enhanced Spam Lists

The GoldRush Enhanced Spam Lists are a public good designed to restore trust and transparency in the Web3 ecosystem by helping developers, explorers, wallets, and indexers protect their users from scam tokens and malicious contracts. The Enhanced Spam Lists can be accessed as an npm package.
Note: This package requires Node.js v18 or above.

Step 1. Install the Package

You can install the package using npm, yarn or pnpm:
npm
npm install @covalenthq/goldrush-enhanced-spam-lists
yarn
yarn add @covalenthq/goldrush-enhanced-spam-lists
pnpm
pnpm add @covalenthq/goldrush-enhanced-spam-lists

Step 2. Use Cases

Verify if an ERC20 token is spam on a given network
        import {
            Networks,
            isERC20Spam,
        } from "@covalenthq/goldrush-enhanced-spam-lists";

        // With default options
        const isSpam = await isERC20Spam("0xTokenAddress", Networks.ETHEREUM_MAINNET);
        console.log(isSpam);
For a potential spam check for an ERC20 token, Confidence.MAYBE can be used
        import {
            Confidence,
            Networks,
            isERC20Spam,
        } from "@covalenthq/goldrush-enhanced-spam-lists";

        const isPotentialSpam = await isERC20Spam(
            "0xTokenAddress",
            Networks.POLYGON_MAINNET,
            Confidence.MAYBE
        );
        console.log(isPotentialSpam);
Verify if an NFT token is spam on a given network
        import {
                Networks,
                isNFTSpam,
        } from "@covalenthq/goldrush-enhanced-spam-lists";

        const isNftSpam = await isNFTSpam("0xNftAddress", Networks.BSC_MAINNET);
        console.log(isNftSpam);
Control caching behavior
        import {
            Networks,
            Confidence,
            isERC20Spam,
            clearCache,
        } from "@covalenthq/goldrush-enhanced-spam-lists";

        // With caching enabled (default)
        const withCache = await isERC20Spam(
            "0xTokenAddress",
            Networks.ETHEREUM_MAINNET,
            Confidence.YES,
            true // Enable caching (default)
        );

        // Without caching (always fetches fresh data)
        const withoutCache = await isERC20Spam(
            "0xTokenAddress",
            Networks.ETHEREUM_MAINNET,
            Confidence.YES,
            false // Disable caching
        );

        // Clear memory and disk cache if needed
        clearCache();
For more control, you can get the full lists:
        import {
            getERC20List,
            getNFTList,
            Confidence,
            Networks,
        } from "@covalenthq/goldrush-enhanced-spam-lists";

        // Get ERC20 spam list with default caching
        const ethSpamTokens = await getERC20List(Networks.ETHEREUM_MAINNET, Confidence.YES);

        // Get NFT spam list with caching disabled
        const bscSpamNfts = await getNFTList(Networks.BSC_MAINNET, false);
Get the specific spam score for a given contract
        import {
            getERC20List,
            getSpamScore,
            Networks,
            Confidence,
        } from "@covalenthq/goldrush-enhanced-spam-lists";

        const ethSpamTokens = await getERC20List(
        Networks.ETHEREUM_MAINNET,
        Confidence.YES
        );
        const score = getSpamScore(ethSpamTokens[0]);
        console.log(score); // Returns the spam score as a string