curl --request GET \
--url https://api.zerion.io/v1/gas-prices/ \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.zerion.io/v1/gas-prices/"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.zerion.io/v1/gas-prices/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zerion.io/v1/gas-prices/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": [
{
"type": "gas-prices",
"id": "eip1559-base",
"attributes": {
"updated_at": "2023-02-28T19:24:39.000Z",
"gas_type": "classic",
"info": {
"slow": 48000000000,
"standard": 48000000000,
"fast": 51000000000
}
},
"relationships": {
"chain": {
"links": {
"related": "https://api.zerion.io/v1/chains/polygon"
},
"data": {
"type": "chains",
"id": "polygon"
}
}
}
}
],
"links": {
"self": "https://api.zerion.io/v1/gas-prices/?filter%5Bchain_ids%5D=base&filter%5Bgas_types%5D=eip1559"
}
}{
"errors": [
{
"title": "Parameter is malformed",
"detail": "Some validation errors will be described here"
}
]
}{
"errors": [
{
"title": "Unauthorized Error",
"detail": "The API key is invalid, please, make sure that you are using a valid key"
}
]
}{
"errors": [
{
"title": "Payment required",
"detail": "Provide an API key via \"Authorization: Basic <base64(api_key:)>\" or pay using one of the methods advertised in response headers"
}
]
}{
"errors": [
{
"title": "Too many requests",
"detail": "Your request had been throttled"
}
]
}{
"errors": [
{
"title": "Service is temporarily unavailable",
"detail": "Please, retry later (check the Retry-After header)"
}
]
}Get list of all available gas prices
Real-time gas price estimates for every supported chain, at each speed tier, plus Solana’s rent-exempt cost.
curl --request GET \
--url https://api.zerion.io/v1/gas-prices/ \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.zerion.io/v1/gas-prices/"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.zerion.io/v1/gas-prices/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zerion.io/v1/gas-prices/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": [
{
"type": "gas-prices",
"id": "eip1559-base",
"attributes": {
"updated_at": "2023-02-28T19:24:39.000Z",
"gas_type": "classic",
"info": {
"slow": 48000000000,
"standard": 48000000000,
"fast": 51000000000
}
},
"relationships": {
"chain": {
"links": {
"related": "https://api.zerion.io/v1/chains/polygon"
},
"data": {
"type": "chains",
"id": "polygon"
}
}
}
}
],
"links": {
"self": "https://api.zerion.io/v1/gas-prices/?filter%5Bchain_ids%5D=base&filter%5Bgas_types%5D=eip1559"
}
}{
"errors": [
{
"title": "Parameter is malformed",
"detail": "Some validation errors will be described here"
}
]
}{
"errors": [
{
"title": "Unauthorized Error",
"detail": "The API key is invalid, please, make sure that you are using a valid key"
}
]
}{
"errors": [
{
"title": "Payment required",
"detail": "Provide an API key via \"Authorization: Basic <base64(api_key:)>\" or pay using one of the methods advertised in response headers"
}
]
}{
"errors": [
{
"title": "Too many requests",
"detail": "Your request had been throttled"
}
]
}{
"errors": [
{
"title": "Service is temporarily unavailable",
"detail": "Please, retry later (check the Retry-After header)"
}
]
}Authorizations
To test endpoints here, paste your API key from the Dashboard into the username field and leave the password empty.
Query Parameters
Return only gas prices for these chains (comma-separated list). Defaults to every chain reporting supports_gas_prices. Only chains reporting supports_gas_prices in the flags of GET /v1/chains/ are returned. A chain that fails that gate, or that GET /v1/chains/ doesn't list, is left out of data, and the response is still 200 when another requested chain passes (for example ethereum,astar-zkevm returns only the ethereum prices). If no requested chain passes, the response is 400 rather than an empty result, with detail reading chain <id> does not support gas prices for one of the requested chains (for example chain astar-zkevm does not support gas prices). A chain whose gas prices are temporarily unavailable is left out of data. If every requested chain that can produce a requested gas type is unavailable, the response is 503 with a Retry-After header.
Return only gas prices of these gas types (comma-separated list). Accepts classic, eip1559 and solana, and any other value returns 400. Defaults to all three types. Solana produces only solana, and every other chain produces only classic and eip1559. Chains that can't produce a requested type are skipped, so filter[gas_types]=solana&filter[chain_ids]=ethereum returns 200 with an empty data.
Format of the gas.
classic, eip1559, solana Was this page helpful?