Explore the Avalanche platform easily using Avascan's API endpoints. Docs will be updated weekly as we approach Avalanche mainnet. API is still under development.
API version 0.3
GraphQL APIs are deprecated for now. We will provide new APIs when our new Norge v2 indexer is complete.
Avascan API
Avascan is the most complete, fast and privacy-focused explorer for the Avalanche network. With Avascan API developers can build apps and tools. You can start queries by accessing the GraphQL Avascan API Playground.
Note: currently queries only show results for X-Chain. P-Chain and C-Chain are not indexed yet.
Blockchains
Avalanche is the 'internet of blockchains', and as such, you can browse and extract info about a given blockchain. Currently, there are only three permissionless blockchains nicknamed P-Chain, X-Chain and C-Chain. There are also permissioned blockchains, and both permissionless and permissioned will likely increase in number when the mainnet is launched. You can browse blockchains with a simple query: you will get the number of blockchains in the Avalanche network.
query{blockchains{count }}
You can also get more specific information about a single blockchain.
query {
blockchains(id: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM") {
count
results {
id
name
subnet
vmID
}
}
}
Transactions
If you want more info on a specific blockchain, query its transactions. Do it by passing the assetID and you can order it by any attribute, desc or asc. You need to specify the attributes you want to get in the result response, as shown below:
query {
transactions(
assetID: "3ofDwYQKgBvsZQTBXJnqdvcns4aGikwSnGie2kc6xWJM7MAGb"
limit: 10
offset: 0
orderBy: { acceptedAt: "desc" }
) {
count
results {
... on XBaseTransaction {
inputs {
output {
id
transactionID
outputIndex
assetID
outputType
amount
locktime
threshold
addresses
redeemingTransactionID
type
}
credentials {
address
publicKey
signature
}
}
outputs {
id
transactionID
outputIndex
assetID
outputType
amount
locktime
threshold
addresses
redeemingTransactionID
type
}
id
chainID
type
acceptedAt
inputs {
output {
id
transactionID
outputIndex
assetID
outputType
amount
locktime
threshold
addresses
redeemingTransactionID
type
}
credentials {
address
publicKey
signature
}
}
outputs {
id
transactionID
outputIndex
assetID
outputType
amount
locktime
threshold
addresses
redeemingTransactionID
type
}
}
... on XCreateAssetTransaction {
inputs {
output {
id
transactionID
outputIndex
assetID
outputType
amount
locktime
threshold
addresses
redeemingTransactionID
type
}
credentials {
address
publicKey
signature
}
}
outputs {
id
transactionID
outputIndex
assetID
outputType
amount
locktime
threshold
addresses
redeemingTransactionID
type
}
id
chainID
type
acceptedAt
}
... on XExportTransaction {
inputs {
output {
id
transactionID
outputIndex
assetID
outputType
amount
locktime
threshold
addresses
redeemingTransactionID
type
}
credentials {
address
publicKey
signature
}
}
outputs {
id
transactionID
outputIndex
assetID
outputType
amount
locktime
threshold
addresses
redeemingTransactionID
type
}
id
chainID
type
acceptedAt
}
... on XImportTransaction {
inputs {
output {
id
transactionID
outputIndex
assetID
outputType
amount
locktime
threshold
addresses
redeemingTransactionID
type
}
credentials {
address
publicKey
signature
}
}
outputs {
id
transactionID
outputIndex
assetID
outputType
amount
locktime
threshold
addresses
redeemingTransactionID
type
}
id
chainID
type
acceptedAt
}
}
}
}
Note: ordering by certain variables may not be available yet.
You can also filter the transactions to obtain the ones that are specific to a certain asset filtering by assetID:
Get a series of UTXO-related info for a specific address by including a redeemingTransactionID that shows if the output related to that address has already been spent.