Introduction
Welcome to the ΞtherGem API! You can use our API to access ΞtherGem API endpoints, which can get information on various Ξgem Bockchain Stats and Functions.
We have language bindings in Shell, Ruby, Python and Javascript! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
ΞtherGem uses API keys to allow access to the Private API. You can register a new ΞtherGem API key at our developer portal.
Address
To authorize, use this code:
require 'uri'
require 'net/http'
url = URI("http://api.egem.io/api/v1/balances/?address=0xaab4c5830bf586047857f795357f630f026d187a")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("api.egem.io")
payload = ""
headers = { 'content-type': "application/json" }
conn.request("GET", "/api/v1/balances/?address=0xaab4c5830bf586047857f795357f630f026d187a", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
# With shell, you can just pass the correct header with each request
curl --request GET \
--url 'http://api.egem.io/api/v1/balances/?address=0xaab4c5830bf586047857f795357f630f026d187a' \
--header 'content-type: application/json'
var data = JSON.stringify(false);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "http://api.egem.io/api/v1/balances/?address=0xaab4c5830bf586047857f795357f630f026d187a");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
Make sure to replace
0xaab4c5830bf586047857f795357f630f026d187a
with your own address.
{
"amount": "123.3456"
}
This endpoint retrieves address balance.
HTTP Request
GET http://api.egem.io/api/v1/balances/?
Query Parameters
Parameter | Default | Description |
---|---|---|
address | hash | Choose a valid address. |
Authorization: Public
Blocks
Get Specific Block
require 'uri'
require 'net/http'
url = URI("http://api.egem.io/api/v1/blocks/?block=1234")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("api.egem.io")
payload = ""
headers = { 'content-type': "application/json" }
conn.request("GET", "/api/v1/blocks/?block=1234", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
# With shell, you can just pass the correct header with each request
curl --request GET \
--url 'http://api.egem.io/api/v1/blocks/?block=1234' \
--header 'content-type: application/json'
var data = JSON.stringify(false);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "http://api.egem.io/api/v1/blocks/?block=1234");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
The above command returns JSON structured like this:
{
"difficulty": "0x3f5908683ed",
"extraData": "0x4547454d",
"gasLimit": "0x47e7c4",
"gasUsed": "0x2e248",
"hash": "0xa3e423a4d7d6551ff47b4760ad4c38a6e3a3ffedaf0948282c8af671099c169f",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x643ec0e4b61f6a2feebd166c7e48b027f8dd78bf",
"mixHash": "0x055ddd3c3ede33d0a8e568d11d54fe3c7a77b1a203b73abe64da0146230b4318",
"nonce": "0x8888ec2c15f8a161",
"number": "0x4d2",
"parentHash": "0x4d1485c1f22e368edf990307ade3aa80b8a33fd71d96ec5a72ae46b754d57f39",
"receiptsRoot": "0x4416bfc7541f873da23002d8b26a55f73e1dbba48c1d0b46bf366d055549b021",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x618",
"stateRoot": "0x418fce7b305a3c74f94ba0540bee1925ad6a7febfbd13bebd34f8f87796d26f4",
"timestamp": "0x5ac042d8",
"totalDifficulty": "0xd5b57a3e57e07",
"transactions": [
"0x7fa2aae17f2cc69ac2d3d0a71897e10e7646287307277c9e9f2b881f855eb18c",
"0x025736597d6f4adc201d0019bf651d5ea045516bec90cdf67db83b6b28cc31eb",
"0x3b276698206694c78162ff48ccd897a03cdabb302726bc1bd205ce1de3c01553",
"0x766d27bd8e5bad78cf4769b081e153913a25e66fc5a04363f3367f18d83e93ab",
"0xb7c38cb7cef4b39fc29d2e0a571887e34fd07a174a899356c64d5324ee43e1f7",
"0xc7a397ab699bd4f26a45a96fa0d63de39ed337786a9dbf28e8f7d39cdbc82f3e",
"0x602d9d7d4f07232c009bd0a15cecc3780ec7c9938a54d008c5e93b10a1fb09f1",
"0xf0cc127e3d187f166ae0f4bfa03c72fdff6ae153124481e5c9c06bf504ba2933",
"0x311ba6fb199a6947ca812567cb23542b9262b1f10289f7f7f4685b59dbda3516"
],
"transactionsRoot": "0x5cdc0f21edb20b529f07e2461d59afa7d57f8df38d06279dd39aac9b0ed2c335",
"uncles": []
}
This endpoint retrieves all block info.
HTTP Request
GET http://api.egem.io/api/v1/blocks/?
Query Parameters
Parameter | Default | Description |
---|---|---|
block | number | Choose a valid block number. |
Price
Get EGEM Trading Prices
require 'uri'
require 'net/http'
url = URI("http://api.egem.io/api/v1/egem_prices/")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("api.egem.io")
payload = ""
headers = { 'content-type': "application/json" }
conn.request("GET", "/api/v1/egem_prices/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
# With shell, you can just pass the correct header with each request
curl --request GET \
--url http://api.egem.io/api/v1/egem_prices/ \
--header 'content-type: application/json'
var data = JSON.stringify(false);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "http://api.egem.io/api/v1/egem_prices/");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
The above command returns JSON structured like this:
{
"BTC": "0.0000072",
"ETH": "0.000082",
"OPENBTC": "",
"BRIDGEBTC": "",
"XSH": "",
"BTS": "",
"BTCUSD": "0.065884824",
"ETHUSD": "0.060098046",
"AVERAGEUSD": "0.062991435"
}
This endpoint retrieves all Current Exchange Trading prices.
HTTP Request
GET http://api.egem.io/api/v1/egem_prices/?
Query Parameters
Parameter | Default | Description |
---|---|---|
Transactions
Get Specific Tx
require 'uri'
require 'net/http'
url = URI("http://api.egem.io/api/v1/transactions/?tx=0xed5d4edcbfa01cb05e4f579efc3d66f4fe079ea9740dd5c6989f421e8ac6bc72")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("api.egem.io")
payload = ""
headers = { 'content-type': "application/json" }
conn.request("GET", "/api/v1/transactions/?tx=0xed5d4edcbfa01cb05e4f579efc3d66f4fe079ea9740dd5c6989f421e8ac6bc72", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
# With shell, you can just pass the correct header with each request
curl --request GET \
--url 'http://api.egem.io/api/v1/transactions/?tx=0xed5d4edcbfa01cb05e4f579efc3d66f4fe079ea9740dd5c6989f421e8ac6bc72' \
--header 'content-type: application/json'
var data = JSON.stringify(false);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "http://api.egem.io/api/v1/transactions/?tx=0xed5d4edcbfa01cb05e4f579efc3d66f4fe079ea9740dd5c6989f421e8ac6bc72");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
The above command returns JSON structured like this:
{
"blockHash": "0x4e6943277a72099e4f5d0774e52919afa30aa52321aaa24e823890886e8e154f",
"blockNumber": "0x3cbc2",
"from": "0xcd47b71badcaf4ede344f291278fcdb5f5d8f41f",
"gas": "0xc350",
"gasPrice": "0xba43b7400",
"hash": "0xed5d4edcbfa01cb05e4f579efc3d66f4fe079ea9740dd5c6989f421e8ac6bc72",
"input": "0x",
"nonce": "0xa6",
"r": "0x6a445eecd1ca6f60213059395350b6111bb97980de5aaefb122d483ac0972ed0",
"s": "0x5b5e3918b689488c3119024375c3ea9547ce4ac48132aa4b0e194d671f07a3ee",
"to": "0x09a175a1ed32b58dbbbf8e90f26b304ab5750ebd",
"transactionIndex": "0x0",
"v": "0xfa9",
"value": "0x10292f9f538c6800"
}
This endpoint retrieves all Tx info.
HTTP Request
GET http://api.egem.io/api/v1/transactions/?
Query Parameters
Parameter | Default | Description |
---|---|---|
tx | hash | Choose a valid tx hash. |
Errors
The Kittn API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request -- Your request is invalid. |
401 | Unauthorized -- Your API key is wrong. |
403 | Forbidden -- The kitten requested is hidden for administrators only. |
404 | Not Found -- The specified kitten could not be found. |
405 | Method Not Allowed -- You tried to access a kitten with an invalid method. |
406 | Not Acceptable -- You requested a format that isn't json. |
410 | Gone -- The kitten requested has been removed from our servers. |
418 | I'm a teapot. |
429 | Too Many Requests -- You're requesting too many kittens! Slow down! |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |