Usage
Chainlist
Returns the list of all supported Etherscan mainnet and testnet chains.
GET
/
v2
/
chainlist
Chainlist
curl --request GET \
--url https://api.etherscan.io/v2/chainlistimport requests
url = "https://api.etherscan.io/v2/chainlist"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.etherscan.io/v2/chainlist', 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.etherscan.io/v2/chainlist",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.etherscan.io/v2/chainlist"
req, _ := http.NewRequest("GET", url, nil)
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.etherscan.io/v2/chainlist")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.etherscan.io/v2/chainlist")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"comments": "List of API endpoints maintained by Etherscan EAAS. Available Status codes are (0)=Offline, (1)=Ok, (2)=Degraded",
"totalcount": 67,
"result": [
{
"chainname": "Ethereum Mainnet",
"chainid": "1",
"blockexplorer": "https://etherscan.io/",
"apiurl": "https://api.etherscan.io/v2/api?chainid=1",
"status": 1,
"comment": ""
},
{
"chainname": "Sepolia Testnet",
"chainid": "11155111",
"blockexplorer": "https://sepolia.etherscan.io/",
"apiurl": "https://api.etherscan.io/v2/api?chainid=11155111",
"status": 1,
"comment": ""
},
{
"chainname": "Base Mainnet",
"chainid": "8453",
"blockexplorer": "https://basescan.org/",
"apiurl": "https://api.etherscan.io/v2/api?chainid=8453",
"status": 1,
"comment": ""
},
{
"chainname": "Polygon Mainnet",
"chainid": "137",
"blockexplorer": "https://polygonscan.com/",
"apiurl": "https://api.etherscan.io/v2/api?chainid=137",
"status": 1,
"comment": ""
},
{
"chainname": "Arbitrum One Mainnet",
"chainid": "42161",
"blockexplorer": "https://arbiscan.io/",
"apiurl": "https://api.etherscan.io/v2/api?chainid=42161",
"status": 1,
"comment": ""
}
]
}
Query Parameters
No parameters required.{
"comments": "List of API endpoints maintained by Etherscan EAAS. Available Status codes are (0)=Offline, (1)=Ok, (2)=Degraded",
"totalcount": 67,
"result": [
{
"chainname": "Ethereum Mainnet",
"chainid": "1",
"blockexplorer": "https://etherscan.io/",
"apiurl": "https://api.etherscan.io/v2/api?chainid=1",
"status": 1,
"comment": ""
},
{
"chainname": "Sepolia Testnet",
"chainid": "11155111",
"blockexplorer": "https://sepolia.etherscan.io/",
"apiurl": "https://api.etherscan.io/v2/api?chainid=11155111",
"status": 1,
"comment": ""
},
{
"chainname": "Base Mainnet",
"chainid": "8453",
"blockexplorer": "https://basescan.org/",
"apiurl": "https://api.etherscan.io/v2/api?chainid=8453",
"status": 1,
"comment": ""
},
{
"chainname": "Polygon Mainnet",
"chainid": "137",
"blockexplorer": "https://polygonscan.com/",
"apiurl": "https://api.etherscan.io/v2/api?chainid=137",
"status": 1,
"comment": ""
},
{
"chainname": "Arbitrum One Mainnet",
"chainid": "42161",
"blockexplorer": "https://arbiscan.io/",
"apiurl": "https://api.etherscan.io/v2/api?chainid=42161",
"status": 1,
"comment": ""
}
]
}
⌘I