Registry / aws / blockfrost-python

blockfrost-python

JSON →
library0.7.0pypypi✓ verified 84d ago

The official Python SDK for Blockfrost API v0.1.86. Provides a simple interface to interact with the Cardano blockchain via the Blockfrost API. Current version: 0.7.0. Active development with occasional releases.

pip install blockfrost-python
INSTALL
IMPORT
SIG · BLOCKFROST-PYTHON
B
blockfrost-python
awspythonv0.7.0
Install
2.2s avg
Import
639ms
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.7.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.672s · 21.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.2s · import 0.606s · 22MB
20MB installed
● package 20MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BlockFrostApi
from blockfrost import BlockFrostApi
from blockfrost_python import BlockFrostApi
Incorrect module name; package is 'blockfrost'
BlockFrostApi
from blockfrost import BlockFrostApi
import blockfrost
Direct import does not automatically expose BlockFrostApi; must use from import

Initialize the API client with a Blockfrost project ID and fetch the latest block.

from blockfrost import BlockFrostApi api = BlockFrostApi(project_id=os.environ.get('BLOCKFROST_PROJECT_ID', '')) # Retrieve the latest block block = api.block_latest() print(block)
Debug
Known issues
gotchaBlockFrostApi requires the 'project_id' argument (or the environment variable BLOCKFROST_PROJECT_ID). Without it, requests will fail with 403.
fix
Set BLOCKFROST_PROJECT_ID environment variable or pass project_id parameter.
affects: all
breakingVersion 0.6.0 removed the deprecated 'api_version' parameter. Use 'base_url' instead to point to a custom backend.
fix
Replace api_version='v0' with base_url='https://your-custom-url/'.
affects: >=0.6.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'blockfrost_python'
The correct module name is 'blockfrost', not 'blockfrost_python'.
fix
Install: pip install blockfrost-python. Import: from blockfrost import BlockFrostApi
AttributeError: module 'blockfrost' has no attribute 'BlockFrostApi'
Importing using 'import blockfrost' does not automatically expose the class.
fix
Use: from blockfrost import BlockFrostApi
blockfrost.exceptions.ApiError: (403) Forbidden
Missing or invalid project_id. The API key is required.
fix
Set environment variable BLOCKFROST_PROJECT_ID or pass project_id parameter.
Upgrade
Version history
0.7.0latest on PyPI · released Mar 16, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
25 hits · last 30 days
node
24
Resources
blockfrost-python — pip install blockfrost-python · libregistry