Skip to main content

Introduction

Quick retrieval of NFT and ZORA related data#

ZORA maintains its own indexer that serves a GraphQL API and provides information about the ZORA protocol and the broader NFT ecosystem.

The Indexer watches the blockchain and regularly fetches NFT metadata data which makes it easy to query NFTs by their metadata properties. The Indexer currently watches the Ethereum Mainnet and the Rinkeby Testnest but will be extended to include other EVM networks in the future.

note

You can begin making queries in ZORA's hosted GraphQL playground.

Querying the Indexer#

Make a POST request to the indexer url to query against the Indexer's GraphQL API.

# Ethereum Mainnethttps://indexer-prod-mainnet.ZORA.co/v1/graphql

If you are making an unauthenticated request, make sure to include X-Hasura-Role: anonymous in the header of the request.

Fetching any NFT#

You can directly view ERC-721 NFTs by querying the Token table. The example query below fetches the first 100 Blitmap tokenIds . Querying the TokenContract table will return all the currently supported NFT contract addresses.

{  Token(    where: { address: { _eq: "0x8d04a8c79cEB0889Bdd12acdF3Fa9D207eD3Ff63" } }    order_by: { tokenId: asc }    limit: 100  ) {    tokenId    address    minter    owner    metadata {      json    }  }}

Fetching a zNFT#

You can use the Media table to fetch information on ZORA NFTs (zNFTs). The example query below fetches the last 100 NFTs minted out of the ZORA Media contract.

{  Media(order_by: { tokenId: desc }, limit: 100) {    tokenId    creator    creatorBidShare    owner    contentURI    metadataURI    contentHash    metadataHash    metadata {      json    }  }}

Fetching a ZORA Auction#

You can query for a ZORA Auction by using the Auction table. The example query below fetches the auctions that have had their reserve price met, but have not been finalized (listed in order of auctionId).

{  Auction(    where: { lastBidder: { _is_null: false }, _not: { endedEvent: {} } }    order_by: { auctionId: desc }    limit: 10  ) {    tokenContract    tokenId    tokenOwner    auctionCurrency    reservePrice    curator    curatorFee    approved    expiresAt    winner    lastBidder    lastBidAmount  }}