Getting Started
Querying the Indexer
To query against the Indexer's GraphQL API simply make a POST request the indexer query url.
https://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 a Zora NFT
To fetch the rich information from Zora NFTs, use the Media table. The example query fetches the last 100 NFTs minted on the Zora Media contract.
Media(order_by: { tokenId: desc}, limit: 100){
tokenId
creator
creatorBidShare
owner
contentURI
metadataURI
contentHash
metadataHash
metadata {
json
}
}
Fetching any NFT
You can directly query for any NFT by querying the Token table. The example query fetches the first 100 tokenIds for the Blitmap collection. You can check to see which NFT contracts are supported by querying the TokenContract table.
Token(where: { address: { _eq: "0x8d04a8c79cEB0889Bdd12acdF3Fa9D207eD3Ff63"}}, order_by: { tokenId: asc} limit: 100){
tokenId
address
minter
owner
metadata {
json
}
}
Fetching a Zora Auction
You can query for a Zora Auction by using the Auction table. The example query 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
}
Last updated
Was this helpful?