Skip to main content
GET
/
v1
/
gas-prices
Get real-time gas prices
curl --request GET \
  --url https://api.hypermid.io/v1/gas-prices \
  --header 'X-API-Key: <api-key>'
{
  "data": {
    "chainId": 1,
    "speed": {
      "slow": {
        "gasPrice": "15000000000",
        "maxFeePerGas": "15000000000",
        "maxPriorityFeePerGas": "1000000000",
        "estimatedTime": 120
      },
      "standard": {
        "gasPrice": "20000000000",
        "maxFeePerGas": "20000000000",
        "maxPriorityFeePerGas": "1500000000",
        "estimatedTime": 30
      },
      "fast": {
        "gasPrice": "30000000000",
        "maxFeePerGas": "30000000000",
        "maxPriorityFeePerGas": "2500000000",
        "estimatedTime": 15
      }
    },
    "lastUpdated": 1711234567
  },
  "error": null,
  "meta": {
    "requestId": "e5f6a7b8-c9d0-1234-ef01-345678901234",
    "timestamp": 1711234571,
    "rateLimit": {
      "limit": 2000,
      "remaining": 1995,
      "reset": 1711234627
    }
  }
}
Returns the current gas prices for the specified chain, useful for estimating transaction costs.
chainId
number
required
The chain ID to get gas prices for (e.g., 1 for Ethereum).
{
  "data": {
    "chainId": 1,
    "speed": {
      "slow": {
        "gasPrice": "15000000000",
        "maxFeePerGas": "15000000000",
        "maxPriorityFeePerGas": "1000000000",
        "estimatedTime": 120
      },
      "standard": {
        "gasPrice": "20000000000",
        "maxFeePerGas": "20000000000",
        "maxPriorityFeePerGas": "1500000000",
        "estimatedTime": 30
      },
      "fast": {
        "gasPrice": "30000000000",
        "maxFeePerGas": "30000000000",
        "maxPriorityFeePerGas": "2500000000",
        "estimatedTime": 15
      }
    },
    "lastUpdated": 1711234567
  },
  "error": null,
  "meta": {
    "requestId": "e5f6a7b8-c9d0-1234-ef01-345678901234",
    "timestamp": 1711234571,
    "rateLimit": {
      "limit": 2000,
      "remaining": 1995,
      "reset": 1711234627
    }
  }
}
const gas = await client.getGasPrices({ chainId: 1 });

console.log("Standard gas price:", gas.data.speed.standard.gasPrice);
console.log("Estimated time:", gas.data.speed.standard.estimatedTime, "seconds");

Authorizations

X-API-Key
string
header
required

Partner API key. Optional for public endpoints, required for /v1/partner/*.

Query Parameters

chains
string

Comma-separated chain IDs

Response

Gas price data

data
any
required

Response payload (null on error)

error
object
required
meta
object
required