{"id":23369,"library":"blockfrost-python","title":"Blockfrost Python SDK","description":"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.","status":"active","version":"0.7.0","language":"python","source_language":"en","source_url":"https://github.com/blockfrost/blockfrost-python","tags":["cardano","blockchain","api-sdk","blockfrost"],"install":[{"cmd":"pip install blockfrost-python","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Incorrect module name; package is 'blockfrost'","wrong":"from blockfrost_python import BlockFrostApi","symbol":"BlockFrostApi","correct":"from blockfrost import BlockFrostApi"},{"note":"Direct import does not automatically expose BlockFrostApi; must use from import","wrong":"import blockfrost","symbol":"BlockFrostApi","correct":"from blockfrost import BlockFrostApi"}],"quickstart":{"code":"from blockfrost import BlockFrostApi\n\napi = BlockFrostApi(project_id=os.environ.get('BLOCKFROST_PROJECT_ID', ''))\n# Retrieve the latest block\nblock = api.block_latest()\nprint(block)","lang":"python","description":"Initialize the API client with a Blockfrost project ID and fetch the latest block."},"warnings":[{"fix":"Set BLOCKFROST_PROJECT_ID environment variable or pass project_id parameter.","message":"BlockFrostApi requires the 'project_id' argument (or the environment variable BLOCKFROST_PROJECT_ID). Without it, requests will fail with 403.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace api_version='v0' with base_url='https://your-custom-url/'.","message":"Version 0.6.0 removed the deprecated 'api_version' parameter. Use 'base_url' instead to point to a custom backend.","severity":"breaking","affected_versions":">=0.6.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install: pip install blockfrost-python. Import: from blockfrost import BlockFrostApi","cause":"The correct module name is 'blockfrost', not 'blockfrost_python'.","error":"ModuleNotFoundError: No module named 'blockfrost_python'"},{"fix":"Use: from blockfrost import BlockFrostApi","cause":"Importing using 'import blockfrost' does not automatically expose the class.","error":"AttributeError: module 'blockfrost' has no attribute 'BlockFrostApi'"},{"fix":"Set environment variable BLOCKFROST_PROJECT_ID or pass project_id parameter.","cause":"Missing or invalid project_id. The API key is required.","error":"blockfrost.exceptions.ApiError: (403) Forbidden"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}