Skip to content

NFT Indexer API

Abstract

This specifies a REST interface that can be implemented by indexing services to provide data about NFTs conforming to the ARC-72 standard.

Motivation

While most data is available on-chain, reading and analyzing on-chain logs to get a complete and current picture about NFT ownership and history is slow and impractical for many uses. This REST interface standard allows analysis of NFT contracts to be done in a centralized manner to provide fast, up-to-date responses to queries, while allowing users to pick from any indexing provider.

Specification

This specification defines two REST endpoints: /nft-index/v1/tokens and /nft-index/v1/transfers. Both endpoints respond only to GET requests, take no path parameters, and consume no input. But both accept a variety of query parameters.

GET /nft-indexer/v1/tokens

Produces application/json.

Optional Query Parameters:

NameSchemaDescription
roundintegerInclude results for the specified round. For performance reasons, this parameter may be disabled on some configurations.
nextstringToken for the next page of results. Use the next-token provided by the previous page of results.
limitintegerMaximum number of results to return. There could be additional pages even if the limit is not reached.
contractIdintegerLimit results to NFTs implemented by the given contract ID.
tokenIdintegerLimit results to NFTs with the given token ID.
owneraddressLimit results to NFTs owned by the given owner.
mint-min-roundintegerLimit results to NFTs minted on or after the given round.
mint-max-roundintegerLimit results to NFTs minted on or before the given round.

When successful, returns a response with code 200 and an object with the schema:

NameRequired?SchemaDescription
tokensrequired arrayArray of Token objects that fit the query parameters, as defined below.
current-roundrequiredintegerRound at which the results were computed.
next-tokenoptionalstringUsed for pagination, when making another request provide this token as the next parameter.

The Token object has the following schema:

NameRequired?SchemaDescription
ownerrequiredaddressThe current owner of the NFT.
contractIdrequiredintegerThe ID of the ARC-72 contract that defines the NFT.
tokenIdrequiredintegerThe tokenID of the NFT, which along with the contractId addresses a unique ARC-72 token.
mint-roundoptionalintegerThe round at which the NFT was minted (IE the round at which it was transferred from the zero address to the first owner).
metadataURIoptionalstringThe URI given for the token by the metadataURI API of the contract, if applicable.
metadataoptionalobjectThe result of resolving the metadataURI, if applicable and available.

When unsuccessful, returns a response with code 400 or 500 and an object with the schema:

NameRequired?Schema
dataoptionalobject
messagerequiredstring

GET /nft-indexer/v1/transfers

Produces application/json.

Optional Query Parameters:

NameSchemaDescription
roundintegerInclude results for the specified round. For performance reasons, this parameter may be disabled on some configurations.
nextstringToken for the next page of results. Use the next-token provided by the previous page of results.
limitintegerMaximum number of results to return. There could be additional pages even if the limit is not reached.
contractIdintegerLimit results to NFTs implemented by the given contract ID.
tokenIdintegerLimit results to NFTs with the given token ID.
useraddressLimit results to transfers where the user is either the sender or receiver.
fromaddressLimit results to transfers with the given address as the sender.
toaddressLimit results to transfers with the given address as the receiver.
min-roundintegerLimit results to transfers that were executed on or after the given round.
max-roundintegerLimit results to transfers that were executed on or before the given round.

When successful, returns a response with code 200 and an object with the schema:

NameRequired?SchemaDescription
transfersrequired arrayArray of Transfer objects that fit the query parameters, as defined below.
current-roundrequiredintegerRound at which the results were computed.
next-tokenoptionalstringUsed for pagination, when making another request provide this token as the next parameter.

The Transfer object has the following schema:

NameRequired?SchemaDescription
contractIdrequiredintegerThe ID of the ARC-72 contract that defines the NFT.
tokenIdrequiredintegerThe tokenID of the NFT, which along with the contractId addresses a unique ARC-72 token.
fromrequiredaddressThe sender of the transaction.
torequiredaddressThe receiver of the transaction.
roundrequiredintegerThe round of the transfer.

When unsuccessful, returns a response with code 400 or 500 and an object with the schema:

NameRequired?Schema
dataoptionalobject
messagerequiredstring

Rationale

This standard was designed to feel similar to the Algorand indexer API, and uses the same query parameters and results where applicable.

Backwards Compatibility

This standard presents a versioned REST interface, allowing future extensions to change the interface in incompatible ways while allowing for the old service to run in tandem.

Security Considerations

All data available through this indexer API is publicly available.

Copyright and related rights waived via CCO.