ZoraOS ☼☽
  • Introduction
  • Developer Tools
    • Smart Contracts
      • Whitepaper
    • ZDK
      • React Connecting Wallet
      • Zora Protocol
      • Auction House
      • Minting Media
      • Addresses
      • Users
      • Metadata
      • Utility
    • Indexer
      • Getting Started
      • Entities
    • Subgraph
    • Media Rendering
      • NFT Hooks
        • useZNFT
        • useNFTMetadata
        • useNFTContent
  • Guides
    • Connect to a Wallet
    • Build a marketplace
  • Community
    • Join our Discord
    • Support
    • Platforms using Zora
      • Catalog
      • Mirror
Powered by GitBook
On this page

Was this helpful?

  1. Developer Tools
  2. Indexer

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

 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
  }

PreviousIndexerNextEntities

Last updated 3 years ago

Was this helpful?

You can directly query for any NFT by querying the Token table. The example query fetches the first 100 tokenIds for the collection. You can check to see which NFT contracts are supported by querying the TokenContract table.

Blitmap