Skip to main content

Queries

Sample Queries

Get Collection Recent Transfers

Get the latest 10 transfers for a collection including Sender, Receiver, Token Identifier, Collection Name, Timestamp. If the transfer occured on a marketplace with a corresponding sale event, also include the Amount, Currency, and Platform

query CollectionRecentTransfers ($collection: String = "0x23581767a106ae21c074b2276d25e5c3e136a68b") {
transfers(
where: {collection: $collection}
,first: 10
,orderBy: timestamp
,orderDirection: desc) {
amount
timestamp
token {identifier}
senderAddress {id}
receiverAddress {id}
collection {name,id}
matchedSale {platform, currency {symbol}}
}
}

Get 7 Day Collection Metrics

Get the last the last 7 days metrics for a collection including: Total Sales, Total Volume, Average Sale Price, Highest Sale Price, Lowest Sale Price and Collection Name:

query CollectionDailyMetrics($collection: String = "0x23581767a106ae21c074b2276d25e5c3e136a68b") {
dailyCollectionSnapshots(
where: {collection: $collection}
,first: 7
,orderBy: timestamp
,orderDirection: desc) {
dailyAvgSale
dailyTransactions
dailyVolume
topSale
bottomSale
collection {name}
}
}

Get Single NFT History

Get the transfer and sale activity for a specific token (to provide the history when viewing said token)

query TokenHistory($tokenId: ID = "ethereum/0xdb3b2e1f699caf230ee75bfbe7d97d70f81bc945/4561") {
tokens(where: {id: $tokenId}, first: 10) {
id
transfers(orderBy: timestamp, orderDirection: desc, first: 10) {
receiverAddress {id}
senderAddress {id}
transaction {id}
matchedSale {
amount
currency {symbol}
platform
timestamp
}
}
}
}

Get Recent Sales for a Collection

query CollectionSales ($collection: String = "0xdb3b2e1f699caf230ee75bfbe7d97d70f81bc945") {
transfers(where: {collection: $collection, matchedSale_not: "null"}, orderBy: blockNumber, orderDirection: desc, first: 10) {
timestamp
amount
blockNumber
collection {name}
token {identifier,id}
transaction {id}
matchedSale {
platform
currency {symbol}
}
}
}

Get Collection Holders List

Gatheres a list of the top 1000 holders for a specific collection. If you want a list greater than 1000 you can use the auto pagination within the Graph Client.

query CollectionHolders ($collection: String! = "0xdb3b2e1f699caf230ee75bfbe7d97d70f81bc945") {
accountCollections(where: {collection: $collection}
,first: 1000
,orderBy: tokenCount
,orderDirection: desc) {
account {
id
}
collection {
name
}
tokenCount
}
}

Get NFTs for an Account

Gatheres a list of the NFT's owned by an Account

query AccountNFTs ($Account: [String!] = ["0x22d2072f52386183c493b7dc9497b3c2f2d62772"]) {
accounts(where: {id_in: $Account}) {
tokens {
identifier
id
collection {
id
name
}
}
}
}