GraphQL (deprecated)
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.
1
query {
2
blockchains {
3
count
4
}
5
}
Copied!
You can also get more specific information about a single blockchain.
Query 1
Query 2
1
query {
2
blockchains(limit: 5, offset: 0) {
3
count
4
results {
5
id
6
name
7
subnet
8
vm
Copied!
1
query {
2
blockchains(id: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM") {
3
count
4
results {
5
id
6
name
7
subnet
8
vmID
9
}
10
}
11
}
Copied!

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:
1
query {
2
transactions(
3
assetID: "3ofDwYQKgBvsZQTBXJnqdvcns4aGikwSnGie2kc6xWJM7MAGb"
4
limit: 10
5
offset: 0
6
orderBy: { acceptedAt: "desc" }
7
) {
8
count
9
results {
10
... on XBaseTransaction {
11
inputs {
12
output {
13
id
14
transactionID
15
outputIndex
16
assetID
17
outputType
18
amount
19
locktime
20
threshold
21
addresses
22
redeemingTransactionID
23
type
24
}
25
credentials {
26
address
27
publicKey
28
signature
29
}
30
}
31
outputs {
32
id
33
transactionID
34
outputIndex
35
assetID
36
outputType
37
amount
38
locktime
39
threshold
40
addresses
41
redeemingTransactionID
42
type
43
}
44
id
45
chainID
46
type
47
acceptedAt
48
inputs {
49
output {
50
id
51
transactionID
52
outputIndex
53
assetID
54
outputType
55
amount
56
locktime
57
threshold
58
addresses
59
redeemingTransactionID
60
type
61
}
62
credentials {
63
address
64
publicKey
65
signature
66
}
67
}
68
outputs {
69
id
70
transactionID
71
outputIndex
72
assetID
73
outputType
74
amount
75
locktime
76
threshold
77
addresses
78
redeemingTransactionID
79
type
80
}
81
}
82
... on XCreateAssetTransaction {
83
inputs {
84
output {
85
id
86
transactionID
87
outputIndex
88
assetID
89
outputType
90
amount
91
locktime
92
threshold
93
addresses
94
redeemingTransactionID
95
type
96
}
97
credentials {
98
address
99
publicKey
100
signature
101
}
102
}
103
outputs {
104
id
105
transactionID
106
outputIndex
107
assetID
108
outputType
109
amount
110
locktime
111
threshold
112
addresses
113
redeemingTransactionID
114
type
115
}
116
id
117
chainID
118
type
119
acceptedAt
120
}
121
... on XExportTransaction {
122
inputs {
123
output {
124
id
125
transactionID
126
outputIndex
127
assetID
128
outputType
129
amount
130
locktime
131
threshold
132
addresses
133
redeemingTransactionID
134
type
135
}
136
credentials {
137
address
138
publicKey
139
signature
140
}
141
}
142
outputs {
143
id
144
transactionID
145
outputIndex
146
assetID
147
outputType
148
amount
149
locktime
150
threshold
151
addresses
152
redeemingTransactionID
153
type
154
}
155
id
156
chainID
157
type
158
acceptedAt
159
}
160
... on XImportTransaction {
161
inputs {
162
output {
163
id
164
transactionID
165
outputIndex
166
assetID
167
outputType
168
amount
169
locktime
170
threshold
171
addresses
172
redeemingTransactionID
173
type
174
}
175
credentials {
176
address
177
publicKey
178
signature
179
}
180
}
181
outputs {
182
id
183
transactionID
184
outputIndex
185
assetID
186
outputType
187
amount
188
locktime
189
threshold
190
addresses
191
redeemingTransactionID
192
type
193
}
194
id
195
chainID
196
type
197
acceptedAt
198
}
199
}
200
}
201
}
Copied!
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:
1
query {
2
transactions(
3
assetID: "3ofDwYQKgBvsZQTBXJnqdvcns4aGikwSnGie2kc6xWJM7MAGb"
4
limit: 10
5
offset: 0
6
orderBy: { acceptedAt: "desc" }
7
) {
8
count
9
results {
10
... on XBaseTransaction {
11
inputs {
12
output {
13
id
14
transactionID
15
outputIndex
16
assetID
17
outputType
18
amount
19
locktime
20
threshold
21
addresses
22
redeemingTransactionID
23
type
24
}
25
credentials {
26
address
27
publicKey
28
signature
29
}
30
}
31
outputs {
32
id
33
transactionID
34
outputIndex
35
assetID
36
outputType
37
amount
38
locktime
39
threshold
40
addresses
41
redeemingTransactionID
42
type
43
}
44
id
45
chainID
46
type
47
acceptedAt
48
inputs {
49
output {
50
id
51
transactionID
52
outputIndex
53
assetID
54
outputType
55
amount
56
locktime
57
threshold
58
addresses
59
redeemingTransactionID
60
type
61
}
62
credentials {
63
address
64
publicKey
65
signature
66
}
67
}
68
outputs {
69
id
70
transactionID
71
outputIndex
72
assetID
73
outputType
74
amount
75
locktime
76
threshold
77
addresses
78
redeemingTransactionID
79
type
80
}
81
}
82
... on XCreateAssetTransaction {
83
inputs {
84
output {
85
id
86
transactionID
87
outputIndex
88
assetID
89
outputType
90
amount
91
locktime
92
threshold
93
addresses
94
redeemingTransactionID
95
type
96
}
97
credentials {
98
address
99
publicKey
100
signature
101
}
102
}
103
outputs {
104
id
105
transactionID
106
outputIndex
107
assetID
108
outputType
109
amount
110
locktime
111
threshold
112
addresses
113
redeemingTransactionID
114
type
115
}
116
id
117
chainID
118
type
119
acceptedAt
120
}
121
... on XExportTransaction {
122
inputs {
123
output {
124
id
125
transactionID
126
outputIndex
127
assetID
128
outputType
129
amount
130
locktime
131
threshold
132
addresses
133
redeemingTransactionID
134
type
135
}
136
credentials {
137
address
138
publicKey
139
signature
140
}
141
}
142
outputs {
143
id
144
transactionID
145
outputIndex
146
assetID
147
outputType
148
amount
149
locktime
150
threshold
151
addresses
152
redeemingTransactionID
153
type
154
}
155
id
156
chainID
157
type
158
acceptedAt
159
}
160
... on XImportTransaction {
161
inputs {
162
output {
163
id
164
transactionID
165
outputIndex
166
assetID
167
outputType
168
amount
169
locktime
170
threshold
171
addresses
172
redeemingTransactionID
173
type
174
}
175
credentials {
176
address
177
publicKey
178
signature
179
}
180
}
181
outputs {
182
id
183
transactionID
184
outputIndex
185
assetID
186
outputType
187
amount
188
locktime
189
threshold
190
addresses
191
redeemingTransactionID
192
type
193
}
194
id
195
chainID
196
type
197
acceptedAt
198
}
199
}
200
}
201
}
Copied!
Or you can filter by address:
1
query {
2
transactions(
3
address: "X-avax149ssfat0569urv3xgppnz08ffrch5yjkzfs3xz"
4
limit: 10
5
offset: 0
6
orderBy: { acceptedAt: "desc" }
7
) {
8
count
9
results {
10
... on XBaseTransaction {
11
inputs {
12
output {
13
id
14
transactionID
15
outputIndex
16
assetID
17
outputType
18
amount
19
locktime
20
threshold
21
addresses
22
redeemingTransactionID
23
type
24
}
25
credentials {
26
address
27
publicKey
28
signature
29
}
30
}
31
outputs {
32
id
33
transactionID
34
outputIndex
35
assetID
36
outputType
37
amount
38
locktime
39
threshold
40
addresses
41
redeemingTransactionID
42
type
43
}
44
id
45
chainID
46
type
47
acceptedAt
48
inputs {
49
output {
50
id
51
transactionID
52
outputIndex
53
assetID
54
outputType
55
amount
56
locktime
57
threshold
58
addresses
59
redeemingTransactionID
60
type
61
}
62
credentials {
63
address
64
publicKey
65
signature
66
}
67
}
68
outputs {
69
id
70
transactionID
71
outputIndex
72
assetID
73
outputType
74
amount
75
locktime
76
threshold
77
addresses
78
redeemingTransactionID
79
type
80
}
81
}
82
... on XCreateAssetTransaction {
83
inputs {
84
output {
85
id
86
transactionID
87
outputIndex
88
assetID
89
outputType
90
amount
91
locktime
92
threshold
93
addresses
94
redeemingTransactionID
95
type
96
}
97
credentials {
98
address
99
publicKey
100
signature
101
}
102
}
103
outputs {
104
id
105
transactionID
106
outputIndex
107
assetID
108
outputType
109
amount
110
locktime
111
threshold
112
addresses
113
redeemingTransactionID
114
type
115
}
116
id
117
chainID
118
type
119
acceptedAt
120
}
121
... on XExportTransaction {
122
inputs {
123
output {
124
id
125
transactionID
126
outputIndex
127
assetID
128
outputType
129
amount
130
locktime
131
threshold
132
addresses
133
redeemingTransactionID
134
type
135
}
136
credentials {
137
address
138
publicKey
139
signature
140
}
141
}
142
outputs {
143
id
144
transactionID
145
outputIndex
146
assetID
147
outputType
148
amount
149
locktime
150
threshold
151
addresses
152
redeemingTransactionID
153
type
154
}
155
id
156
chainID
157
type
158
acceptedAt
159
}
160
... on XImportTransaction {
161
inputs {
162
output {
163
id
164
transactionID
165
outputIndex
166
assetID
167
outputType
168
amount
169
locktime
170
threshold
171
addresses
172
redeemingTransactionID
173
type
174
}
175
credentials {
176
address
177
publicKey
178
signature
179
}
180
}
181
outputs {
182
id
183
transactionID
184
outputIndex
185
assetID
186
outputType
187
amount
188
locktime
189
threshold
190
addresses
191
redeemingTransactionID
192
type
193
}
194
id
195
chainID
196
type
197
acceptedAt
198
}
199
}
200
}
201
}
Copied!

Address outputs

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.
1
query {
2
outputs: outputs(address: "X-avax149ssfat0569urv3xgppnz08ffrch5yjkzfs3xz") {
3
count
4
results {
5
... on XOutput {
6
id
7
transactionID
8
outputIndex
9
assetID
10
outputType
11
amount
12
locktime
13
threshold
14
addresses
15
redeemingTransactionID
16
type
17
}
18
}
19
}
20
}
Copied!

Get the list of validators

Get a complete list of validators, both active and pending. You can order the result by startTime, endTime, weight, address, subnet or id.
1
query {
2
validators(
3
status: "active"
4
limit: 10
5
offset: 0
6
orderBy: { endTime: "asc" }
7
) {
8
count
9
results {
10
id
11
weight
12
beneficiary {
13
addresses
14
}
15
startTime
16
endTime
17
subnet
18
status
19
delegatedWeights
20
delegations
21
subnets {
22
weight
23
startTime
24
endTime
25
subnet
26
status
27
delegatedWeights
28
delegations
29
}
30
}
31
}
32
}
Copied!

Get the list of delegators

1
query {
2
transactions(
3
chainID: "p-chain"
4
limit: 10
5
type: "P_ADD_DEFAULT_SUBNET_DELEGATOR"
6
offset: 0
7
orderBy: { acceptedAt: "desc" }
8
) {
9
count
10
results {
11
... on PAddDefaultSubnetDelegator {
12
id
13
chainID
14
type
15
acceptedAt
16
weight
17
from
18
nodeID
19
beneficiary {
20
addresses
21
}
22
startTime
23
endTime
24
}
25
}
26
}
27
}
Copied!
The Avascan API Platform is still under heavy development, and many more endpoints will become available soon.
Join our Discord chat to stay updated and connect with the team, ask for new features or give feedback.
Last modified 6mo ago