Query Data With Postman
If you're familiar with Postman, query data from OCAP service is just a cake.
Use https://ocap.arcblock.io/api/btc
as API endpoint, select POST
as request method, and set content-type
header to application/graphql
:
Then put the following query as the post body, and hit SEND
:
{
transactionsByAddress(receiver: "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", paging: {size: 10}) {
data {
historyPrice
priceInUsd
time
blockHeight
hash
total
inputs {
data {
script
scriptType
}
}
outputs {
data {
script
scriptType
index
}
}
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
As shown in the following screenshot:
Then you will get the same results as show in query data with playground.
About API Endpoint
Note that the API endpoint is different for various chains:
- BitCoin: https://ocap.arcblock.io/api/btc
- Ethereum: https://ocap.arcblock.io/api/eth