Network
GET /v1/p/network
Get network details for a given blockchain ID.
- HTTP
- Python
curl -X GET "$ETHGAS_API_URL/v1/p/network?chainId=1"
import requests
url = f"{ETHGAS_API_URL}/v1/p/network"
params = {'chainId': 1}
response = requests.get(url, params=params)
print(response.text)
Request
| Parameter | Required | Type | Description |
|---|---|---|---|
| chainId | YES | integer | Chain ID |
Response Body
| Name | Type | Description |
|---|---|---|
| network | object | Blockchain details |
| └ networkId | integer | Unique ID for the blockchain network assigned by ETHGas |
| └ chainId | integer | Chain ID |
| └ name | string | Name of the blockchain network (e.g. Ethereum) |
| └ enable | boolean | Whether this chain is enabled within ETHGas |
| └ visible | boolean | Whether this chain is visible on ETHGas |
Example Response
{
"success": true,
"data": {
"network": {
"networkId": 1,
"chainId": 11155111,
"name": "Ethereum",
"enable": true,
"visible": true
}
}
}