POA Forum

Drilldown on the tokenlist API

Looking at the ?module=token API, I noticed that the API doesn’t give the option to drill down to see which specific NFTs an address is owner of. Is this something that is possible using the API? I’m specifically interested in the tokenIds of non-fungibles.

Hi, there are 2 endpoints where we can add token ID of NFT:

Get list of tokens owned by address.
?module= account &action= tokenlist &address={ addressHash }

For instance,
https://blockscout.com/eth/mainnet/api?module=account&action=tokenlist&address=0x85b2ed29f641069688241263c9d007cb9f11f3e4

Get token transfer events by address. Up to a maximum of 10,000 token transfer events. Also available through a GraphQL ‘token_transfers’ query.
?module= account &action= tokentx &address={ addressHash }

For instance,
https://blockscout.com/eth/mainnet/api?module=account&action=tokentx&address=0x85b2ed29f641069688241263c9d007cb9f11f3e4

We can easily add a token ID to the 2nd endpoint. It would be more tricky to add to the 1st one because tokenID is not in a set of tables that this endpoint uses and we need to test an endpoint from a performance perspective. If one of the endpoints with token ID will satisfy your needs, could you please create an issue on a GitHub and we will start work on that?