# metagraph (/docs/query/metagraph)

`name` and `symbol` are decoded to text (the wire carries them as
compact-u16 vectors of utf-8 bytes, unlike every other text field).
On runtimes with miner collateral (spec >= 435), each neuron also carries
`collateral_locked`, `collateral_min`, and `collateral_earned` (alpha
balances; `None` on older nodes).

**Category:** Subnets

## Parameters [#parameters]

| Parameter | Type    | Description                      |
| --------- | ------- | -------------------------------- |
| `netuid`  | integer | Subnet whose metagraph to fetch. |

## CLI [#cli]

```bash
btcli query metagraph --netuid <integer> --json
```

## Python [#python]

```python
import bittensor as bt

sub = bt.Subtensor()
result = sub.read("metagraph", netuid=1)
```

## On-chain implementation [#on-chain-implementation]

* Runtime API [`SubnetInfoRuntimeApi.get_metagraph`](/code/pallets/subtensor/src/rpc_info/metagraph.rs#L653-L828)

Every file is browsable under [/code](/code) exactly as built into the runtime.
