Skip to main content

bt-network-api

A FastAPI REST service exposing Bittensor network data through the Bittensor SDK.

Features

  • Chain status and network data over HTTP
  • Mock mode for offline development and testing
  • Configurable network, host, and port

Endpoints

Route Description
GET / Service index
GET /health Liveness check
GET /block Current chain block number
GET /subnets All subnet info
GET /neurons/{netuid} Neurons on a subnet
GET /metagraph/{netuid} Metagraph of a subnet
GET /delegates Delegate identities
GET /staking/{address} Stake info for a coldkey address

Install

pip install bt-network-api

Usage

# Install from source
uv sync --extra dev

# Run the server (defaults to 0.0.0.0:8091)
uv run bt-network-api --host 0.0.0.0 --port 8091

# Or via uvicorn
uv run uvicorn bt_network_api.app:app --host 0.0.0.0 --port 8091

Verify it is running:

curl -s http://localhost:8091/health

Configuration

Environment variables:

Variable Default Description
BT_API_NETWORK finney Bittensor network name
BT_API_MOCK 0 Use mock data (1) instead of the live chain

Development

uv run ruff format --check src tests
uv run ruff check src
uv run mypy src/
uv run pytest
uv build

Metadata

Release files for bt-network-api 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bt-network-api 0.1.0
File Size Uploaded Provenance Actions
bt_network_api-0.1.0.tar.gz 5.2 kB Without provenance Details for bt_network_api-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bt-network-api 0.1.0
File Interpreter ABI Platform Actions
bt_network_api-0.1.0-py3-none-any.whl Python 3 none any Details for bt_network_api-0.1.0-py3-none-any.whl

Total release size: 11.1 kB

Release files / bt_network_api-0.1.0.tar.gz

Download URL bt_network_api-0.1.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7d9c9c65276904d2c7547a07051cf2442f98f872cc847ad0a95252c6dd5e8f62
BLAKE2b-256 checksum
How to use checksums
efa75c03e1b8933bf22842963ca92eb4fc67873f6c8dbb775b09560a2ef468b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release files / bt_network_api-0.1.0-py3-none-any.whl

Download URL bt_network_api-0.1.0-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98ede62883d907b66fded299e1a5c989bc09bb5674cd9c8cadf531b0f506d63f
BLAKE2b-256 checksum
How to use checksums
2e79671c1e43b8fa5fb11557f9ba83c15e81239a81df68b4b2f9113780b49737
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Security for bt-network-api 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page