{"id":38602748,"url":"https://github.com/pcko1/etherscan-python","last_synced_at":"2026-01-17T08:35:15.261Z","repository":{"id":40552352,"uuid":"298646404","full_name":"pcko1/etherscan-python","owner":"pcko1","description":"A minimal, yet complete, python API for Etherscan.io.","archived":false,"fork":false,"pushed_at":"2024-03-11T04:41:00.000Z","size":1810,"stargazers_count":420,"open_issues_count":13,"forks_count":113,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-09-23T01:13:51.043Z","etag":null,"topics":["api","erc20","erc721","eth","ethereum","etherscan","etherscan-python"],"latest_commit_sha":null,"homepage":"","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/pcko1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["0xD9D6E8C16686536E3C81124639e975AdF2468197"]}},"created_at":"2020-09-25T18:07:15.000Z","updated_at":"2025-09-07T02:24:12.000Z","dependencies_parsed_at":"2024-06-18T15:29:20.906Z","dependency_job_id":"897004ab-e802-4c14-a602-d87ccc5ce25e","html_url":"https://github.com/pcko1/etherscan-python","commit_stats":{"total_commits":212,"total_committers":5,"mean_commits":42.4,"dds":0.4952830188679245,"last_synced_commit":"e059d7c91071d8999b8aaf90edb9bf7c488a110d"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/pcko1/etherscan-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcko1%2Fetherscan-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcko1%2Fetherscan-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcko1%2Fetherscan-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcko1%2Fetherscan-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pcko1","download_url":"https://codeload.github.com/pcko1/etherscan-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcko1%2Fetherscan-python/sbom","scorecard":{"id":725205,"data":{"date":"2025-08-11","repo":{"name":"github.com/pcko1/etherscan-python","commit":"e059d7c91071d8999b8aaf90edb9bf7c488a110d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 2/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/pcko1/etherscan-python/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/pcko1/etherscan-python/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/greetings.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/pcko1/etherscan-python/greetings.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/pcko1/etherscan-python/python-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/pcko1/etherscan-python/python-publish.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/build.yml:21","Warn: pipCommand not pinned by hash: .github/workflows/build.yml:22","Warn: downloadThenRun not pinned by hash: .github/workflows/build.yml:32","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:24","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 downloadThenRun dependencies pinned","Info:   0 out of   4 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/greetings.yml:1","Warn: no topLevel permission defined: .github/workflows/python-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T12:34:44.076Z","repository_id":40552352,"created_at":"2025-08-22T12:34:44.076Z","updated_at":"2025-08-22T12:34:44.076Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28504366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","erc20","erc721","eth","ethereum","etherscan","etherscan-python"],"created_at":"2026-01-17T08:35:15.130Z","updated_at":"2026-01-17T08:35:15.246Z","avatar_url":"https://github.com/pcko1.png","language":"Python","readme":"# etherscan-python\n\n[![Build Status](https://github.com/pcko1/etherscan-python/workflows/build/badge.svg)](https://github.com/pcko1/etherscan-python) \n[![codecov](https://codecov.io/gh/pcko1/etherscan-python/branch/master/graph/badge.svg)](https://codecov.io/gh/pcko1/etherscan-python)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/6db2e36886ee46f58720c6131ef58dd6)](https://app.codacy.com/gh/pcko1/etherscan-python?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=pcko1/etherscan-python\u0026utm_campaign=Badge_Grade)\n[![](https://img.shields.io/codeclimate/tech-debt/pcko1/etherscan-python)](https://codeclimate.com/github/pcko1/etherscan-python)\n[![Maintainability](https://api.codeclimate.com/v1/badges/94c15c6d8b1ec869a7fd/maintainability)](https://codeclimate.com/github/pcko1/etherscan-python/maintainability)\n[![CodeFactor](https://www.codefactor.io/repository/github/pcko1/etherscan-python/badge)](https://www.codefactor.io/repository/github/pcko1/etherscan-python)\n\n[![PyPI](https://badge.fury.io/py/etherscan-python.svg)](https://badge.fury.io/py/etherscan-python)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/etherscan-python)\n![GitHub](https://img.shields.io/github/license/pcko1/etherscan-python)\n[![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg)](https://www.python.org/downloads/release/python-385/)\n[![DOI](https://zenodo.org/badge/298646404.svg)](https://zenodo.org/badge/latestdoi/298646404)\n\n\nA minimal, yet complete, Python API for [Etherscan.io](https://etherscan.io/). \n\nAll standard and pro endpoints are provided. Kovan, Rinkeby and Ropsten testnets are also supported.\n\nAvailable on [PyPI](https://pypi.org/project/etherscan-python/). Powered by [Etherscan.io APIs](https://etherscan.io/apis#misc).\n\n\n___\n\n\n## Endpoints\n\nThe following endpoints are provided:\n\n\u003cdetails\u003e\u003csummary\u003eAccounts \u003ca href=\"https://etherscan.io/apis#accounts\"\u003e(source)\u003c/a\u003e\u003c/summary\u003e\n\u003cp\u003e\n\n* `get_eth_balance`\n* `get_eth_balance_multiple`\n* `get_normal_txs_by_address`\n* `get_normal_txs_by_address_paginated`\n* `get_internal_txs_by_address`\n* `get_internal_txs_by_address_paginated`\n* `get_internal_txs_by_txhash`\n* `get_internal_txs_by_block_range_paginated`\n* `get_erc20_token_transfer_events_by_address`\n* `get_erc20_token_transfer_events_by_contract_address_paginated`\n* `get_erc20_token_transfer_events_by_address_and_contract_paginated`\n* `get_erc721_token_transfer_events_by_address`\n* `get_erc721_token_transfer_events_by_contract_address_paginated`\n* `get_erc721_token_transfer_events_by_address_and_contract_paginated`\n* `get_mined_blocks_by_address`\n* `get_mined_blocks_by_address_paginated`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eContracts \u003ca href=\"https://etherscan.io/apis#contracts\"\u003e(source)\u003c/a\u003e\u003c/summary\u003e\n\u003cp\u003e\n  \n* `get_contract_abi`\n* `get_contract_source_code`\n\n\u003c/details\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eTransactions \u003ca href=\"https://etherscan.io/apis#transactions\"\u003e(source)\u003c/a\u003e\u003c/summary\u003e\n\u003cp\u003e\n  \n* `get_contract_execution_status`\n* `get_tx_receipt_status`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eBlocks \u003ca href=\"https://etherscan.io/apis#blocks\"\u003e(source)\u003c/a\u003e\u003c/summary\u003e\n\u003cp\u003e\n  \n* `get_block_reward_by_block_number`\n* `get_est_block_countdown_time_by_block_number`\n* `get_block_number_by_timestamp`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eGETH/Parity Proxy \u003ca href=\"https://etherscan.io/apis#proxy\"\u003e(source)\u003c/a\u003e\u003c/summary\u003e\n\u003cp\u003e\n\n* `get_proxy_block_number`\n* `get_proxy_block_by_number`\n* `get_proxy_uncle_by_block_number_and_index`\n* `get_proxy_block_transaction_count_by_number`\n* `get_proxy_transaction_by_hash`\n* `get_proxy_transaction_by_block_number_and_index`\n* `get_proxy_transaction_count`\n* `get_proxy_transaction_receipt`\n* `get_proxy_call`\n* `get_proxy_code_at`\n* `get_proxy_storage_position_at`\n* `get_proxy_gas_price`\n* `get_proxy_est_gas`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eTokens \u003ca href=\"https://etherscan.io/apis#tokens\"\u003e(source)\u003c/a\u003e\u003c/summary\u003e\n\u003cp\u003e\n  \n* `get_total_supply_by_contract_address`\n* `get_acc_balance_by_token_and_contract_address`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eGas Tracker \u003ca href=\"https://etherscan.io/apis#gastracker\"\u003e(source)\u003c/a\u003e\u003c/summary\u003e\n\u003cp\u003e\n  \n* `get_est_confirmation_time`\n* `get_gas_oracle`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eStats \u003ca href=\"https://etherscan.io/apis#stats\"\u003e(source)\u003c/a\u003e\u003c/summary\u003e\n\u003cp\u003e\n  \n* `get_total_eth_supply`\n* `get_eth_last_price`\n* `get_eth_nodes_size`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003ePro (PRO API key needed) \u003ca href=\"https://etherscan.io/apis#APIpro\"\u003e(source)\u003c/a\u003e\u003c/summary\u003e\n\u003cp\u003e\n\n* `get_hist_eth_balance_for_address_by_block_no`\n* `get_daily_average_block_size`\n* `get_daily_block_count_and_rewards`\n* `get_daily_block_rewards`\n* `get_daily_average_block_time`\n* `get_daily_uncle_block_count_and_rewards`\n* `get_hist_erc20_token_total_supply_by_contract_address_and_block_no`\n* `get_hist_erc20_token_account_balance_for_token_contract_address_by_block_no`\n* `get_token_info_by_contract_address`\n* `get_daily_average_gas_limit`\n* `get_eth_daily_total_gas_used`\n* `get_eth_daily_average_gas_price`\n* `get_eth_daily_network_tx_fee`\n* `get_daily_new_address_count`\n* `get_daily_network_utilization`\n* `get_daily_average_network_hash_rate`\n* `get_daily_tx_count`\n* `get_daily_average_network_difficulty`\n* `get_eth_hist_daily_market_cap`\n* `get_eth_hist_price`\n\n\u003c/details\u003e\n\n*If you think that a newly-added method is missing, kindly open an [issue](https://github.com/pcko1/etherscan-python/issues) as a feature request and I will do my best to add it.*\n\n## Installation\n\nBefore proceeding, you should register an account on [Etherscan.io](https://etherscan.io/) and [generate a personal API key](https://etherscan.io/myapikey) to use. \n\nIf you wish to have access to the PRO endpoints, you should obtain elevated privileges via Etherscan's subscription service.\n\nInstall from source:\n\n``` bash\npip install git+https://github.com/pcko1/etherscan-python.git\n```\n\nAlternatively, install from [PyPI](https://pypi.org/project/etherscan-python/):\n\n```bash\npip install etherscan-python\n```\n\n## Unit tests\n\nIn `bash`, test that everything looks OK on your end using your `YOUR_API_KEY` (without quotation marks) before proceeding:\n\n``` bash\nbash run_tests.sh YOUR_API_KEY\n````\n\nThis will regenerate the logs under `logs/` with the most recent results and the timestamp of the execution.\n\nThe tests also include the PRO endpoints so if your key is not PRO, the correspondings tests are expected to fail.\n\n## Usage\n\nIn `python`, create a client with your personal [Etherscan.io](https://etherscan.io/) API key:\n\n``` python\nfrom etherscan import Etherscan\neth = Etherscan(YOUR_API_KEY) # key in quotation marks\n```\n\nThen you can call all available methods, e.g.:\n\n``` python\neth.get_eth_balance(address=\"0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a\")\n\n\u003e '40891631566070000000000'\n```\nYou can also choose one of the other testnets:\n``` python\neth = Etherscan(YOUR_API_KEY, net=\"ropsten\") # net name is case-insensitive, default is main\n```\n\n## Examples\n\nExamples (arguments and results) for all methods may be found as JSON files [here](https://github.com/pcko1/etherscan-python/tree/master/logs).  For example, if you want to use the method `get_block_number_by_timestamp`, you can find the supported arguments and the format of its output in its respective [JSON file](logs/standard/get_block_number_by_timestamp.json):\n\n``` json\n{\n  \"method\": \"get_block_number_by_timestamp\",\n  \"module\": \"blocks\",\n  \"kwargs\": {\n    \"timestamp\": \"1578638524\",\n    \"closest\": \"before\"\n  },\n  \"log_timestamp\": \"2020-10-28-12:34:44\",\n  \"res\": \"9251482\"\n}\n```\n\nwhere `kwargs` refer to the required named arguments and `res` refers to the expected result if you were to run:\n\n``` python\neth.get_block_number_by_timestamp(timestamp=\"1578638524\", closest=\"before\")\n\n\u003e '9251482'\n```\n\n**Disclaimer**: Those examples blindly use the arguments originally showcased [here](https://api.etherscan.io/apis) and the selected wallets/contracts do not reflect any personal preference. You should refer to the same source for additional information regarding specific argument values.\n\n## Issues\n\nFor problems regarding installing or using the package please open an [issue](https://github.com/pcko1/etherscan-python/issues). Kindly avoid disclosing potentially sensitive information such as your API keys or your wallet addresses.\n\n## Cite\n\nKotsias, P. C., pcko1/etherscan-python. *https://github.com/pcko1/etherscan-python (2020)*. doi:10.5281/zenodo.4306855\n\nor in ```bibtex```:\n\n```bibtex\n@misc{Kotsias2020,\n  author = {Kotsias, P.C.},\n  title = {pcko1/etherscan-python},\n  year = {2020},\n  publisher = {Zenodo},\n  url = {https://github.com/pcko1/etherscan-python},\n  doi = {10.5281/zenodo.4306855}\n}\n```\n\nFeel free to leave a :star: if you found this package useful.\n\n___\n\n Powered by [Etherscan.io APIs](https://etherscan.io/apis).\n","funding_links":["0xD9D6E8C16686536E3C81124639e975AdF2468197"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcko1%2Fetherscan-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpcko1%2Fetherscan-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcko1%2Fetherscan-python/lists"}