Zilliqa (ZIL)
General Information
Zilliqa is a new blockchain platform that is designed to scale in an open, permission-less distributed network securely. The core feature that makes Zilliqa scalable is sharding — dividing the network into several smaller component networks (called shards) capable of processing transactions in parallel.
Main points
- The network is composed of one DS Committee (a special type of shard), and n normal shards
- Each shard has a number of nodes, with one node being a leader and k number of backups
- Each shard runs a practical Byzantine fault tolerance (pBFT) to achieve consensus on the state of the blockchain at any point
- There are 3 types of blocks - DS blocks, TX blocks and Micro Blocks
- TX Epoch - The time between Tx Blocks
- DS Epoch - The time between DS blocks (every 100 Tx Blocks)
This info is extracted from the Zilliqa dev-portal
Some Zilliqa blockchain components you will come across on our platform explained:
- block - This refers to Transaction Block (TX Block) blocks on the chain
- ds_block - DS block (DS Block) on the chain
- microblock - Shard-level Transaction Block (Microblock)
- ds_leader - Shard-level Leader on the chain
Get Node Information
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/zil/mainnet/info \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/zil/mainnet/info HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/zil/mainnet/info",
"mzilod": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"mzilod": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"zil",
"mainnet",
"info"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/zil/mainnet/info');
$request->setMzilod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/zil/mainnet/info")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,zil,mainnet,info", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/zil/mainnet/info")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/zil/mainnet/info"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"chain": "mainnet",
"height": 466684,
"ds_height": 4668,
"txs_count": 2973367,
"difficulty": "91"
}
}
Info
General information about a blockchain is available by GET-ing the base resource.
HTTP Request
GET /v1/bc/zil/${NETWORK}/info
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | - | Network name (mainnet) |
The returned object contains a litany of information about the blockchain, including its height, the hash of the latest block and more.
Get Block By Hash
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/zil/mainnet/blocks/0xbccbcdb6e02d24d403ee0aa9dbd4effa153ce7bac8c3aab4b5154318fb445167 \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/zil/mainnet/blocks/0xbccbcdb6e02d24d403ee0aa9dbd4effa153ce7bac8c3aab4b5154318fb445167 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/zil/mainnet/blocks/0xbccbcdb6e02d24d403ee0aa9dbd4effa153ce7bac8c3aab4b5154318fb445167",
"mzilod": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"mzilod": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"zil",
"mainnet",
"blocks",
"0xbccbcdb6e02d24d403ee0aa9dbd4effa153ce7bac8c3aab4b5154318fb445167"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/zil/mainnet/blocks/0xbccbcdb6e02d24d403ee0aa9dbd4effa153ce7bac8c3aab4b5154318fb445167');
$request->setMzilod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/zil/mainnet/blocks/0xbccbcdb6e02d24d403ee0aa9dbd4effa153ce7bac8c3aab4b5154318fb445167")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,zil,mainnet,blocks,0xbccbcdb6e02d24d403ee0aa9dbd4effa153ce7bac8c3aab4b5154318fb445167", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/zil/mainnet/blocks/0xbccbcdb6e02d24d403ee0aa9dbd4effa153ce7bac8c3aab4b5154318fb445167")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/zil/mainnet/blocks/0xbccbcdb6e02d24d403ee0aa9dbd4effa153ce7bac8c3aab4b5154318fb445167"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"height": 180199,
"timestamp": 1564055865,
"transactions": 0,
"mined_by": "zil1k3gq85hz4ph6radmupdautlrxxfzqt70dwxqu3",
"reward_zil": "263698.858886986",
"difficulty": "38.5",
"ds_block": 1802,
"ds_leader": "zil16ht8cgdpzzh7elgr64unra9w9rhcugxl9ak4n2",
"ds_difficulty": "46.25",
"parent_hash": "0x5610ea2cdd0592f11cef4496b41caa0771ec96e8c437732af85419efcb611b0c",
"gas_limit": "900000",
"gas_used": "0",
"micro_blocks": [
"5e041a5a692bc0c94d2cb235cf33e3595d3edeed25d1742fd07559b07093183c",
"f7e07783ab471bb7b1aa92e3faafefdf34ddfbb4e9d9012e5318999717d1b5ef",
"f7ed57a5574a54ea8471163bd0b36715163b57bd4f607ee3c61d2b573034b444"
],
"datetime": "2019-07-25 11:57:45 UTC",
"confirmations": 286484,
"chain": "ZIL.mainnet",
"hash": "0xbccbcdb6e02d24d403ee0aa9dbd4effa153ce7bac8c3aab4b5154318fb445167"
}
}
Info
Block Hash Endpoint gives you detail information for particular block in the blockchain
HTTP Request
GET /v1/bc/zil/${NETWORK}/blocks/${BLOCK_HASH}
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | - | Network name (mainnet) |
BLOCK_HASH | - | Hash of the block in blockchain (0x prefix is optional) |
BLOCK_HASH is a string
representing the hash of the block you’re interested in querying, for example:
0xbccbcdb6e02d24d403ee0aa9dbd4effa153ce7bac8c3aab4b5154318fb445167
The returned object contains information about the block in JSON format, including its height, the amount transacted within it, the number of transactions in it, transaction hashes listed in the canonical order in which they appear in the block and more.
Get Block by Height
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/zil/mainnet/blocks/180199 \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/zil/mainnet/blocks/180199 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/zil/mainnet/blocks/180199",
"mzilod": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
const https = require('https');
var options = {
"mzilod": "GET",
"hostname": "https://api.cryptoapis.io",
"path": "/v1/bc/zil/mainnet/blocks/180199",
"headers": {
'Content-Type': 'application/json',
'X-API-Key': 'my-api-key'
}
};
var request = https.request(options, function (response) {
response.on("data", function (data) {
console.log(data);
});
});
request.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/zil/mainnet/blocks/180199');
$request->setMzilod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/zil/mainnet/blocks/180199")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,zil,mainnet,blocks,180199", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/zil/mainnet/blocks/180199")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/zil/mainnet/blocks/180199"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"height": 466640,
"timestamp": 1583827381,
"transactions": 0,
"mined_by": "zil1yn2pucumzekg0suy7rl2fs2lr4n2se5y5en2y9",
"reward_zil": "0",
"difficulty": "39.375",
"ds_block": 4667,
"ds_leader": "zil1rhtzzh2g2kq6ql3aw9yxjnpzxg7lce8m7vxrst",
"ds_difficulty": "46.375",
"parent_hash": "0x6572c9d9ef3f92a3723873d3aea94141a24ed57dd0dc11acd13192fcf8534440",
"gas_limit": "325000",
"gas_used": "0",
"micro_blocks": [
"37631acc6072ee6f7ac318e84dd3a620ea71b934bf9351409cd3311915c0e07b",
"8442835253765f837c3cb6b540c2090f96a61dde68370f19a694866ee08960e3",
"7d7e461cd105a2ce1af134046a5fac513483a3437a94158dafc70eb04301537e",
"25b204f767261dd7334e73ee1ecc31153c298dffa5522935daea912d5da90959"
],
"datetime": "2020-03-10 08:03:01 UTC",
"confirmations": 1,
"chain": "ZIL.mainnet",
"hash": "0x301c8f32f6da169b5214c64a686497f66cabcd0363fc73e271223a2ebe909f4f"
}
}
Info
Block Height Endpoint gives you detailed information for particular block in the blockchain
HTTP Request
GET /v1/bc/zil/${NETWORK}/blocks/${BLOCK_HEIGHT}
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | - | Network name (mainnet) |
BLOCK_HEIGHT | - | Height of the block in blockchain |
BLOCK_HEIGHT is an integer
representing the height of the block you’re interested in querying, for example:
180199
The returned object contains information about the block in JSON format, including its height, the total amount of wei transacted within it, the number of transactions in it and more.
Get Latest Block
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/zil/mainnet/blocks/latest \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/zil/mainnet/blocks/latest HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/zil/mainnet/blocks/latest",
"mzilod": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"mzilod": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"port": "8021",
"path": [
"v1",
"bc",
"zil",
"mainnet",
"blocks",
"latest"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/zil/mainnet/blocks/latest');
$request->setMzilod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/zil/mainnet/blocks/latest")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,zil,mainnet,blocks,latest", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/zil/mainnet/blocks/latest")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/zil/mainnet/blocks/latest"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"height": 466683,
"timestamp": 1583829745,
"transactions": 0,
"mined_by": "zil1yn2pucumzekg0suy7rl2fs2lr4n2se5y5en2y9",
"reward_zil": "0",
"difficulty": "39.375",
"ds_block": 4667,
"ds_leader": "zil1rhtzzh2g2kq6ql3aw9yxjnpzxg7lce8m7vxrst",
"ds_difficulty": "46.375",
"parent_hash": "0x84b7c386d192fe0400d4964bd33a4066911a2f94dfd4b52fcf75df3a040413be",
"gas_limit": "325000",
"gas_used": "0",
"micro_blocks": [
"399fbf1b5c5a0071caa33faf5934146981faeb3742af67f937807bf5be42fc01",
"35a5cd27a0485bacf48c72d236e870f256f0db67e4abd9274167886403eda5a4",
"035da8f05836d4c71b91412f468305654067ae33397fe9e26d45c91de246e964",
"407bc4a7a078c4f4f06d4507aee6352bb5ae399b1efe7e649acff2d3be201fb3"
],
"datetime": "2020-03-10 08:42:25 UTC",
"chain": "ZIL.mainnet",
"hash": "0x896a849a9ebb9b46b3962d9ce60165c2cb2ca872f7958ce48109a2ec87b336fa"
}
}
Info
Latest Block Endpoint gives you detailed information for the latest block in the blockchain
HTTP Request
GET /v1/bc/zil/${NETWORK}/blocks/latest
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | - | Network name (mainnet) |
The returned object contains information about the latest block in JSON format, including its height, the total amount of wei transacted within it, the number of transactions in it and more.
Addresses
Crypto APIs Address API allows you to look up information about public Zilliqa addresses/accounts and generate your own low-value Zilliqa addresses/public-private key pairs.
Zilliqa uses secp256k1, a widely implemented and well-understood elliptic curve for signing with the Schnorr algorithm. The Schnorr scheme is entirely differenty and incompatible with ECDSA, which is used by Ethereum.
Zilliqa supports two types of addresses:
- bech32 address (e.g.
zil136ax4fvyq8rntc90mfnz05vf3m5drf7j3wsxam
) - 20-byte address that looks exactly like an Ethereum address
You are advised to use bech32 address for Zilliqa calls. More info about bech32 adoption Zilliqa dev-portal
Get Address Details
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/zil/mainnet/address/zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/zil/mainnet/address/zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/zil/mainnet/address/zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw",
"mzilod": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"mzilod": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"zil",
"mainnet",
"address",
"zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/zil/mainnet/address/zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw');
$request->setMzilod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/zil/mainnet/address/zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,zil,mainnet,address,zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/zil/mainnet/address/zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/zil/mainnet/address/zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"balance": "141123703763780775479",
"nonce": 30495,
"chain": "ZIL.mainnet",
"address": "zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw",
"from": 17333,
"to": 29,
"txs_count": 17362
}
}
Info
The default Address Endpoint strikes a balance between response time and data on Addresses. It returns information about the balance (in ZIL) and transactions of a specific address.
HTTP Request
GET /v1/bc/zil/${NETWORK}/address/${ADDRESS}
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | ------- | Network name (mainnet) |
ADDRESS | ------- | Address in blockchain |
ADDRESS is a string representing the public address you’re interested in querying, for example:
zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw
The returned object contains information about the address, including its balance in ZIL and the number of transactions associated with it. The endpoint omits any detailed transaction information, but if that isn’t required by your application, then it’s the fastest and preferred way to get public address information.
Get Transactions By Address
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/zil/mainnet/address/zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw/transactions?index=1&limit=3 \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/zil/mainnet/address/zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw/transactions?index=1&limit=3 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/zil/mainnet/address/zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw/transactions?index=1&limit=3",
"method": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"method": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"zil",
"mainnet",
"address",
"zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw",
"transactions"
],
"qs": {
"index": 1,
"limit": 3
},
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/zil/mainnet/address/zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw/transactions?index=1&limit=3');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/zil/mainnet/address/zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw/transactions?index=1&limit=3")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
querystring = {"index": 1, "limit": 3}
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,zil,mainnet,address,zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw,transactions", headers=headers, params=querystring))
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/zil/mainnet/address/zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw/transactions?index=1&limit=3")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/zil/mainnet/address/zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw/transactions?index=1&limit=3"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"meta": {
"index": 1,
"limit": 3,
"totalCount": 31903,
"results": 3
},
"payload": [
{
"block_number": 466862,
"from": "zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw",
"to": "zil1z94hcqgcjkqk786k5pjrv27qh386qyqj04zc5t",
"nonce": 31855,
"status": "2",
"fee_zil": "0.001",
"index": 1,
"timestamp": 1583839982,
"block_hash": "0x32c3d749250fec6591943712683a1cee7eab77194a2d168d7fe5cde9602c703c",
"gas_used": "1",
"datetime": "2020-03-10 11:33:02 UTC",
"chain": "ZIL.mainnet",
"hash": "0x715a03c7117fad349d0d850545ef17b79b3ae7598aff5aed06ce77817636e55c",
"gas_price": "1000000000",
"gas": "1",
"value": "500337.6582",
"confirmations": 50
},
{
"block_number": 466851,
"from": "zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw",
"to": "zil1ggm48j6cr5uyuxm4ztafpx6tvtqkjx3cpz25nl",
"nonce": 31854,
"status": "2",
"fee_zil": "0.001",
"index": 0,
"timestamp": 1583839344,
"block_hash": "0x31b60ab71ef2fcbed4f6cb315f71d2027568b0461e8351a3fcba60fb8db061d3",
"gas_used": "1",
"datetime": "2020-03-10 11:22:24 UTC",
"chain": "ZIL.mainnet",
"hash": "0xa0774006117c703b129f62738512eb00f33b5b97751589bfa73bb9be2efeaa78",
"gas_price": "1000000000",
"gas": "1",
"value": "180679.5296",
"confirmations": 61
},
{
"block_number": 466840,
"from": "zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw",
"to": "zil1aaurgdfp640xxc2zt0fql79p0dmecrx9anh8vu",
"nonce": 31853,
"status": "2",
"fee_zil": "0.001",
"index": 2,
"timestamp": 1583838755,
"block_hash": "0xab14f680c39c033552a2f71253410c328e188af8f4dca93b69665892f63c3956",
"gas_used": "1",
"datetime": "2020-03-10 11:12:35 UTC",
"chain": "ZIL.mainnet",
"hash": "0x9ffbad12e7cf4a73b07898ee730dd40327c8405d0c39925bb0e892c3b54def4c",
"gas_price": "1000000000",
"gas": "1",
"value": "12368.4",
"confirmations": 72
}
]
}
Info
The Transactions By Address Endpoint returns all transactions specified by the query params: index and limit; The maximum value of limit is 50. The value in the returned transactions in ZIL.
HTTP Request
GET /v1/bc/zil/${NETWORK}/address/${ADDRESS}/transactions?index=${INDEX}&limit=${LIMIT}
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | ------- | Network name (mainnet) |
ADDRESS | ------- | Address in blockchain |
INDEX | 0 | start from |
LIMIT | ------- | limit up to n transactions |
Meta Response
Variable | Type | Description |
---|---|---|
totalCount | int | Total count of the items in the listing for the given criteria |
index | int | Sequential index number of the items list start position (depends on the skip parameter) for the given criteria |
limit | int | Limit number of the items list (depends on the limit parameter) for the given criteria. |
results | int | Count of the items listed in the current response for the given criteria |
ADDRESS is a string representing the public address you’re interested in querying, for example:
zil1z3zky3kv20f37z3wkq86qfy00t4a875fxxw7sw
INDEX is an integer
representing the order of the transaction, for example:
1
LIMIT is an integer
representing limit for transactions, for example:
3
Generate Address
Sample Data
curl -X POST https://api.cryptoapis.io/v1/bc/zil/mainnet/address \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
POST /v1/bc/zil/mainnet/address HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/zil/mainnet/address",
"mzilod": "POST",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"mzilod": "POST",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"zil",
"mainnet",
"address"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/zil/mainnet/address');
$request->setMzilod(HTTP_METH_POST);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/zil/mainnet/address")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("POST", "v1,bc,zil,mainnet,address", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/zil/mainnet/address")
.post(null)
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/zil/mainnet/address"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"address": "0xF6E9044842217BFd7f0BA37Dcf3b9bEa3e6e4C5E",
"publicKey": "02f16d5ed53b2a4b6b9bab08c4b8019f88e7cab3cc2210ea1cd6bcafbe0926e3bd",
"privateKey": "732cc1de8d42cacb9578483816d16a88d8e722ad1c4b4f4faec4d2ef582e7862",
"bechAddress": "zil17m5sgjzzy9al6lct5d7u7wumaglxunz75s90np"
}
}
Info
The Generate Address endpoint allows you to generate private-public key-pairs along with an associated public address. No information is required with this POST request.
You are advised to use bech32 address for Zilliqa calls
HTTP Request
POST /v1/bc/zil/${NETWORK}/address
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | - | Network name (mainnet) |
The returned object contains a private key in hex-encoded, a public key, and a public address.
Transactions
Get Transaction By Hash
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/hash/0x004c9aea8c980b8bbfe7d0dc2cea8839c884f850bef307b1dce242078109ea1e \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/zil/mainnet/txs/hash/0x004c9aea8c980b8bbfe7d0dc2cea8839c884f850bef307b1dce242078109ea1e HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/hash/0x004c9aea8c980b8bbfe7d0dc2cea8839c884f850bef307b1dce242078109ea1e",
"method": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"method": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"zil",
"bc",
"mainnet",
"txs",
"hash",
"0x004c9aea8c980b8bbfe7d0dc2cea8839c884f850bef307b1dce242078109ea1e"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/hash/0x004c9aea8c980b8bbfe7d0dc2cea8839c884f850bef307b1dce242078109ea1e');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/hash/0x004c9aea8c980b8bbfe7d0dc2cea8839c884f850bef307b1dce242078109ea1e")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,zil,mainnet,txs,hash,0x004c9aea8c980b8bbfe7d0dc2cea8839c884f850bef307b1dce242078109ea1e", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/hash/0x004c9aea8c980b8bbfe7d0dc2cea8839c884f850bef307b1dce242078109ea1e")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/hash/0x004c9aea8c980b8bbfe7d0dc2cea8839c884f850bef307b1dce242078109ea1e"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"block_number": 59903,
"from": "zil1ludue4m8xrdekp4vdufnk84ywv0art6krnlsgn",
"to": "zil1m9pv2cr087ewxncupyeujsr0q3fmulu6ep5elv",
"nonce": 1,
"status": "2",
"fee_zil": "0.001",
"index": 1,
"timestamp": 1554172478,
"block_hash": "0x87bc3137c27aa4945780a4ebead014f4a47e542d5d83b524ab60985070c523a2",
"gas_used": "1",
"datetime": "2019-04-02 02:34:38 UTC",
"chain": "ZIL.mainnet",
"hash": "0x004c9aea8c980b8bbfe7d0dc2cea8839c884f850bef307b1dce242078109ea1e",
"gas_price": "1000000000",
"gas": "1",
"value": "704.50625984229",
"confirmations": 406789
}
}
Info
The Transaction Hash Endpoint returns detailed information about a given transaction based on its hash.
HTTP Request
GET /v1/bc/zil/${NETWORK}/txs/hash/${TX_HASH}
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | - | Network name (mainnet) |
TX_HASH | - | Hash of the transaction in blockchain |
TX_HASH is a string
representing the hash of the block you’re interested in querying, for example:
0x004c9aea8c980b8bbfe7d0dc2cea8839c884f850bef307b1dce242078109ea1e
(mainnet)
The returned object contains detailed information about the transaction, including the value transfered, fees collected, date received, any scripts associated with an output, and more.
Transactions Index by Index, Limit and Block Number
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/block/59903?index=0&limit=4 \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/zil/mainnet/txs/block/59903?index=0&limit=4 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/block/59903?index=0&limit=4",
"method": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"method": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"zil",
"mainnet",
"txs",
"block",
"59903"
],
"qs": {
"index": 0,
"limit": 4
},
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/block/59903?index=0&limit=4');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/block/59903?index=0&limit=4")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
querystring = {"index": 0, "limit": 4}
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,zil,mainnet,txs,block,59903", headers=headers, params=querystring)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/block/59903?index=0&limit=4")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/block/59903?index=0&limit=4"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"meta": {
"index": 0,
"limit": 4,
"totalCount": 890,
"results": 4
},
"payload": [
{
"block_number": 59903,
"from": "zil1yd5ejvz8gm2tc6lk6q3u87rf0f90d9kvd3eckl",
"to": "zil1m9pv2cr087ewxncupyeujsr0q3fmulu6ep5elv",
"nonce": 1,
"status": "2",
"fee_zil": "0.001",
"index": 0,
"timestamp": 1554172478,
"block_hash": "0x87bc3137c27aa4945780a4ebead014f4a47e542d5d83b524ab60985070c523a2",
"gas_used": "1",
"datetime": "2019-04-02 02:34:38 UTC",
"chain": "ZIL.mainnet",
"hash": "0x0037196e5a5be23a8c9755f8681798769d18a578be258d7ff664ee8ada840a02",
"gas_price": "1000000000",
"gas": "1",
"value": "667.377018918769",
"confirmations": 406785
},
{
"block_number": 59903,
"from": "zil1ludue4m8xrdekp4vdufnk84ywv0art6krnlsgn",
"to": "zil1m9pv2cr087ewxncupyeujsr0q3fmulu6ep5elv",
"nonce": 1,
"status": "2",
"fee_zil": "0.001",
"index": 1,
"timestamp": 1554172478,
"block_hash": "0x87bc3137c27aa4945780a4ebead014f4a47e542d5d83b524ab60985070c523a2",
"gas_used": "1",
"datetime": "2019-04-02 02:34:38 UTC",
"chain": "ZIL.mainnet",
"hash": "0x004c9aea8c980b8bbfe7d0dc2cea8839c884f850bef307b1dce242078109ea1e",
"gas_price": "1000000000",
"gas": "1",
"value": "704.50625984229",
"confirmations": 406785
},
{
"block_number": 59903,
"from": "zil1eyygqm5pq3p9gumavj99u5ng5l9duc8zzfmrpz",
"to": "zil1m9pv2cr087ewxncupyeujsr0q3fmulu6ep5elv",
"nonce": 1,
"status": "2",
"fee_zil": "0.001",
"index": 2,
"timestamp": 1554172478,
"block_hash": "0x87bc3137c27aa4945780a4ebead014f4a47e542d5d83b524ab60985070c523a2",
"gas_used": "1",
"datetime": "2019-04-02 02:34:38 UTC",
"chain": "ZIL.mainnet",
"hash": "0x0128c2df7a36632fc4292b6540fcb4e7bbada6f84ad6bcbf1b1596589fc69909",
"gas_price": "1000000000",
"gas": "1",
"value": "535.821118933698",
"confirmations": 406785
},
{
"block_number": 59903,
"from": "zil1kzrt74vf3wwxdvymfvgmer3ezxprp8r7gh8evz",
"to": "zil1m9pv2cr087ewxncupyeujsr0q3fmulu6ep5elv",
"nonce": 1,
"status": "2",
"fee_zil": "0.001",
"index": 3,
"timestamp": 1554172478,
"block_hash": "0x87bc3137c27aa4945780a4ebead014f4a47e542d5d83b524ab60985070c523a2",
"gas_used": "1",
"datetime": "2019-04-02 02:34:38 UTC",
"chain": "ZIL.mainnet",
"hash": "0x0294626350fbd71a9e2987a2b58c1d3d07c9c34688de505ccfbab319833ba0c2",
"gas_price": "1000000000",
"gas": "1",
"value": "808.027077655474",
"confirmations": 406785
}
]
}
Info
The Transaction Index Endpoint by Index, Limit and Block Number returns detailed information about transactions for the block height defined, starting from the index defined up to the limit defined . In the example above index is 0 and limit is 4, therefore the response will be an array of 4 transactions starting from index 0. The highest number for the limit is 50.
HTTP Request
GET /v1/bc/zil/${NETWORK}/txs/block/${BLOCK_NUMBER}?index=${TX_INDEX}&limit=${LIMIT}
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | ------- | Network name (e.g. testnet or mainnet) |
TX_INDEX | ------- | Index - start from |
LIMIT | ------- | Limit - up to |
BLOCK_NUMBER | ------- | Block height |
Meta Response
Variable | Type | Description |
---|---|---|
totalCount | int | Total count of the items in the listing for the given criteria |
index | int | Sequential index number of the items list start position (depends on the skip parameter) for the given criteria |
limit | int | Limit number of the items list (depends on the limit parameter) for the given criteria. |
results | int | Count of the items listed in the current response for the given criteria |
TX_INDEX is a integer
representing the order of the transaction within the block, for example:
0
LIMIT is a integer
representing limit for transactions, for example:
4
BLOCK_NUMBER is a integer
representing the height of the block, for example:
59903
Get Transaction By Transaction Index and Block Number
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/block/59903/1 \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/zil/mainnet/txs/block/59903/1 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/block/59903/1",
"method": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"method": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"zil",
"mainnet",
"txs",
"59903",
"1"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/block/59903/1');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/block/59903/1")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,zil,mainnet,txs,59903,1", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/block/59903/1")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/block/59903/1"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"block_number": 59903,
"from": "zil1ludue4m8xrdekp4vdufnk84ywv0art6krnlsgn",
"to": "zil1m9pv2cr087ewxncupyeujsr0q3fmulu6ep5elv",
"nonce": 1,
"status": "2",
"fee_zil": "0.001",
"index": 1,
"timestamp": 1554172478,
"block_hash": "0x87bc3137c27aa4945780a4ebead014f4a47e542d5d83b524ab60985070c523a2",
"gas_used": "1",
"datetime": "2019-04-02 02:34:38 UTC",
"chain": "ZIL.mainnet",
"hash": "0x004c9aea8c980b8bbfe7d0dc2cea8839c884f850bef307b1dce242078109ea1e",
"gas_price": "1000000000",
"gas": "1",
"value": "704.50625984229",
"confirmations": 406783
}
}
Info
The Transaction Index Endpoint by Block Number returns detailed information about a given transaction based on its index and block height.
HTTP Request
GET /v1/bc/zil/${NETWORK}/txs/block/${BLOCK_NUMBER}/${TX_INDEX}
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | - | Network name (mainnet) |
TX_INDEX | - | Index of the transaction in block |
BLOCK_NUMBER | - | Block height |
TX_INDEX is a integer
representing the order of the transaction within the block, for example:
1
BLOCK_NUMBER is a integer
representing the height of the block, for example:
59903
The returned object contains detailed information about the transaction, including the value transfered, fees collected, date received, any scripts associated with an output, and more.
Get Transaction by Transaction Index and Block Hash
Sample Data
curl -X GET https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/block/0x87bc3137c27aa4945780a4ebead014f4a47e542d5d83b524ab60985070c523a2/1 \
-H 'Content-Type: application/json' \
-H 'X-API-Key: my-api-key'
GET /v1/bc/zil/mainnet/txs/block/0x87bc3137c27aa4945780a4ebead014f4a47e542d5d83b524ab60985070c523a2/1 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/block/0x87bc3137c27aa4945780a4ebead014f4a47e542d5d83b524ab60985070c523a2/1",
"method": "GET",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var http = require("http");
var options = {
"method": "GET",
"hostname": [
"https://api.cryptoapis.io"
],
"path": [
"v1",
"bc",
"zil",
"mainnet",
"txs",
"block",
"0x87bc3137c27aa4945780a4ebead014f4a47e542d5d83b524ab60985070c523a2",
"1"
],
"headers": {
"Content-Type": "application/json",
"X-API-Key": "my-api-key"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/block/0x87bc3137c27aa4945780a4ebead014f4a47e542d5d83b524ab60985070c523a2/1');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Content-Type' => 'application/json',
'X-API-Key' => 'my-api-key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
?>
require 'uri'
require 'net/http'
url = URI("https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/block/0x87bc3137c27aa4945780a4ebead014f4a47e542d5d83b524ab60985070c523a2/1")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("https://api.cryptoapis.io")
headers = {
'Content-Type': "application/json",
'X-API-Key': "my-api-key"
}
conn.request("GET", "v1,bc,zil,mainnet,txs,block,0x87bc3137c27aa4945780a4ebead014f4a47e542d5d83b524ab60985070c523a2,1", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/block/0x87bc3137c27aa4945780a4ebead014f4a47e542d5d83b524ab60985070c523a2/1")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "my-api-key")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cryptoapis.io/v1/bc/zil/mainnet/txs/block/0x87bc3137c27aa4945780a4ebead014f4a47e542d5d83b524ab60985070c523a2/1"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-API-Key", "my-api-key")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response Body
{
"payload": {
"block_number": 59903,
"from": "zil1ludue4m8xrdekp4vdufnk84ywv0art6krnlsgn",
"to": "zil1m9pv2cr087ewxncupyeujsr0q3fmulu6ep5elv",
"nonce": 1,
"status": "2",
"fee_zil": "0.001",
"index": 1,
"timestamp": 1554172478,
"block_hash": "0x87bc3137c27aa4945780a4ebead014f4a47e542d5d83b524ab60985070c523a2",
"gas_used": "1",
"datetime": "2019-04-02 02:34:38 UTC",
"chain": "ZIL.mainnet",
"hash": "0x004c9aea8c980b8bbfe7d0dc2cea8839c884f850bef307b1dce242078109ea1e",
"gas_price": "1000000000",
"gas": "1",
"value": "704.50625984229",
"confirmations": 406782
}
}
Info
The Transaction Index Endpoint by Block Hash returns detailed information about a given transaction based on its index and block hash.
HTTP Request
GET /v1/bc/zil/${NETWORK}/txs/block/${BLOCK_HASH}/${TX_INDEX}
Query Parameters
Parameter | Default | Description |
---|---|---|
NETWORK | ------- | Network name (mainnet) |
TX_INDEX | ------- | Index of the transaction in block |
BLOCK_HASH | ------- | Block hash |
TX_INDEX is a integer
representing the order of the transaction within the block, for example:
1
BLOCK_HASH is a string
representing the hash of the block, for example:
0x87bc3137c27aa4945780a4ebead014f4a47e542d5d83b524ab60985070c523a2
(mainnet)
The returned object contains detailed information about the transaction, including the value transfered, fees collected, date received, any scripts associated with an output, and more.