๐ฏGas Tracker API Endpoints
Notes
Endpoints with ๐
ฟ๐๐
พ
are under the API Pro subscription. To upgrade your API plan, browse through the BscScan APIs page.
//imports
using BscScan.NetCore.Contracts;
//inject
private readonly IBscScanGasTrackerService _bscScanGasTrackerService;
โฝ๏ธGet Gas Oracleโ
Returns the current Safe, Proposed and Fast gas prices.โ
- Request
- Response
- ...
//Sample Request ๐
var gasOracle = await _bscScanGasTrackerService.GetGasOracleAsync();
//will return a new object GasOracle with values: ๐
var gasOracle = new GasOracle
{
Status = "1",
Message = "OK",
Result = new GasOracleData
{
LastBlock = "15939320",
SafeGasPrice = "5",
ProposeGasPrice = "5.5",
FastGasPrice = "27.5",
UsdPrice = "371.25"
}
};
๐ For more information Check out Get Gas Oracle
โฝ๏ธGet Daily Average Gas Limit๐
ฟ๐๐
พ
โ
Returns the historical daily average gas limit of the BNB Smart Chain network.โ
- Request
- Response
- ...
//Sample Request ๐
var parameters = new DailyAverageGasLimitRequest
{
StartDate = new DateOnly(2021,8,1),
EndDate = new DateOnly(2021,8,28),
Sort = Sort.Asc
};
var dailyAverageGasLimit = await _bscScanGasTrackerService.GetDailyAverageGasLimitAsync(parameters);
//will return a new object DailyAverageGasLimit with values: ๐
var dailyAverageGasLimit= new DailyAverageGasLimit
{
Status = "1",
Message = "OK",
Result =new List<DailyAverageGasLimitData>
{
new()
{
UtcDate = "2021-08-01",
UnixTimeStamp = "1627776000",
GasLimit = "77995057"
},
new()
{
UtcDate = "2021-08-02",
UnixTimeStamp = "1627862400",
GasLimit = "77477220"
},
new()
{
UtcDate = "2021-08-03",
UnixTimeStamp = "1627948800",
GasLimit = "77163193"
}
}
};
๐ For more information Check out Get Daily Average Gas Limit`๐
ฟ๐๐
พ`
โฝ๏ธGet BNB Smart Chain Daily Total Gas Used๐
ฟ๐๐
พ
โ
Returns the total amount of gas used daily for transctions on the BNB Smart Chain network.โ
- Request
- Response
- ...
//Sample Request ๐
var parameters = new BnbSmartChainDailyTotalGasUsedRequest
{
StartDate = new DateOnly(2021,8,1),
EndDate = new DateOnly(2021,8,28),
Sort = Sort.Asc
};
var bnbSmartChainDailyTotalGasUsed = await _bscScanGasTrackerService
.GetBnbSmartChainDailyTotalGasUsedAsync(parameters);
//will return a new object BnbSmartChainDailyTotalGasUsed with values: ๐
var bnbSmartChainDailyTotalGasUsed= new BnbSmartChainDailyTotalGasUsed
{
Status = "1",
Message = "OK",
Result =new List<BnbSmartChainDailyTotalGasUsedData>
{
new()
{
UtcDate = "2021-02-01",
UnixTimeStamp = "1612137600",
GasUsed = "70672744503"
},
new()
{
UtcDate = "2021-02-02",
UnixTimeStamp = "1612224000",
GasUsed = "73905877156"
},
new()
{
UtcDate = "2021-02-03",
UnixTimeStamp = "1612310400",
GasUsed = "75696419315"
}
}
};
๐ For more information Check out Get BNB Smart Chain Daily Total Gas Used`๐
ฟ๐๐
พ`
โฝ๏ธGet Daily Average Gas Price๐
ฟ๐๐
พ
โ
Returns the daily average gas price used on the BNB Smart Chain network.โ
- Request
- Response
- ...
//Sample Request ๐
var parameters = new DailyAverageGasPriceRequest
{
StartDate = new DateOnly(2021,8,1),
EndDate = new DateOnly(2021,8,28),
Sort = Sort.Asc
};
var dailyAverageGasPrice = await _bscScanGasTrackerService.GetDailyAverageGasPriceAsync(parameters);
//will return a new object DailyAverageGasPrice with values: ๐
var dailyAverageGasPricea= new DailyAverageGasPrice
{
Status = "1",
Message = "OK",
Result =new List<DailyAverageGasPriceData>
{
new()
{
UtcDate = "2021-02-01",
UnixTimeStamp = "1612137600",
MaxGasPriceWei = "4557272900001",
MinGasPriceWei = "20000000000",
AvgGasPriceWei = "26264086210"
},
new()
{
UtcDate = "2021-02-02",
UnixTimeStamp = "1612224000",
MaxGasPriceWei = "5449370028101",
MinGasPriceWei = "20000000000",
AvgGasPriceWei = "26877628667"
},
new()
{
UtcDate = "2021-02-03",
UnixTimeStamp = "1612310400",
MaxGasPriceWei = "5440938161363",
MinGasPriceWei = "20000000000",
AvgGasPriceWei = "24451656852"
}
}
};
๐ For more information Check out Get Daily Average Gas Price`๐
ฟ๐๐
พ`