Get real-time gas prices
curl --request GET \
--url https://api.hypermid.io/v1/gas-prices \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.hypermid.io/v1/gas-prices"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.hypermid.io/v1/gas-prices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hypermid.io/v1/gas-prices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hypermid.io/v1/gas-prices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hypermid.io/v1/gas-prices")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hypermid.io/v1/gas-prices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"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
}
}
}
Discovery
Get Gas Prices
Get current gas prices for supported chains
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>'import requests
url = "https://api.hypermid.io/v1/gas-prices"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.hypermid.io/v1/gas-prices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hypermid.io/v1/gas-prices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hypermid.io/v1/gas-prices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hypermid.io/v1/gas-prices")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hypermid.io/v1/gas-prices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"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.
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");
curl "https://api.hypermid.io/v1/gas-prices?chainId=1" \
-H "X-API-Key: your-api-key"
req, _ := http.NewRequest("GET",
"https://api.hypermid.io/v1/gas-prices?chainId=1", nil)
req.Header.Set("X-API-Key", "your-api-key")
resp, _ := http.DefaultClient.Do(req)
Authorizations
Partner API key. Optional for public endpoints, required for /v1/partner/*.
Query Parameters
Comma-separated chain IDs
⌘I