Get current and historical gas
You need current gas to price a transaction and historical fees to model costs or backtest. Standard eth_gasPrice and eth_feeHistory cover both. Historical windows hit archive depth and are served from our own nodes — no archive node to maintain.
- An API key (sk_live_...) with read access.
- For history, a block count and starting block for eth_feeHistory.
1Get the current gas price
POST eth_gasPrice to /v1/rpc/eth for the current price in wei. This is a C1 recent read.
curl https://api.1st-node.com/v1/rpc/eth \
-H "Authorization: Bearer sk_live_..." \
-d '{"method":"eth_gasPrice","params":[]}'2Pull historical base fees
Use eth_feeHistory with a block count, a target block and reward percentiles to get per-block base fees and priority fee samples.
curl https://api.1st-node.com/v1/rpc/eth \
-H "Authorization: Bearer sk_live_..." \
-d '{"method":"eth_feeHistory","params":["0x5","latest",[25,50,75]]}'3Read the fee history result
baseFeePerGas lists base fees per block and reward holds the requested priority-fee percentiles. Deep historical windows are archive depth (C2).
> {
> "oldestBlock": "0x12d683",
> "baseFeePerGas": ["0x3b9aca00","0x3f5476a00"],
> "reward": [["0x59682f00"]]
> }常见问题
Can I get gas prices from months ago?
Yes. eth_feeHistory over old ranges is served from our archive nodes at archive depth (C2). Standard JSON-RPC works unchanged and you pay per call.
Is eth_gasPrice or eth_feeHistory better for EIP-1559?
Use eth_feeHistory for EIP-1559 — it returns base fees and priority-fee percentiles. eth_gasPrice returns a single legacy estimate.
继续阅读
充值、拿密钥、上线。
自助开通。支持加密货币或银行卡。按额度计费——重型原语更贵,简单调用很便宜。
获取 API 密钥