GET /api/explorer/v2/gas/{chain}/avg

Auth X-Hub-Key from API_HUB_KEYExecute GET /run/oklink/api/explorer/v2/gas/{chain}/avgCache cached 1s, never served stale past that windowCost free · weight 0 · standard rate classSource billing free

Average gas series for one speed unit

Parameters

nameintypedescription
chainpathstr
btc | eth | x1 | xlayer | sol | solana | tron | bsc | base | sui | apt | aptos | arbitrum | optimism | polygon | avax | avalanche | zksync | ton | gravity
requiredWeb chain slug (eth, bsc, sol, …)
example: eth
unitquerystroptionalSpeed bucket the gas page requests
example: fast

Response

type: object
pagination: none
sample: {
  "code": "int",
  "data": "array",
  "detailMsg": "str",
  "msg": "str"
}

Safe request

Reads the credential from API_HUB_KEY; it never appears in the URL.

curl -sH "X-Hub-Key: $API_HUB_KEY" "https://openapihub.dev/run/oklink/api/explorer/v2/gas/eth/avg?unit=fast"