{"id":19330999,"url":"https://github.com/psqnt/blockstream","last_synced_at":"2025-04-22T23:31:39.056Z","repository":{"id":57415692,"uuid":"185686301","full_name":"psqnt/blockstream","owner":"psqnt","description":"API Wrapper for http://blockstream.info and Command Line Tool","archived":false,"fork":false,"pushed_at":"2020-11-27T23:52:55.000Z","size":39,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T12:41:05.704Z","etag":null,"topics":["api-wrapper","bitcoin","bitcoin-analytics","cli","command-line-tool","python","python3"],"latest_commit_sha":null,"homepage":"https://blockstream.info","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/psqnt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-08T22:14:43.000Z","updated_at":"2023-12-16T22:54:17.000Z","dependencies_parsed_at":"2022-09-01T16:22:31.862Z","dependency_job_id":null,"html_url":"https://github.com/psqnt/blockstream","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psqnt%2Fblockstream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psqnt%2Fblockstream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psqnt%2Fblockstream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psqnt%2Fblockstream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/psqnt","download_url":"https://codeload.github.com/psqnt/blockstream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250340250,"owners_count":21414506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-wrapper","bitcoin","bitcoin-analytics","cli","command-line-tool","python","python3"],"created_at":"2024-11-10T02:38:35.115Z","updated_at":"2025-04-22T23:31:38.795Z","avatar_url":"https://github.com/psqnt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# blockstream\nA python 3 wrapper and CLI for blockstream.info's Bitcoin block explorer API\n\nWritten in Python 3\n\nDocs: https://github.com/psqnt/blockstream/blob/master/docs.md\n\nBlock explorer: https://blockstream.info\n\nAPI Reference: https://github.com/Blockstream/esplora/blob/master/API.md\n\n## Install\n```\npip install blockstream\n```\n\nif not in a python3 virtualenv make sure to use python3\n```\npip3 install blockstream\n```\n\n## Usage\nThis will install a command line tool called `bsapi` or \nyou can import into a python project\n\n#### Command Line Tool Help\n```\nUsage: bsapi [OPTIONS] [INFILE] [OUTFILE] COMMAND [ARGS]...\n\nOptions:\n  -v, --verbose\n  --help         Show this message and exit.\n\nCommands:\n  request  Makes a request to blockstream info api and echos response\n```\n\n```python\nfrom blockstream import blockexplorer\n\n# get transaction by id\ntx_id = '56a5b477182cddb6edb460b39135a3dc785eaf7ea88a572052a761d6983e26a2'\ntx = blockexplorer.get_transaction(tx_id)\n\n# get address data\naddress = '3ADPkym6mQ2HyP7uASh5g3VYauhCWZpczF'\naddr_info = blockexplorer.get_address(address)\n```\n\n## Examples\nReference examples.py to see each method in use\n\n#### Command Line Tool Examples:\n```\necho -n \"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f\" | bsapi - - request --param_type transaction\n```\n```\necho -n \"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f\" | bsapi - - request --param_type hash\n{\n  \"id\": \"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f\",\n  \"height\": 0,\n  \"version\": 1,\n  \"timestamp\": 1231006505,\n  \"tx_count\": 1,\n  \"size\": 285,\n  \"weight\": 816,\n  \"merkle_root\": \"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b\",\n  \"previous_block_hash\": null,\n  \"nonce\": 2083236893,\n  \"bits\": 486604799\n}\n```\n```\nbsapi - - request 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f --param_type hash\n{\n  \"id\": \"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f\",\n  \"height\": 0,\n  \"version\": 1,\n  \"timestamp\": 1231006505,\n  \"tx_count\": 1,\n  \"size\": 285,\n  \"weight\": 816,\n  \"merkle_root\": \"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b\",\n  \"previous_block_hash\": null,\n  \"nonce\": 2083236893,\n  \"bits\": 486604799\n}\n```\n\n## Issues\nthe `scripthash` endpoint seems to be broken, however you can get data about a scripthash address by calling the `address` endpoint. I have decided to remove the functions to hit the `scripthash` endpoint for now.\n\nAlso the broadcast transaction api endpoint has not been implemented yet\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsqnt%2Fblockstream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsqnt%2Fblockstream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsqnt%2Fblockstream/lists"}