network-parameters - Flow
Returns the network parameters of the connected Flow network, chiefly the chain identifier (flow-mainnet, flow-testnet, …). Use it to confirm which network an endpoint serves.
Endpoint
httpGET /v1/network/parametersExample
bashexport FLOW_REST=https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/
curl "${FLOW_REST}v1/network/parameters"example.js
javascriptconst axios = require('axios');
const response = await axios.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/v1/network/parameters', {
headers: { 'Content-Type': 'application/json' }
});
console.log(response.data);example.py
pythonimport requests
response = requests.get(
'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/v1/network/parameters',
headers={'Content-Type': 'application/json'}
)
print(response.json())example.rs
rustuse reqwest::Client;
use serde_json::Value;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let response = client
.get("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/v1/network/parameters")
.header("Content-Type", "application/json")
.send()
.await?
.json::<Value>()
.await?;
println!("Result: {}", response);
Ok(())
}Response
json{
"chain_id": "flow-mainnet"
}Response Fields
| Field | Type | Description |
|---|---|---|
| chain_id | string | Flow network chain id, e.g. flow-mainnet |
Use Cases
- Network Confirmation: Verify an endpoint is on Flow mainnet
- Multi-Network Apps: Branch logic by chain id
Error Handling
| Error | Message | Description |
|---|---|---|
| 400 / Bad request | Bad request | A path, query, or body parameter was invalid |
| 404 / Not found | Not found | The block, account, transaction, or resource does not exist |
| 403 / RBAC: access denied | Access denied | The GetBlock access token is missing or incorrect |