How to get NFT token IDs via Covalent API

Makedonskiy
4 min readApr 22, 2021

--

In this quick tutorial, I’ll show you how to get a wide variety of data from the blockchain network using the Covalent API. How to get your own Covalent API for this actions, what information can be extracted using the covalent API in Covalent Docs, and much more.

Before you start working with the Covalent API in Covalent Docs, you need to get your API key. To get it, you need to go to https://www.covalenthq.com/ and register your account.

After completing the quick registration procedure, you will be able to receive your API key. It will look like this ( I hid the last few characters of my key because I’m greedy):

So now that you have obtained the required API key, you can start working in Covalent Docs.

Then I recommend that you familiarize yourself with the Overview tab to understand exactly what Covalent Docs are and how teams work. Then, by going to the Changelog tab,
You need to enter your API key before starting to get the information correctly. Some commands from ClassA can work without obtaining an API key, such as Get token balances for address and Get historical portfolio value over time.

Having done all the preparatory steps before working with the API, you can start working with more interesting options. In this article, we will cover the section Get NFT Token IDs.

Get NFT Token IDs real-time

GET /v1/{chain_id}/tokens/{address}/nft_token_ids/

Returns a list of all token IDs for a NFT contract on a blockchain network.

PATH PARAMETERS

  1. chain_id — in this field you need to enter the network in which you are going to work. Currently supports 1 for Ethereum Mainnet, 137 for Polygon/Matic Mainnet, 80001 for Polygon/Matic Mumbai Testnet, 56 for Binance Smart Chain, 43114 for Avalanche C-Chain Mainnet, 43113 for Fuji C-Chain Testnet, and 250 for Fantom Opera Mainnet.
  2. address — in this field you need to enter the smart contract address

QUERY-STRING PARAMETERS

  1. page-number — in this field you need to enter the specific page to be returned.
  2. page-size — in this field you need to enter the number of results per page.
  3. format — in this field you need to enter the format of response. CSV or JSON

As an example, I decided to consider Polkamon NTF tokens smart-contract. So I filled in the fields with the following data:

chain_id — 1

address — 0x85f0e02cb992aa1f9f47112f815f519ef1a59e2d

page-number — 3

page-size — 5

format — json

And then click TRY button

If everything was entered correctly, you will receive the following response:

You can find out exactly how to read the answer received a little below in the MODEL tab:

There is a large table with a description of all possible commands, as well as an example of a response in the tab EXAMPLE.

You should explore these two tabs for a deeper understanding and quality data analytics.

Depending on the conditions we set, we can see a certain number of NTF tokens of the contract we have chosen. We will also see brief information about these tokens such as their ID numbers:

This section of the Covalent API service can help when working with large amounts of blockchain data, but how exactly you use it depends only on your skills and imagination!

--

--