# subnetInfo_getSubnetsInfo_v2 - Bittensor RPC Method

## Overview

The `subnetInfo_getSubnetsInfo_v2` method returns the newer subnet catalog format for the full Bittensor network. Like `subnetInfo_getSubnetsInfo`, it gives you a network-wide view of active subnets, but it is designed for newer runtimes that package more subnet state into a single SCALE payload.

Use this method when you need a single request that can drive subnet discovery, analytics backends, or control-plane tooling. It is especially useful when you want to compare many subnets at once instead of making one request per subnet.

## SCALE Decoding

The shared Dwellir endpoint returns this payload as a JSON byte array, not as a hex string. Decode it with the Bittensor type registry that matches the target runtime.

**Using `bittensor` Python SDK:** Use the SDK when you want decoded subnet information without manually working through SCALE bytes. The SDK is the most practical option for dashboards, subnet catalogs, and analytics tooling.

**Using `@polkadot/api`:** Register the relevant Bittensor subnet info types before decoding the returned byte array. This is the better fit when you are already running a TypeScript service that consumes multiple Bittensor RPC methods.

**When to prefer `v2`:**

- Use `subnetInfo_getSubnetsInfo_v2` when your tooling expects the newer subnet-info layout.
- Use `subnetInfo_getSubnetsInfo` when you need the older layout or when your decoder is already wired to the legacy type definitions.
- Use `subnetInfo_getDynamicInfo` when you only need one subnet's live economics instead of the full catalog.

## Code Examples

## Request Parameters

- `at` (`DATA, optional`): Optional block hash used as state reference.

## Request Example

```bash
curl -X POST https://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "subnetInfo_getSubnetsInfo_v2",
    "params": [null],
    "id": 1
  }'
```

## Response Fields

- `result` (`DATA, required`): `DATA` - SCALE-encoded subnet info in v2 format.

## Successful Response

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x55aa77cc"
}
```

### Query with Python

```python
import requests

url = 'https://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY'

payload = {
    'jsonrpc': '2.0',
    'method': 'subnetInfo_getSubnetsInfo_v2',
    'params': [None],
    'id': 1
}

response = requests.post(url, json=payload)
result = response.json()

scale_bytes = result['result']
print(f'Subnet catalog payload size: {len(scale_bytes)} bytes')

# Decode with a Bittensor-aware type registry or SDK.
```

### Query with cURL

```bash
curl -X POST https://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY \
  -H 'Content-Type: application/json' \
  -d '{
    "jsonrpc": "2.0",
    "method": "subnetInfo_getSubnetsInfo_v2",
    "params": [null],
    "id": 1
  }'
```

## Common Use Cases

- **Subnet discovery** — Build a current list of active Bittensor subnets and their associated metadata.
- **Analytics backends** — Snapshot network-wide subnet state before deeper per-subnet processing.
- **Explorer infrastructure** — Power subnet overview pages without making dozens of individual requests.
- **Historical comparisons** — Query the catalog at a specific block hash to compare how the subnet set changed over time.

## Related Methods

- [`subnetInfo_getSubnetsInfo`](https://www.dwellir.com/docs/bittensor/subnetInfo_getSubnetsInfo) -- Legacy subnet catalog method
- [`subnetInfo_getDynamicInfo`](https://www.dwellir.com/docs/bittensor/subnetInfo_getDynamicInfo) -- Dynamic economics for a single subnet
- [`subnetInfo_getMetagraph`](https://www.dwellir.com/docs/bittensor/subnetInfo_getMetagraph) -- Full neuron topology for a specific subnet
