Blockcheaper API Documentation

Introduction

Blockcheaper APIs are Crypto Blockchain communication services that can help you connect easily from a site or an application using API (Application Programming Interface). Blockcheaper using a simple RESTful JSON API for interacting with Blockchains, accessed over HTTP or HTTPS from the api.blockcheaper.com domain. By using the Blockcheaper APIs you also reduce your development and infrastructure costs. This is the infrastructure layer that significantly reduces your time-to-market.

We make automatic function, simplicity, and managing Blockchain integration easy. Affordable prices and qualified server capabilities make this service highly recommended because the internet needs people.

Currently, we support the following Cryptocurrency: Bitcoin (BTC), Ethereum (ETH), Binance Coin (BNB), Polygon (MATIC), Tron (TRX), and All Connected Tokens.

Announcement! We are no longer supporting Dogecoin Blockchain APIs. But for the solution please use Binance Coin APIs for Dogecoin BEP20 Token using this Verified Dogecoin BEP20 Smart Contract 0xba2ae424d960c26247dd6c32edc70b295c744c43. We know this can be a pain, and we apologize for asking you to.


  • Version: 1.0
  • Author: Blockcheaper Team
  • Created: July 20, 2021
  • Update: August 18, 2024

This documentation will help you get started with Blockcheaper! Learn how to create a Blockcheaper apikey, secretkey, and authorizationkey. Make your first request, do your first transaction on the Blockchain and get to building!


Getting Started

1. Create an account

To get started with Blockcheaper APIs services the first thing you need to do is create your account at https://account.blockcheaper.com. By creating an account you get access to a personalized Blockcheaper APIs Dashboard, where you can monitor and control your security key, requests, upgrade, credits, and more.

Once you create an account, you get access to a personalized Blockcheaper APIs Dashboard. Through the dashboard is where you can choose and subscribe to a Blockcheaper APIs blockchain product - Blockchain Data, Blockchain Events, Blockchain Tools, or Blockchain Automation.

From the Dashboard you can:

  1. Create and Manage your API Keys - for authorization of the API
  2. Create and Manage callback URLs - set URLs for notification
  3. Monitor successful and failed requests, credits, callbacks

2. Create API Key

The Blockcheaper APIs Technical and Best use Documentation is public and available to everyone. Still, support levels for a Blockcheaper APIs product vary depending on your subscription. To use and make calls to any Blockcheaper APIs product, you must create an API key, in order for your requests to be authenticated.

API keys are required as an authentication method with Blockcheaper APIs products. By using an API key you authenticate access to the specific API. Without authentication access to the API is denied.


Authentication

1. Use API Key

API keys are required for the authentication of the calling program to the API. All Blockcheaper APIs keys use the same base URL "https://api.blockcheaper.com". They can be used in main Production environments.

We do not recommend using the same API key for more than one environment. We do recommend using a single key for one specific environment. The API key is sensitive private information that we strongly advise to have and keep restricted access to it.

Content-Type: application/json
X-API-Key: yourapikey

It's important to secure your API Key against public access!


2. API Credential Usage - Credits

Most plans include a daily limit or “hard stop” to the number of data calls that can be made and the results provided by Blockcheaper APIs. This limit is directly tied to your API Key usage and the number of credits purchased. Your daily credits will be reloaded at 5:00 PM UTC.

The daily credit limit is tracked based on API data calls and results provided with your key. Each credit is accounted for and incremented 1:1.


REST API Resources

Almost all resources exist under a given blockchain, and follow this pattern:

https://api.blockcheaper.com/$API_VERSION/network/$COIN/$CHAIN/

Currently, there's only one version of the API (v1). Thus, here's an exhaustive list of blockchains and their corresponding resources:

Currency Chain Resource
Bitcoin (BTC) Mainnet https://api.blockcheaper.com/v1/network/btc/mainnet
Ethereum (ETH) Mainnet https://api.blockcheaper.com/v1/network/eth/mainnet
Binance Coin (BNB) Mainnet https://api.blockcheaper.com/v1/network/bnb/mainnet
Polygon (MATIC) Mainnet https://api.blockcheaper.com/v1/network/matic/mainnet
Tron (TRX) Mainnet https://api.blockcheaper.com/v1/network/trx/mainnet

You can always see the full call in the cURL code sample.


Available Network

Blockchain Protocol and Network Support

We support all connected token standards: ERC-20, BEP-20, TRC-20, MRC-20. Since the list is too long and new tokens emerge every day, we cannot include it here.

Blockchain Protocol Network Additional
Bitcoin (BTC) Mainnet -
Ethereum (ETH) Mainnet And all connected token
Binance Coin (BNB) Mainnet And all connected token
Polygon (MATIC) Mainnet And all connected token
Tron (TRX) Mainnet And all connected token

Callbacks URL

Shortly put, a “callback” is a POST request sent from Blockcheaper APIs to a user’s Callback URL when an event they have already subscribed for occurs.

Now with a bit more detail, a “callback” is used to describe an event reaction process where a user receives notifications on certain events by having first subscribed to them in the system. The term has become interchangeable with the word “webhook”, used to describe the same thing. The callback is a way for the system to avoid users constantly calling the Blockcheaper API to check for an update or event they may be expecting. Callbacks can be very useful for users who expect, track, or want to be notified about the state of transactions on the blockchain.

Callbacks require what is known as a ”Callback URL”. It is the destination where Blockcheaper APIs send the callback notification for the event. Setting up this URL is done entirely on the user’s side and is the first step to setting up a Callback.

Note: Blockcheaper APIs require the setup and verification of a domain to base a Callback URL on for security purposes, i.e. proof of access. Blockcheaper APIs will not send callbacks to unverified domains, websites, or URLs.
POST Callback Request (From Blockcheaper)
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "{{yourcallbackurl}}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "type" : "in",
    "date" : 1676717546,
    "from" : "0xf7c3a5b4fa0ba8d8b7415f3abe56ef95443af4d5",
    "to" : "0xba79985d849e6abb3b6c86665cd407cfb14ae9bf",
    "amount" : 0.0525,
    "contract" : "0x55d398326f99059fF775485246999027B3197955", // only for token transactions
    "txid" : "0xbf7ea63b2163bac1ff3451b4e2f0a40b651b2db805e287691da5189867a43d1a",
    "blockcheaper.com" : 1,
    "sign" : "6fd73e15bdac146b2442f00b359dd29aee4061a8",
    "network" : "binancesmartchain" // bitcoin, ethereum, binancesmartchain, polygon, tron
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));
curl_exec($curl);
curl_close($curl);
GET Response (For Blockcheaper Client)
if(!$_POST['blockcheaper.com'])
   return;
  
if($_POST){
    foreach($_POST as $x => $val) {
        $_POST[$x] = >$val;
    }
}

if(isset($_POST['contract'])){
    $contract = 1;
    $sign = sha1(implode(':', array(
       $_POST['type'],
       $_POST['date'],
       $_POST['to'],
       $_POST['amount'],
       $_POST['contract'], // only for token transactions
       $_POST['txid'],
       $blockcheaperapikey // Your API Key
    )));
}
else{
    $contract = 0;
    $sign = sha1(implode(':', array(
       $_POST['type'],
       $_POST['date'],
       $_POST['to'],
       $_POST['amount'],
       $_POST['txid'],
       $blockcheaperapikey // Your API Key
    )));
}

if($sign !== $_POST['sign']){
    die('Sign wrong'); // error
}
else{
    //do your script here
    echo("accepted"); // IMPORTANT!
}

Knowledge Base

1. Blockchain Units and Denominations

Each blockchain protocol has its own native decimal base denomination. The following sample is a reference for how to convert Bitcoin and Ethereum based units.

Bitcoin has 8 decimal places and the smallest unit is called a "Satoshi", in honor of the blockchain’s creator, who is known as only Satoshi Nakamoto. 1 Satoshi is equal to 0.00000001 Bitcoin.

Ethereum has 18 decimal places with the smallest unit called a “wei”. 1 Wei is 0.000000000000000001 of the Ether.

Bitcoin Denominations

Unit Denomination
1 Bitcoin = 100,000,000 Satoshi
1 Satoshi = 0.00000001 Bitcoin

Ethereum Denominations

Unit Denomination
1 Ether = 1e18 Wei
1 Wei = 0.000000000000000001 Ether

2. Blockchain Confirmations

A confirmed transaction means that the transaction has been included in a block, and therefore included in the blockchain. That means the transaction has now been officially recorded and verified, the payment can now be processed, and it can no longer be reversed.

Bitcoin blocks, containing all the most recent transactions, are added to the blockchain every 10 minutes. That means in theory, your transaction will receive its first confirmation within 10 minutes of the request being sent. Unless you’re sending huge amount worth of cryptocurrency, it’s unlikely that you’d need more than 6 confirmations for the transaction to be processed, so typically it should not take more than one hour for the transaction to be fully confirmed.

So each blockchain has its own added block time, so the speed of blockchain confirmation varies. The average of all types of blockchain confirmations is between 5 - 30 minutes.

3. Blockchain Explorer

A software for visualizing blocks, transactions, and blockchain network metrics (e.g., average transaction fees, hashrates, block size, block difficulty). To use a block explorer, you simply visit its website and enter the information you're looking for. To look up a pending transaction currently stored in the Mempool, for example, you could enter the transaction hash ID provided by your wallet or exchange.

What follows are some of the most popular blockchain explorers. There are different explorers for different types of cryptocurrency, though some explorers can be used to search multiple chains.

The Most Popular Blockchain Explorer

Cryptocurrency Explorer
Bitcoin (BTC) https://blockchain.info
Ethereum (ETH) https://etherscan.io
Binance Coin (BNB) https://bscscan.com
Polygon (MATIC) https://polygonscan.com
Tron (TRX) https://tronscan.org

Errors and API Response

All requests with a response status code different than 200 (successful HTTP "OK") are considered as a failure of the particular API call and referred to as “HTTPS errors”. When the response (error) is returned an additional JSON is present in the body containing the error message. Depending on what has gone wrong with the API call, the error message is different.

As a best practice, we recommend storing all error messages somewhere along with request data for further manual review.

The errors we use follow the HTTP Error Codes Standard.

Type HTTP Status Code Message
Client Error 400 "Bad Request"
"There was a missing reference"
"There was a serialization error"
"There was a validation error"
Client Error 401 "Login required"
"Unauthorized"
"You are not authorized to make this request"
Client Error 403 "Forbidden"
"This service has not been enabled for your site"
"XSRF Protection Failure"
Client Error 404 "The requested resource was not found"
Client Error 409 "There was a conflict"
Client Error 412 "The resource you are attempting to delete has dependencies, and cannot be deleted"
Client Error 413 "Storage space exceeded."
Client Error 429 "Too Many Requests"
Server Error 500 "The service has encountered an error"
"Internal Server Error"
Server Error 502 "Bad Gateway"
Server Error 503 "Service Unavailable"
"There was a timeout processing the request"

RESTful APIs

API is Application Programming Interface. This feature is useful to help communicate with the blockchain automatically to make it more effective and efficient. The API contains a special set of code that connects to the server.

RESTful APIs is an interface that two computer systems use to exchange information securely over the internet. Most business applications have to communicate with other internal and third-party applications to perform various tasks.

Note: Blockcheaper APIs require the setup and whitelist of a user server IP Address for security purposes. As best practice we recommend to store all error messages somewhere along with request data for further manual review.

Under this menu, we present how to communicate with Blockcheaper APIs, if you have any questions you can send an email to [email protected].


Bitcoin APIs

Through this endpoint, users can easily communication with Blockcheaper through the API.

1. Create New Address (BTC)

Through this endpoint, you can generate a New Receiving/Deposit Addresses.

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/btc/mainnet/address',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "callbackurl" : "{{yourcallbackurl}}"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "privatekey": "L15UDqcYrh1SRpD1tbCSxHe5vd7FzqQyo7krmWgVhqAXcUXduvtk",
  "address": "1PEwTceVd8CxPnrLJLrwsWYLUtmqDk7jiJ"
}

2. Get Balance (BTC)

Through this endpoint, you can check the balance of a given address based on confirmed/synced blocks only. If there are any incoming or outgoing unconfirmed transactions for the specific address, they will not be calculated here.

GET Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/btc/mainnet/getbalance/{{address}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "balance": 0.0087
}

3. Get Transaction Details (BTC)

Through this endpoint, you can obtain details about a transaction by the transaction's unique identifier using transactionId (txid).

GET Request

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/btc/mainnet/gettransaction/{{txid}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response (Send)
{
  "result": 1,
  "statuscode": 200,
  "data": {
    "amount": -0.0055,
    "fee": -0.00002882,
    "txid": "c3d46122d3b760562cf8c84a46e7da5e58b89f951c73e50ccb9b21406414fe9a",
    "time": 1667982127,
    "details": [{
        "from": "1BkfnL9o81pwiwdJYE2RkULHvcE1gUWGVq",
        "to": "1AEvZ2TdaZ3yRCWPtrZhV4aDN7gkQ3kjsi",
        "category": "send",
        "amount": -0.0055
    }]
  }
}
JSON Response (Receive)
{
  "result": 1,
  "statuscode": 200,
  "data": {
    "amount": 0.0055,
    "txid": "c3d46122d3b760562cf8c84a46e7da5e58b89f951c73e50ccb9b21406414fe9a",
    "time": 1667982127,
    "details": [{
        "to": "1AEvZ2TdaZ3yRCWPtrZhV4aDN7gkQ3kjsi",
        "category": "receive",
        "amount": 0.0055
    }]
  }
}

NOTE: If you fail receive callbacks transaction from Blockcheaper server, you can use this Get Transaction by txid method to check transactions manually. And if the transaction is recognized as a new transaction from our Blockcheaper system, it will automatically send a notification to the callback URL.


4. Estimate Fee (BTC)

Estimates fee of the blockchain network will need to pay when you execute a transaction. The network fee is required by the blockchain network, not for/from Blockcheaper. When you change withdrawal parameters, the estimated network fees or lower/upper bounds for custom network fees may change as well.

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/btc/mainnet/estimatefee',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "address" : "1vBkfnL9o81pwiwE2RkULHdJYcE1gUWGVq",
    "destination" : [{
        "address" : "{{destinationaddress1}}",
        "amount" : 0.005
    },{
        "address" : "{{destinationaddress2}}",
        "amount" : 0.001
    }]
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "amount": 0.00004518,
  "type": "sendbtc"
}

5. Send From (BTC)

Through this endpoint, you can create a request for sending coins from the specific address to another address.

a. Create Hex

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/btc/mainnet/txs/create',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "inputs" : [{
        "address" : "{{fromaddress}}",
        "amount" : 2 //amount is total outputs amount
    }],
    "outputs" : [{
        "address" : "{{destinationaddress}}",
        "amount" : 2
    }]
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "hex": "8chcg0sndahx9epqpaemuzwo8052r0gxliy4mw7la4ae4oui4nejwn7imkijh70ojujn4onax80xzeo14jdwftq3xj9ma2owya0a"
}

b. Sign Hex

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/btc/mainnet/txs/sign',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "hex" : "8chcg0sndahx9epqpaemuzwo8052r0gxliy4mw7la4ae4oui4nejwn7imkijh70ojujn4onax80xzeo14jdwftq3xj9ma2owya0a",
    "secretkey" : "{{yoursecretkey}}"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "hex": "67p3zuqm2vp0815qqipnvguf6ixs75gfmez6fcz61amhgbkxjuyh4v29y67wq7gh8lg8muhqix9qwsdtm24ftf3jlnbwbj7dz2wx"
}

c. Send

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/btc/mainnet/txs/send',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "hex" : "67p3zuqm2vp0815qqipnvguf6ixs75gfmez6fcz61amhgbkxjuyh4v29y67wq7gh8lg8muhqix9qwsdtm24ftf3jlnbwbj7dz2wx"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "txid": "c3d46122d3b760562cf8c84a46e7da5e58b89f951c73e50ccb9b21406414fe9a",
  "message": "Sent successfully"
}

6. Send To Many (BTC)

Through this endpoint, you can create a request for sending coins from the specific address to many addresses.

a. Create Hex

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/btc/mainnet/txs/create',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "inputs" : [{
        "address" : "{{fromaddress}}",
        "amount" : 10 //amount is total outputs amount
    }],
    "outputs" : [{
        "address" : "{{destinationaddress1}}",
        "amount" : 6
    },{
        "address" : "{{destinationaddress2}}",
        "amount" : 4
    }]
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "hex": "8chcg0sndahx9epqpaemuzwo8052r0gxliy4mw7la4ae4oui4nejwn7imkijh70ojujn4onax80xzeo14jdwftq3xj9ma2owya0a"
}

b. Sign Hex

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/btc/mainnet/txs/sign',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "hex" : "8chcg0sndahx9epqpaemuzwo8052r0gxliy4mw7la4ae4oui4nejwn7imkijh70ojujn4onax80xzeo14jdwftq3xj9ma2owya0a",
    "secretkey" : "{{yoursecretkey}}"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "hex": "67p3zuqm2vp0815qqipnvguf6ixs75gfmez6fcz61amhgbkxjuyh4v29y67wq7gh8lg8muhqix9qwsdtm24ftf3jlnbwbj7dz2wx"
}

c. Send

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/btc/mainnet/txs/sendtomany',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "hex" : "67p3zuqm2vp0815qqipnvguf6ixs75gfmez6fcz61amhgbkxjuyh4v29y67wq7gh8lg8muhqix9qwsdtm24ftf3jlnbwbj7dz2wx"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "txid": "c3d46122d3b760562cf8c84a46e7da5e58b89f951c73e50ccb9b21406414fe9a",
  "message": "Sent successfully"
}


Ethereum APIs

Through this endpoint, users can easily communication with Blockcheaper through the API.

1. Create New Address (ETH)

Through this endpoint, you can generate a New Receiving/Deposit Addresses.

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/eth/mainnet/address',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "callbackurl" : "{{yourcallbackurl}}"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "privatekey": "0x5244bfb26c1803b74c6ec62e95789fc1fac2e2fee2d80c0101fb4b65d813a97a",
  "address": "0x13d1569f66c41b9831e58d9bf7308396b64375d3",
  "mnemonic": "evidence game gown settle assist walk scheme upper siege pulp resemble fade"
}

2. Get Balance (ETH)

Through this endpoint, you can check the balance of a given address based on confirmed/synced blocks only. If there are any incoming or outgoing unconfirmed transactions for the specific address, they will not be calculated here.

ETH Address

GET Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/eth/mainnet/getbalance/{{address}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "balance": 10
}

ETH Assets

GET Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/eth/mainnet/getbalance/assets/{{assetid}}/{{address}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "balance": 35
}

ETH Contracts

GET Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/eth/mainnet/getbalance/assets/{{contractaddress}}/{{address}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "balance": 15
}

3. Get Transaction Details (ETH)

Through this endpoint, you can obtain details about a transaction by the transaction's unique identifier using transactionId (txid).

GET Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/eth/mainnet/gettransaction/{{txid}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response (ETH)
{
  "result": 1,
  "statuscode": 200,
  "data": {
    "txid": "0x6bee73b04e5164998e67e1631e4f84fb5ad451089bc67ca3d9f6076061ac237d",
    "nonce": 1100,
    "blockhash": "0x67a96c178ad1ec74acd1105e6560a3c0de6ce0c3db1dc5891dfeef6d92eeccb5",
    "blocknumber": 11228828,
    "transactionindex": 75,
    "from": "0x6B91dd8558FeED82dc2D274033C58A994F99C5b5",
    "to": "0x111111fb85Ed929f73A961254EEB25477B680582",
    "amount": 0.038141730210223881,
    "fee": 0.001230628101662,
    "input": "0x"
  }
}
JSON Response (Token)
{
  "result": 1,
  "statuscode": 200,
  "data": {
    "txid": "0x6bee73b04e5164998e67e1631e4f84fb5ad451089bc67ca3d9f6076061ac237d",
    "nonce": 1100,
    "blockhash": "0x67a96c178ad1ec74acd1105e6560a3c0de6ce0c3db1dc5891dfeef6d92eeccb5",
    "blocknumber": 11228828,
    "transactionindex": 75,
    "from": "0x6B91dd8558FeED82dc2D274033C58A994F99C5b5",
    "Contract": "0xdAC17F4597C13D8958D2ee523a22062069931ec7",
    "fee": 0.001230628101662,
    "input": {
        "name": "transfer",
        "params": [{
            "name": "to",
            "value": "0xabb2f709a1d76c7d2313d96d6da0d59735b5986d",
            "type": "address"
        },{
            "name": "amount",
            "value": 51783,
            "type": "uint256"
        }]
    }
  }
}

NOTE: If you fail receive callbacks transaction from Blockcheaper server, you can use this Get Transaction by txid method to check transactions manually. And if the transaction is recognized as a new transaction from our Blockcheaper system, it will automatically send a notification to the callback URL.


4. Estimate Fee (ETH)

Estimates fee of the blockchain network will need to pay when you execute a transaction. The network fee is required by the blockchain network, not for/from Blockcheaper. When you change withdrawal parameters, the estimated network fees or lower/upper bounds for custom network fees may change as well.

ETH Address

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/eth/mainnet/estimatefee',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "address" : "0x6B91dd8558FeED82dc2D274033C58A994F99C5b5",
    "destination" : "0xdAC17F4597C13D8958D2ee523a22062069931ec7",
    "amount" : 10
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "amount": 0.5,
  "type": "sendeth"
}

ETH Tokens

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/eth/mainnet/estimatefee',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "address" : "0x6B91dd8558FeED82dc2D274033C58A994F99C5b5",
    "contractaddress" : "0x55d398326f99059fF775485246999027B3197955",
    "destination" : "0xdAC17F4597C13D8958D2ee523a22062069931ec7",
    "amount" : 5
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "amount": 0.5,
  "type": "sendtoken"
}

NOTE: When use this estimatefee API for smart contract (token), make sure the address has (hold) the token balance.


5. Send From (ETH)

Through this endpoint, you can create a request for sending coins from the specific address to another address.

a1. Create Hex (ETH)

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/eth/mainnet/txs/create',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "inputs" : [{
        "address" : "{{fromaddress}}",
        "amount" : 10 //amount is total outputs amount
    }],
    "outputs" : [{
        "address" : "{{destinationaddress}}",
        "amount" : 10
    }]
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "hex": "8chcg0sndahx9epqpaemuzwo8052r0gxliy4mw7la4ae4oui4nejwn7imkijh70ojujn4onax80xzeo14jdwftq3xj9ma2owya0a"
}

a2. Create Hex (ERC20)

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/eth/mainnet/txs/create/contracts',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "inputs" : [{
        "address" : "{{fromaddress}}",
        "contractaddress" : "{{contractaddress}}",
        "amount" : 10 //amount is total outputs amount
    }],
    "outputs" : [{
        "address" : "{{destinationaddress}}",
        "amount" : 10
    }]
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "hex": "8chcg0sndahx9epqpaemuzwo8052r0gxliy4mw7la4ae4oui4nejwn7imkijh70ojujn4onax80xzeo14jdwftq3xj9ma2owya0a"
}

b. Sign Hex

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/eth/mainnet/txs/sign',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "hex" : "8chcg0sndahx9epqpaemuzwo8052r0gxliy4mw7la4ae4oui4nejwn7imkijh70ojujn4onax80xzeo14jdwftq3xj9ma2owya0a",
    "secretkey" : "{{yoursecretkey}}"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "hex": "67p3zuqm2vp0815qqipnvguf6ixs75gfmez6fcz61amhgbkxjuyh4v29y67wq7gh8lg8muhqix9qwsdtm24ftf3jlnbwbj7dz2wx"
}

c. Send

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/eth/mainnet/txs/send',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "hex" : "67p3zuqm2vp0815qqipnvguf6ixs75gfmez6fcz61amhgbkxjuyh4v29y67wq7gh8lg8muhqix9qwsdtm24ftf3jlnbwbj7dz2wx"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "txid": "0xbf7ea63b2163bac1ff3451b4e2f0a40b651b2db805e287691da5189867a43d1a",
  "message": "Sent successfully"
}

Binance APIs

Through this endpoint, users can easily communication with Blockcheaper through the API.

1. Create New Address (BNB)

Through this endpoint, you can generate a New Receiving/Deposit Addresses.

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/bnb/mainnet/address',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "callbackurl" : "{{yourcallbackurl}}"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "privatekey": "0x5244bfb26c1803b74c6ec62e95789fc1fac2e2fee2d80c0101fb4b65d813a97a",
  "address": "0x13d1569f66c41b9831e58d9bf7308396b64375d3",
  "mnemonic": "evidence game gown settle assist walk scheme upper siege pulp resemble fade"
}

2. Get Balance (BNB)

Through this endpoint, you can check the balance of a given address based on confirmed/synced blocks only. If there are any incoming or outgoing unconfirmed transactions for the specific address, they will not be calculated here.

BNB Address

GET Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/bnb/mainnet/getbalance/{{address}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "balance": 10
}

BNB Assets

GET Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/bnb/mainnet/getbalance/assets/{{assetid}}/{{address}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "balance": 35
}

BNB Contracts

GET Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/bnb/mainnet/getbalance/assets/{{contractaddress}}/{{address}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "balance": 15
}

3. Get Transaction Details (BNB)

Through this endpoint, you can obtain details about a transaction by the transaction's unique identifier using transactionId (txid).

GET Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/bnb/mainnet/gettransaction/{{txid}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response (BNB)
{
  "result": 1,
  "statuscode": 200,
  "data": {
    "txid": "0x6bee73b04e5164998e67e1631e4f84fb5ad451089bc67ca3d9f6076061ac237d",
    "nonce": 1100,
    "blockhash": "0x67a96c178ad1ec74acd1105e6560a3c0de6ce0c3db1dc5891dfeef6d92eeccb5",
    "blocknumber": 11228828,
    "transactionindex": 75,
    "from": "0x6B91dd8558FeED82dc2D274033C58A994F99C5b5",
    "to": "0x111111fb85Ed929f73A961254EEB25477B680582",
    "amount": 0.038141730210223881,
    "fee": 0.001230628101662,
    "input": "0x"
  }
}
JSON Response (Token)
{
  "result": 1,
  "statuscode": 200,
  "data": {
    "txid": "0x6bee73b04e5164998e67e1631e4f84fb5ad451089bc67ca3d9f6076061ac237d",
    "nonce": 1100,
    "blockhash": "0x67a96c178ad1ec74acd1105e6560a3c0de6ce0c3db1dc5891dfeef6d92eeccb5",
    "blocknumber": 11228828,
    "transactionindex": 75,
    "from": "0x6B91dd8558FeED82dc2D274033C58A994F99C5b5",
    "Contract": "0xdAC17F4597C13D8958D2ee523a22062069931ec7",
    "fee": 0.001230628101662,
    "input": {
        "name": "transfer",
        "params": [{
            "name": "to",
            "value": "0xabb2f709a1d76c7d2313d96d6da0d59735b5986d",
            "type": "address"
        },{
            "name": "amount",
            "value": 51783,
            "type": "uint256"
        }]
    }
  }
}

NOTE: If you fail receive callbacks transaction from Blockcheaper server, you can use this Get Transaction by txid method to check transactions manually. And if the transaction is recognized as a new transaction from our Blockcheaper system, it will automatically send a notification to the callback URL.


4. Estimate Fee (BNB)

Estimates fee of the blockchain network will need to pay when you execute a transaction. The network fee is required by the blockchain network, not for/from Blockcheaper. When you change withdrawal parameters, the estimated network fees or lower/upper bounds for custom network fees may change as well.

BNB Address

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/bnb/mainnet/estimatefee',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "address" : "0x6B91dd8558FeED82dc2D274033C58A994F99C5b5",
    "destination" : "0xdAC17F4597C13D8958D2ee523a22062069931ec7",
    "amount" : 10
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "amount": 0.5,
  "type": "sendbnb"
}

BNB Tokens

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/bnb/mainnet/estimatefee',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "address" : "0x6B91dd8558FeED82dc2D274033C58A994F99C5b5",
    "contractaddress" : "0x55d398326f99059fF775485246999027B3197955",
    "destination" : "0xdAC17F4597C13D8958D2ee523a22062069931ec7",
    "amount" : 5
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "amount": 0.5,
  "type": "sendtoken"
}

NOTE: When use this estimatefee API for smart contract (token), make sure the address has (hold) the token balance.


5. Send From (BNB)

Through this endpoint, you can create a request for sending coins from the specific address to another address.

a1. Create Hex (BNB)

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/bnb/mainnet/txs/create',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "inputs" : [{
        "address" : "{{fromaddress}}",
        "amount" : 10 //amount is total outputs amount
    }],
    "outputs" : [{
        "address" : "{{destinationaddress}}",
        "amount" : 10
    }]
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "hex": "8chcg0sndahx9epqpaemuzwo8052r0gxliy4mw7la4ae4oui4nejwn7imkijh70ojujn4onax80xzeo14jdwftq3xj9ma2owya0a"
}

a2. Create Hex (BEP20)

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/bnb/mainnet/txs/create/contracts',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "inputs" : [{
        "address" : "{{fromaddress}}",
        "contractaddress" : "{{contractaddress}}",
        "amount" : 10 //amount is total outputs amount
    }],
    "outputs" : [{
        "address" : "{{destinationaddress}}",
        "amount" : 10
    }]
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "hex": "8chcg0sndahx9epqpaemuzwo8052r0gxliy4mw7la4ae4oui4nejwn7imkijh70ojujn4onax80xzeo14jdwftq3xj9ma2owya0a"
}

b. Sign Hex

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/bnb/mainnet/txs/sign',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "hex" : "8chcg0sndahx9epqpaemuzwo8052r0gxliy4mw7la4ae4oui4nejwn7imkijh70ojujn4onax80xzeo14jdwftq3xj9ma2owya0a",
    "secretkey" : "{{yoursecretkey}}"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "hex": "67p3zuqm2vp0815qqipnvguf6ixs75gfmez6fcz61amhgbkxjuyh4v29y67wq7gh8lg8muhqix9qwsdtm24ftf3jlnbwbj7dz2wx"
}

c. Send

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/bnb/mainnet/txs/send',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "hex" : "67p3zuqm2vp0815qqipnvguf6ixs75gfmez6fcz61amhgbkxjuyh4v29y67wq7gh8lg8muhqix9qwsdtm24ftf3jlnbwbj7dz2wx"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "txid": "0xbf7ea63b2163bac1ff3451b4e2f0a40b651b2db805e287691da5189867a43d1a",
  "message": "Sent successfully"
}

Polygon APIs

Through this endpoint, users can easily communication with Blockcheaper through the API.

1. Create New Address (MATIC)

Through this endpoint, you can generate a New Receiving/Deposit Addresses.

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/matic/mainnet/address',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "callbackurl" : "{{yourcallbackurl}}"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "privatekey": "0x5244bfb26c1803b74c6ec62e95789fc1fac2e2fee2d80c0101fb4b65d813a97a",
  "address": "0x13d1569f66c41b9831e58d9bf7308396b64375d3",
  "mnemonic": "evidence game gown settle assist walk scheme upper siege pulp resemble fade"
}

2. Get Balance (MATIC)

Through this endpoint, you can check the balance of a given address based on confirmed/synced blocks only. If there are any incoming or outgoing unconfirmed transactions for the specific address, they will not be calculated here.

MATIC Address

GET Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/matic/mainnet/getbalance/{{address}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "balance": 10
}

MATIC Assets

GET Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/matic/mainnet/getbalance/assets/{{assetid}}/{{address}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "balance": 35
}

MATIC Contracts

GET Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/matic/mainnet/getbalance/assets/{{contractaddress}}/{{address}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "balance": 15
}

3. Get Transaction Details (MATIC)

Through this endpoint, you can obtain details about a transaction by the transaction's unique identifier using transactionId (txid).

GET Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/matic/mainnet/gettransaction/{{txid}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response (MATIC)
{
  "result": 1,
  "statuscode": 200,
  "data": {
    "txid": "0x6bee73b04e5164998e67e1631e4f84fb5ad451089bc67ca3d9f6076061ac237d",
    "nonce": 1100,
    "blockhash": "0x67a96c178ad1ec74acd1105e6560a3c0de6ce0c3db1dc5891dfeef6d92eeccb5",
    "blocknumber": 11228828,
    "transactionindex": 75,
    "from": "0x6B91dd8558FeED82dc2D274033C58A994F99C5b5",
    "to": "0x111111fb85Ed929f73A961254EEB25477B680582",
    "amount": 0.038141730210223881,
    "fee": 0.001230628101662,
    "input": "0x"
  }
}
JSON Response (Token)
{
  "result": 1,
  "statuscode": 200,
  "data": {
    "txid": "0x6bee73b04e5164998e67e1631e4f84fb5ad451089bc67ca3d9f6076061ac237d",
    "nonce": 1100,
    "blockhash": "0x67a96c178ad1ec74acd1105e6560a3c0de6ce0c3db1dc5891dfeef6d92eeccb5",
    "blocknumber": 11228828,
    "transactionindex": 75,
    "from": "0x6B91dd8558FeED82dc2D274033C58A994F99C5b5",
    "Contract": "0xdAC17F4597C13D8958D2ee523a22062069931ec7",
    "fee": 0.001230628101662,
    "input": "0xa9059cbb000000000000000000000000736c23b4f64093b332dd5c6f50d59f357b11f3190000000000000000000000000000000000000000000000000000000001b9827f"
    }
  }
}

NOTE: If you fail receive callbacks transaction from Blockcheaper server, you can use this Get Transaction by txid method to check transactions manually. And if the transaction is recognized as a new transaction from our Blockcheaper system, it will automatically send a notification to the callback URL.


4. Estimate Fee (MATIC)

Estimates fee of the blockchain network will need to pay when you execute a transaction. The network fee is required by the blockchain network, not for/from Blockcheaper. When you change withdrawal parameters, the estimated network fees or lower/upper bounds for custom network fees may change as well.

MATIC Address

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/matic/mainnet/estimatefee',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "address" : "0x6B91dd8558FeED82dc2D274033C58A994F99C5b5",
    "destination" : "0xdAC17F4597C13D8958D2ee523a22062069931ec7",
    "amount" : 10
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "amount": 0.5,
  "type": "sendmatic"
}

MATIC Tokens

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/matic/mainnet/estimatefee',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "address" : "0x6B91dd8558FeED82dc2D274033C58A994F99C5b5",
    "contractaddress" : "0x55d398326f99059fF775485246999027B3197955",
    "destination" : "0xdAC17F4597C13D8958D2ee523a22062069931ec7",
    "amount" : 5
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "amount": 0.5,
  "type": "sendtoken"
}

NOTE: When use this estimatefee API for smart contract (token), make sure the address has (hold) the token balance.


5. Send From (MATIC)

Through this endpoint, you can create a request for sending coins from the specific address to another address.

a1. Create Hex (MATIC)

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/matic/mainnet/txs/create',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "inputs" : [{
        "address" : "{{fromaddress}}",
        "amount" : 10 //amount is total outputs amount
    }],
    "outputs" : [{
        "address" : "{{destinationaddress}}",
        "amount" : 10
    }]
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "hex": "8chcg0sndahx9epqpaemuzwo8052r0gxliy4mw7la4ae4oui4nejwn7imkijh70ojujn4onax80xzeo14jdwftq3xj9ma2owya0a"
}

a2. Create Hex (MRC20)

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/matic/mainnet/txs/create/contracts',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "inputs" : [{
        "address" : "{{fromaddress}}",
        "contractaddress" : "{{contractaddress}}",
        "amount" : 10 //amount is total outputs amount
    }],
    "outputs" : [{
        "address" : "{{destinationaddress}}",
        "amount" : 10
    }]
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "hex": "8chcg0sndahx9epqpaemuzwo8052r0gxliy4mw7la4ae4oui4nejwn7imkijh70ojujn4onax80xzeo14jdwftq3xj9ma2owya0a"
}

b. Sign Hex

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/matic/mainnet/txs/sign',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "hex" : "8chcg0sndahx9epqpaemuzwo8052r0gxliy4mw7la4ae4oui4nejwn7imkijh70ojujn4onax80xzeo14jdwftq3xj9ma2owya0a",
    "secretkey" : "{{yoursecretkey}}"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "hex": "67p3zuqm2vp0815qqipnvguf6ixs75gfmez6fcz61amhgbkxjuyh4v29y67wq7gh8lg8muhqix9qwsdtm24ftf3jlnbwbj7dz2wx"
}

c. Send

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/matic/mainnet/txs/send',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "hex" : "67p3zuqm2vp0815qqipnvguf6ixs75gfmez6fcz61amhgbkxjuyh4v29y67wq7gh8lg8muhqix9qwsdtm24ftf3jlnbwbj7dz2wx"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "txid": "0xbf7ea63b2163bac1ff3451b4e2f0a40b651b2db805e287691da5189867a43d1a",
  "message": "Sent successfully"
}

TRON APIs

Through this endpoint, users can easily communication with Blockcheaper through the API.

1. Create New Address (TRX)

Through this endpoint, you can generate a New Receiving/Deposit Addresses.

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/trx/mainnet/address',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "callbackurl" : "{{yourcallbackurl}}"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "privatekey": "07C5432D3DD3BF593EE98797C96E55D4910F8A0167DB966E9E92D7EF32C5BD8DD",
  "address": "TCDFx2gdzP17cSfEfLxzv9pi4LkatyDHnr",
}

2. Get Balance (TRX)

Through this endpoint, you can check the balance of a given address based on confirmed/synced blocks only. If there are any incoming or outgoing unconfirmed transactions for the specific address, they will not be calculated here.

TRX Address

GET Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/trx/mainnet/getbalance/{{address}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "balance": 10
}

TRX Assets

GET Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/trx/mainnet/getbalance/assets/{{assetid}}/{{address}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "balance": 35
}

TRX Contracts

GET Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/trx/mainnet/getbalance/assets/{{contractaddress}}/{{address}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "balance": 15
}

3. Get Transaction Details (TRX)

Through this endpoint, you can obtain details about a transaction by the transaction's unique identifier using transactionId (txid).

GET Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/trx/mainnet/gettransaction/{{txid}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response (TRX)
{
  "result": 1,
  "statuscode": 200,
  "data": {
    "txid": "56c464160a8f776049bc1fe8a364e4c2bb5979cc513f00689e20826b6859654b",
    "from": "TTgZJWdkcg4qM8nZQGKfgf6E63Wb8SuFr6",
    "to": "THaRQ3Z411wkuMJ7wXwEepwETLTgsPWD4T",
    "amount": 10.5,
    "fee": 5.17338,
    "timestamp": 1676478293649
  }
}
JSON Response (TRC20)
{
  "result": 1,
  "statuscode": 200,
  "data": {
    "txid": "56c464160a8f776049bc1fe8a364e4c2bb5979cc513f00689e20826b6859654b",
    "from": "TTgZJWdkcg4qM8nZQGKfgf6E63Wb8SuFr6",
    "to": "THaRQ3Z411wkuMJ7wXwEepwETLTgsPWD4T",
    "amount": 10.5,
    "fee": 5.17338,
    "contractaddress": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
    "timestamp": 1676478293649
  }
}
JSON Response (TRC10)
{
  "result": 1,
  "statuscode": 200,
  "data": {
    "txid": "56c464160a8f776049bc1fe8a364e4c2bb5979cc513f00689e20826b6859654b",
    "from": "TTgZJWdkcg4qM8nZQGKfgf6E63Wb8SuFr6",
    "to": "THaRQ3Z411wkuMJ7wXwEepwETLTgsPWD4T",
    "amount": 10.5,
    "fee": 5.17338,
    "tokenid": 1002000,
    "timestamp": 1676478293649
  }
}

NOTE: If you fail receive callbacks transaction from Blockcheaper server, you can use this Get Transaction by txid method to check transactions manually. And if the transaction is recognized as a new transaction from our Blockcheaper system, it will automatically send a notification to the callback URL.


4. Estimate Fee (TRX)

Estimates fee of the blockchain network will need to pay when you execute a transaction. The network fee is required by the blockchain network, not for/from Blockcheaper. When you change withdrawal parameters, the estimated network fees or lower/upper bounds for custom network fees may change as well.

TRX Address

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/trx/mainnet/estimatefee',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "address" : "TMu5uoUFn6P5i1upUZIRFC8OQtMQOYGBnjTRMdrjVRJWuVcCVG",
    "destination" : "T91qNxcObYYccDyTd4gPiyMHtEG6Mv4y0UFnYphMcLPXzDGkdw",
    "amount" : 10
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "amount": 0.5,
  "type": "sendtrx"
}

TRX Tokens

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/trx/mainnet/estimatefee',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "address" : "TMu5uoUFn6P5i1upUZIRFC8OQtMQOYGBnjTRMdrjVRJWuVcCVG",
    "contractaddress" : "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
    "destination" : "T91qNxcObYYccDyTd4gPiyMHtEG6Mv4y0UFnYphMcLPXzDGkdw",
    "amount" : 5
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "amount": 0.5,
  "type": "sendtoken"
}

5. Send From (TRX)

Through this endpoint, you can create a request for sending coins from the specific address to another address.

a1. Create Hex (TRX)

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/trx/mainnet/txs/create',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "inputs" : [{
        "address" : "{{fromaddress}}",
        "amount" : 10 //amount is total outputs amount
    }],
    "outputs" : [{
        "address" : "{{destinationaddress}}",
        "amount" : 10
    }]
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "hex": "8chcg0sndahx9epqpaemuzwo8052r0gxliy4mw7la4ae4oui4nejwn7imkijh70ojujn4onax80xzeo14jdwftq3xj9ma2owya0a"
}

a2. Create Hex (TRC10)

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/trx/mainnet/txs/create/assets',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "inputs" : [{
        "address" : "{{fromaddress}}",
        "assetid" : "{{assetid}}",
        "amount" : 10 //amount is total outputs amount
    }],
    "outputs" : [{
        "address" : "{{destinationaddress}}",
        "amount" : 10
    }]
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "hex": "8chcg0sndahx9epqpaemuzwo8052r0gxliy4mw7la4ae4oui4nejwn7imkijh70ojujn4onax80xzeo14jdwftq3xj9ma2owya0a"
}

a3. Create Hex (TRC20)

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/trx/mainnet/txs/create/contracts',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "inputs" : [{
        "address" : "{{fromaddress}}",
        "contractaddress" : "{{contractaddress}}",
        "amount" : 10 //amount is total outputs amount
    }],
    "outputs" : [{
        "address" : "{{destinationaddress}}",
        "amount" : 10
    }]
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "hex": "8chcg0sndahx9epqpaemuzwo8052r0gxliy4mw7la4ae4oui4nejwn7imkijh70ojujn4onax80xzeo14jdwftq3xj9ma2owya0a"
}

b. Sign Hex

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/trx/mainnet/txs/sign',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "hex" : "8chcg0sndahx9epqpaemuzwo8052r0gxliy4mw7la4ae4oui4nejwn7imkijh70ojujn4onax80xzeo14jdwftq3xj9ma2owya0a",
    "secretkey" : "{{yoursecretkey}}"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "hex": "67p3zuqm2vp0815qqipnvguf6ixs75gfmez6fcz61amhgbkxjuyh4v29y67wq7gh8lg8muhqix9qwsdtm24ftf3jlnbwbj7dz2wx"
}

c. Send

POST Request
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blockcheaper.com/v1/network/trx/mainnet/txs/send',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => '{
    "hex" : "67p3zuqm2vp0815qqipnvguf6ixs75gfmez6fcz61amhgbkxjuyh4v29y67wq7gh8lg8muhqix9qwsdtm24ftf3jlnbwbj7dz2wx"
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-API-Key: {{yourapikey}}',
    'Authorization-Key: {{yourauthorizationkey}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JSON Response
{
  "result": 1,
  "statuscode": 200,
  "txid": "p36z05un7ec7rvgt2p30orskr6skt7hgbwxxel1z95eoyku2jxpr31nbj65jmjjaydx13fj20xwx9q3c",
  "message": "Sent successfully"
}

FAQ

A FAQ is a list of frequently asked questions (FAQs) and answers on a particular topic.

Lorem Ipsum ...
Iisque Anim pariatur ...

Support

If this documentation doesn't answer your questions, please send us Email via [email protected]

We are located in GMT +7 time zone and we answer all questions within 12-24 hours in weekdays. In some rare cases the waiting time can be to 48 hours. (except holiday seasons which might take longer).

Note: While we aim to provide the best support possible, please keep in mind that it only extends to verified buyers and only to issues related to our template like bugs and errors. Custom modifications or third party module implementations are not included.