Skip to main content

Parameters

chainId
string
default:"322"
required
Unique identifier for a blockchain network.
id
number
default:1
required
Request identifier used to match responses.
jsonrpc
string
default:"2.0"
required
JSON-RPC version.
method
string
default:"eth_feeHistory"
required
JSON-RPC method name.
params
object
required
Parameters: [blockCount, newestBlock, rewardPercentiles]Positional parameters for eth_feeHistory:
  • params[0]: Hex-encoded number of blocks in the requested range (max: 0x400 / 1024 blocks).
  • params[1]: Newest block identifier: a hex block number or one of: “latest”, “earliest”, “pending”.
  • params[2]: Optional array of integers representing percentiles (ascending).

Returns

result
object
Historical gas fee statistics over the requested range of blocks.
curl --request POST \
  --url https://api.uniblock.dev/uni/v1/json-rpc?chainId=322 \
  --header 'content-type: application/json' \
  --data '{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "eth_feeHistory",
    "params": [
      "0x5",
      "latest",
      [
        20,
        30
      ]
    ]
  }'
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "oldestBlock": "0x14535f8",
    "baseFeePerGas": [
      "0x279c70a9b",
      "0x2a63ee068",
      "0x2a01a5449",
      "0x299fc09af",
      "..."
    ],
    "baseFeePerBlobGas": [
      "0xe3f5193b",
      "0xf6942037",
      "0xdb2e5553",
      "0xc2d3d9e8",
      "..."
    ],
    "gasUsedRatio": [
      0.7806543666666667,
      0.46377263333333335,
      0.46358696666666666,
      0.503863,
      "..."
    ],
    "blobGasUsedRatio": [
      0.8333333333333334,
      0,
      0,
      1,
      "..."
    ],
    "reward": [
      [
        "0x5f5e100",
        "0x34142698"
      ],
      [
        "0x5f5e100",
        "0x1f619e76"
      ],
      [
        "0x5f5e100",
        "0x39d10680"
      ],
      [
        "0x6824280",
        "0x214c9a15"
      ],
      "..."
    ]
  }
}