Get started

API Endpoint

	https://ethereum.exitapi.com/                

The Ethereum API provides programmatic access to blockchain. Retrieve a address, transaction, block, etc.

To use this API, you need an API key. Please contact us at info@exitapi.com to get your own API key.

Get address balance

Returns the balance of given address in Ethers.


# Here is a curl example
curl \
-X POST https://ethereum.exitapi.com/address/balance \
-F 'secret_key=your_api_key' \
-F 'network=mainnet' \
-F 'address=0x883D4B508008B5C268F94a3B6D94324f377c2d78'			

You need to make a GET/POST call to the following url :
https://ethereum.exitapi.com/address/balance



Result example :

{
  status: "OK"
  result: {
    balance: 0.01,
    balance_wei: 10000000000000000
  }
}			

QUERY PARAMETERS

Field Type Description
secret_key String Your API key.
network String (optional) Network name, available: mainnet, ropsten, rinkeby.
Default: mainnet
address String A string representing the address (20 bytes) to check for balance.

Generate new address

Returns the private key and public address for new generated address.


# Here is a curl example
curl \
-X POST https://ethereum.exitapi.com/address/generate \
-F 'secret_key=your_api_key' \
-F 'count=2'			

You need to make a POST call to the following url :
https://ethereum.exitapi.com/address/generate



Result example :

{
  status: "OK"
  result: {
    addresses: [
      {
        private_key: "0xfb3ae872821236b37857509c7c980883af9f085462a1de2b1fdc6114688347bb",
        public_address: "0x2b5d6936b902abfbc50b1755144a8ffedd00e15e"
      },
      {
        private_key: "0xfaf20263cebd081e8b8b0fa44d1f4e19c7a8406b27bc6fcb756cb3160d19f884",
        public_address: "0x582eb5e0f34a82e6f343541df4d638f7f67103b5"
      }
    ]
  }
}			

QUERY PARAMETERS

Field Type Description
secret_key String Your API key.
count Integer (optional) A count of generating new addresses. Allowed from 1 to 30.

Calculate public address

Returns the public address for gived private key.


# Here is a curl example
curl \
-X POST https://ethereum.exitapi.com/address/from-private-key \
-F 'secret_key=your_api_key' \
-F 'private_key=0xfb3ae872821236b37857509c7c980883af9f085462a1de2b1fdc6114688347bb'			

You need to make a POST call to the following url :
https://ethereum.exitapi.com/address/from-private-key



Result example :

{
  status: "OK"
  result: {
    public_address: "0x2b5d6936b902abfbc50b1755144a8ffedd00e15e"
  }
}			

QUERY PARAMETERS

Field Type Description
secret_key String Your API key.
private_key String A hexadecimal representing the private key (64 bytes) for calculate the public address.

Get transaction info

Returns information about a transaction specified by hash.


# Here is a curl example
curl \
-X POST https://ethereum.exitapi.com/transaction/info \
-F 'secret_key=your_api_key' \
-F 'network=mainnet' \
-F 'tx_hash=0xdc33146610540954fdb0194e806411407ad303ceef649749f8a471d60ad4b43b'			

You need to make a GET/POST call to the following url :
https://ethereum.exitapi.com/transaction/info



Result example :

{
  status: "OK"
  result: {
    block_hash: "0x683a92d85d22b0dbc9b3a4bb18660f97f055516e8053a977bc6c304ee97df0fb",
    block_number: "9288009",
    from: "0x49a23963bf1ec0e612aa7fbd7ede7aa82012b787",
    gas: "21000",
    gas_price: "0.000000006",
    hash: "0xdc33146610540954fdb0194e806411407ad303ceef649749f8a471d60ad4b43b",
    input: "0x",
    nonce: "0",
    r: "",
    s: "",
    to: "0x883d4b508008b5c268f94a3b6d94324f377c2d78",
    transaction_index: "45",
    v: "",
    type: "",
    value: "0.05995827"
  }
}			

QUERY PARAMETERS

Field Type Description
secret_key String Your API key.
network String (optional) Network name, available: mainnet, ropsten, rinkeby.
Default: mainnet
tx_hash String A string representing the hash (64 bytes) of a transaction.

Send transaction

Creates, signs, and sends a new transaction to the network.


# Here is a curl example
curl \
-X POST https://ethereum.exitapi.com/transaction/send \
-F 'secret_key=your_api_key' \
-F 'network=mainnet' \
-F 'from_private_key=0xfb3ae872821236b37857509c7c980883af9f085462a1de2b1fdc6114688347bb' \
-F 'from_address=0x2b5d6936b902abfbc50b1755144a8ffedd00e15e' \
-F 'to_address=0x582eb5e0f34a82e6f343541df4d638f7f67103b5' \
-F 'value=0.01'			

You need to make a POST call to the following url :
https://ethereum.exitapi.com/transaction/send



Result example :

{
  status: "OK"
  result: {
    transaction_hash: "0xa172471bab771efde1fb105068acff01686cb452d7faa997100e7d3d15a1eae5"
  }
}			

QUERY PARAMETERS

Field Type Description
secret_key String Your API key.
network String (optional) Network name, available: mainnet, ropsten, rinkeby.
Default: mainnet
from_address String A string representing the address (20 bytes) of sender.
from_private_key String A string representing the private key (64 bytes) of a address.
to_address String A string representing the address (20 bytes) of receiver.
value Float A value of Ethers for send.
gas Integer (optional) A gas provided for transaction execution.
gas_price Integer (optional) A price in wei of each gas used.
Default: value getting from the Ethereum Gas Station or static value 2342177280
gas_limit Integer (optional) The maximum amount of gas you are willing to consume on a transaction.
Default: static value 3000000

Get block last

Returns number of last block.


# Here is a curl example
curl \
-X POST https://ethereum.exitapi.com/block/last \
-F 'secret_key=your_api_key' \
-F 'network=mainnet'			

You need to make a GET/POST call to the following url :
https://ethereum.exitapi.com/block/last



Result example :

{
  status: "OK"
  result: {
    block_number: "9288009",
  }
}			

QUERY PARAMETERS

Field Type Description
secret_key String Your API key.
network String (optional) Network name, available: mainnet, ropsten, rinkeby.
Default: mainnet

Get block info

Returns information about of the block by block number.


# Here is a curl example
curl \
-X POST https://ethereum.exitapi.com/block/info \
-F 'secret_key=your_api_key' \
-F 'network=mainnet'\
-F 'block_number=9638166'			

You need to make a GET/POST call to the following url :
https://ethereum.exitapi.com/block/info



Result example :

{
  status: "OK"
  result: {
    difficulty: "2299023179726673",
    extra_data: "",
    gas_limit: "9985221",
    gas_used: "9975860",
    hash: "0x96ecf1439f65cb623751359d8b92e045006615a7bb3f6c7c33d1470ed82d0d61",
    logs_bloom: "",
    miner: "0xea674fdde714fd979de3edf0f56aa9716b898ec8",
    mix_hash: "",
    nonce: "0x07b3ccd4042ab0bb",
    number: 9638166,
    size: 1575,
    timestamp: 1612986061,
    datetime: "2021-02-10 20:41:01"
  }
}			

QUERY PARAMETERS

Field Type Description
secret_key String Your API key.
network String (optional) Network name, available: mainnet, ropsten, rinkeby.
Default: mainnet
block_number Integer A number of block for get informations.

Get block info by hash

Returns information about of the block by block hash.


# Here is a curl example
curl \
-X POST https://ethereum.exitapi.com/block/info-by-hash \
-F 'secret_key=your_api_key' \
-F 'network=mainnet'\
-F 'block_hash=0x5a4a191c923ec9e7b11f594595e7b4919626936125fb1747b540a435b1f9a33e'			

You need to make a GET/POST call to the following url :
https://ethereum.exitapi.com/block/info-by-hash



Result example :

{
  status: "OK"
  result: {
    difficulty: "2299023179726673",
    extra_data: "",
    gas_limit: "9985221",
    gas_used: "9975860",
    hash: "0x96ecf1439f65cb623751359d8b92e045006615a7bb3f6c7c33d1470ed82d0d61",
    logs_bloom: "",
    miner: "0xea674fdde714fd979de3edf0f56aa9716b898ec8",
    mix_hash: "",
    nonce: "0x07b3ccd4042ab0bb",
    number: 9638166,
    size: 1575,
    timestamp: 1612986061,
    datetime: "2021-02-10 20:41:01"
  }
}			

QUERY PARAMETERS

Field Type Description
secret_key String Your API key.
network String (optional) Network name, available: mainnet, ropsten, rinkeby.
Default: mainnet
block_hash String A hash of block for get informations.

Errors

The API uses the following error codes:


Result example :

{
  status: "ERROR",
  code: 'X000',
  message: 'Some parameters are missing.'
}
			
Error Code Meaning
X000 Some parameters are missing. This error appears when you don't pass every mandatory parameters.
X001 Unknown or unvalid secret_key. This error appears if you use an unknow API key or if your API key expired.
X002 Unvalid secret_key for this domain. This error appears if you use an API key non specified for your domain. Developper or Universal API keys doesn't have domain checker.
X003 Unknown or unvalid user token. This error appears if you use an unknow user token or if the user token expired.
X7xx Internal application error This error appears if an accident has occurred in our application.
E001 Ethereum network is invalid.
E002 Ethereum address is missing or is empty.
E003 Ethereum address is invalid.
E004 Private key is missing or is empty.
E005 Private key is invalid.
E006 Transaction hash is missing or is empty.
E007 Transaction hash is invalid.
E008 Ethereum address for receiving is missing or is empty.
E009 Ethereum address for receiving is invalid.
E010 Value of ethers is missing or is empty.
E011 Value of ethers is invalid.
E012 Insufficient funds for gas * price + value.
E013 Block number is missing or is empty.
E014 Block number is invalid.
E015 Block hash is missing or is empty.
E016 Block hash is invalid.