Gas Fees
Ethereum Gas Fees API documentation
The /eth/v1/gasfees
API returns an estimate of the next block gas fees in Gwei.
It determines this based on the calculated next block base fee and a linear regression prediction based on the last 5 blocks of fees.
Get Gas Fee Estimates
GET
https://data.spiceai.io/eth/v1/gasfees
Returns an estimate of the next block Ethereum gas fees.
Query Parameters
Name | Type | Description |
---|---|---|
api_key | String | API key for higher rate limits. |
The /eth/v1/gasfees?price=usd
API returns an estimate of the next block gas fees in Gwei and the current price in the specified currency or token.
Get Gas Fee Estimates With Price
GET
https://data.spiceai.io/eth/v1/gasfees?price=usd
Returns an estimate of the next block Ethereum gas fees with price in the given currency or token.
Query Parameters
Name | Type | Description |
---|---|---|
api_key | String | API key for higher rate limits. |
price* | String | Currency or token for pricing conversion. Currently support USD. |
The /eth/v1/gasfees?period=1d
API returns the historical gas used ratio and gas fees by block over the specified time period. If a period is not specified, it will default to 24 hours.
Get Historical Gas Used and Fees by Block
GET
https://data.spiceai.io/eth/v1/gasfees?period=1d
Returns historical gas used and fees over time.
One of start
or period
is required.
Query Parameters
Name | Type | Description |
---|---|---|
api_key | String | API key for higher rate limits. |
start | String | The beginning of the historical period. Will default to 24h ago if not provided. |
period | String | The period specified as a . E.g. 5d. If not specified, will default from start until now, or 24 hours if start is also not provided. |
granularity | String | The granularity of aggregation specified as a . E.g. 1d. If not specified, fees per block will be provided. |
The /eth/v1/gasfees?period=1w&granularity=1d
API returns the historical gas used ratio and gas fees by time granularity over the specified time period. If a period is not specified, it will default to 24 hours.
Get Historical Gas Used and Fees by Time Granularity
GET
https://data.spiceai.io/eth/v1/gasfees?period=7d&granularity=1d
Returns historical gas used and fees over time.
One of start
or period
is required. granularity
is required.
Query Parameters
Name | Type | Description |
---|---|---|
api_key | String | API key for higher rate limits. |
start | String | The beginning of the historical period. Will default to 24h ago if not provided. |
period | String | The period specified as a . E.g. 5d. If not specified, will default from start until now, or 24 hours if start is also not provided. |
granularity* | String | The granularity of aggregation specified as a . E.g. 1d. If not specified, fees per block will be provided. |
Last updated