$api_base = "https://blockchainapi.org/api/eth";
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $api_base . "?method=check_fees"
$response = curl_exec($curl);
$http_status_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($http_status_code == 200) {
$decoded = json_decode($response, true);
$gas = $decoded['success']['gas']; // In WEI
$gasPrice = $decoded['success']['gasPrice']; // In WEI
$transaction_fee = $decoded['success']['transaction_fee']; // In ETH
$lastUpdated = $decoded['success']['lastUpdated'];
echo "Failed to get fees";