All Projects → pcko1 → etherscan-python

pcko1 / etherscan-python

Licence: MIT license
A minimal, yet complete, python API for Etherscan.io.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to etherscan-python

Wallet3
A secure mobile wallet for web3
Stars: ✭ 13 (-96.12%)
Mutual labels:  eth, erc20, erc721
ethereum-dex
Decentralized exchange implementation for the 0xcert protocol on the Ethereum blockchain.
Stars: ✭ 18 (-94.63%)
Mutual labels:  eth, erc721
go-dc-wallet
交易所收提币功能
Stars: ✭ 76 (-77.31%)
Mutual labels:  eth, erc20
Simple-Game-ERC-721-Token-Template
🔮 Very Simple ERC-721 Smart Contract Template to create your own ERC-721 Tokens on the Ethereum Blockchain, with many customizable Options 🔮
Stars: ✭ 83 (-75.22%)
Mutual labels:  eth, erc721
nftfy-v1-core
A decentralized protocol for NFT fractionalization
Stars: ✭ 62 (-81.49%)
Mutual labels:  erc20, erc721
Cryptocurrency Icons
A set of icons for all the main cryptocurrencies and altcoins, in a range of styles and sizes.
Stars: ✭ 2,116 (+531.64%)
Mutual labels:  erc20, erc721
defi-dapps-solidity-smart-contracts
This is a Web 3 Smart Contract learning and teaching repo which will be used to teach students all across Pakistan.
Stars: ✭ 241 (-28.06%)
Mutual labels:  erc20, erc721
ethereum-crowdsale
0xcert protocol crowdsale contracts for Ethereum blockchain.
Stars: ✭ 15 (-95.52%)
Mutual labels:  eth, erc20
nft-swap-sdk
Ethereum's missing p2p NFT and token swap library for web3 developers. Written in TypeScript. Powered by 0x.
Stars: ✭ 200 (-40.3%)
Mutual labels:  erc20, erc721
Eth Hot Wallet
Ethereum wallet with erc20 support / web wallet - built using react, web3, eth-lightwallet
Stars: ✭ 205 (-38.81%)
Mutual labels:  eth, erc20
niftygate
Drop-in Access Control via NFT Ownership
Stars: ✭ 61 (-81.79%)
Mutual labels:  erc20, erc721
ethereum-erc20
Fungible token implementation for the Ethereum blockchain.
Stars: ✭ 27 (-91.94%)
Mutual labels:  eth, erc20
ethereum-kit-ios
Comprehensive EVM SDK (ex: Ethereum, Binance Smart Chain) for iOS, implemented on Swift. Create wallets, watch wallets (read-only), sync transactions, filter transactions by type (erc20, bep20, swap transactions etc.), swap using native DEX protocols, easily extendable to work with custom smart contracts, and full support for EIP1159.
Stars: ✭ 148 (-55.82%)
Mutual labels:  erc20, erc721
erc721
The reference implementation of the ERC-721 non-fungible token standard.
Stars: ✭ 989 (+195.22%)
Mutual labels:  eth, erc721
etherscan-api
🎸 Golang client for Ethereum Etherscan API (and its families like BscScan) / Golang 以太坊 Etherscan API库(也支持同一家族的BscScan)
Stars: ✭ 126 (-62.39%)
Mutual labels:  eth, etherscan
awesome-ico-truths
Awesome Initial Coin Offerings (ICO) Truths - The Art of the Steal - The Scammers' Big Lies ++ ICO tokens are like bitcoins, ICOs are like IPOs, ICO White Papers are like "Due Diligence" Inverstor Prospectus, ...
Stars: ✭ 32 (-90.45%)
Mutual labels:  erc20, erc721
zeneth
🏵️ Let Your ETH Chill — Gasless Ethereum account abstraction with Flashbots
Stars: ✭ 112 (-66.57%)
Mutual labels:  eth, erc20
starkgate-frontend
Bridge interface allows users to transfer ERC20 tokens from Ethereum to StarkNet and vice versa.
Stars: ✭ 75 (-77.61%)
Mutual labels:  erc20
platzi-exchange
Proyecto del Curso Basico de Vue.js de Platzi 💚
Stars: ✭ 26 (-92.24%)
Mutual labels:  eth
web3jdemo
功能强大的web3j以太坊用例,支持批量生成钱包,批量不同账户转账,查询余额等,监控,定时任务,交易mint等方法,持续更新中... ...
Stars: ✭ 262 (-21.79%)
Mutual labels:  eth

etherscan-python

Build Status codecov Codacy Badge Maintainability CodeFactor

PyPI PyPI - Downloads GitHub Python 3.8 DOI

A minimal, yet complete, Python API for Etherscan.io.

All standard and pro endpoints are provided. Kovan, Rinkeby and Ropsten testnets are also supported.

Available on PyPI. Powered by Etherscan.io APIs.


Endpoints

The following endpoints are provided:

Accounts (source)

  • get_eth_balance
  • get_eth_balance_multiple
  • get_normal_txs_by_address
  • get_normal_txs_by_address_paginated
  • get_internal_txs_by_address
  • get_internal_txs_by_address_paginated
  • get_internal_txs_by_txhash
  • get_internal_txs_by_block_range_paginated
  • get_erc20_token_transfer_events_by_address
  • get_erc20_token_transfer_events_by_contract_address_paginated
  • get_erc20_token_transfer_events_by_address_and_contract_paginated
  • get_erc721_token_transfer_events_by_address
  • get_erc721_token_transfer_events_by_contract_address_paginated
  • get_erc721_token_transfer_events_by_address_and_contract_paginated
  • get_mined_blocks_by_address
  • get_mined_blocks_by_address_paginated
Contracts (source)

  • get_contract_abi
  • get_contract_source_code
Transactions (source)

  • get_contract_execution_status
  • get_tx_receipt_status
Blocks (source)

  • get_block_reward_by_block_number
  • get_est_block_countdown_time_by_block_number
  • get_block_number_by_timestamp
GETH/Parity Proxy (source)

  • get_proxy_block_number
  • get_proxy_block_by_number
  • get_proxy_uncle_by_block_number_and_index
  • get_proxy_block_transaction_count_by_number
  • get_proxy_transaction_by_hash
  • get_proxy_transaction_by_block_number_and_index
  • get_proxy_transaction_count
  • get_proxy_transaction_receipt
  • get_proxy_call
  • get_proxy_code_at
  • get_proxy_storage_position_at
  • get_proxy_gas_price
  • get_proxy_est_gas
Tokens (source)

  • get_total_supply_by_contract_address
  • get_acc_balance_by_token_and_contract_address
Gas Tracker (source)

  • get_est_confirmation_time
  • get_gas_oracle
Stats (source)

  • get_total_eth_supply
  • get_eth_last_price
  • get_eth_nodes_size
Pro (PRO API key needed) (source)

  • get_hist_eth_balance_for_address_by_block_no
  • get_daily_average_block_size
  • get_daily_block_count_and_rewards
  • get_daily_block_rewards
  • get_daily_average_block_time
  • get_daily_uncle_block_count_and_rewards
  • get_hist_erc20_token_total_supply_by_contract_address_and_block_no
  • get_hist_erc20_token_account_balance_for_token_contract_address_by_block_no
  • get_token_info_by_contract_address
  • get_daily_average_gas_limit
  • get_eth_daily_total_gas_used
  • get_eth_daily_average_gas_price
  • get_eth_daily_network_tx_fee
  • get_daily_new_address_count
  • get_daily_network_utilization
  • get_daily_average_network_hash_rate
  • get_daily_tx_count
  • get_daily_average_network_difficulty
  • get_eth_hist_daily_market_cap
  • get_eth_hist_price

If you think that a newly-added method is missing, kindly open an issue as a feature request and I will do my best to add it.

Installation

Before proceeding, you should register an account on Etherscan.io and generate a personal API key to use.

If you wish to have access to the PRO endpoints, you should obtain elevated privileges via Etherscan's subscription service.

Install from source:

pip install git+https://github.com/pcko1/etherscan-python.git

Alternatively, install from PyPI:

pip install etherscan-python

Unit tests

In bash, test that everything looks OK on your end using your YOUR_API_KEY (without quotation marks) before proceeding:

bash run_tests.sh YOUR_API_KEY

This will regenerate the logs under logs/ with the most recent results and the timestamp of the execution.

The tests also include the PRO endpoints so if your key is not PRO, the correspondings tests are expected to fail.

Usage

In python, create a client with your personal Etherscan.io API key:

from etherscan import Etherscan
eth = Etherscan(YOUR_API_KEY) # key in quotation marks

Then you can call all available methods, e.g.:

eth.get_eth_balance(address="0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a")

> '40891631566070000000000'

You can also choose one of the other testnets:

eth = Etherscan(YOUR_API_KEY, net="ropsten") # net name is case-insensitive, default is main

Examples

Examples (arguments and results) for all methods may be found as JSON files here. 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:

{
  "method": "get_block_number_by_timestamp",
  "module": "blocks",
  "kwargs": {
    "timestamp": "1578638524",
    "closest": "before"
  },
  "log_timestamp": "2020-10-28-12:34:44",
  "res": "9251482"
}

where kwargs refer to the required named arguments and res refers to the expected result if you were to run:

eth.get_block_number_by_timestamp(timestamp="1578638524", closest="before")

> '9251482'

Disclaimer: Those examples blindly use the arguments originally showcased here 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.

Issues

For problems regarding installing or using the package please open an issue. Kindly avoid disclosing potentially sensitive information such as your API keys or your wallet addresses.

Cite

Kotsias, P. C., pcko1/etherscan-python. https://github.com/pcko1/etherscan-python (2020). doi:10.5281/zenodo.4306855

or in bibtex:

@misc{Kotsias2020,
  author = {Kotsias, P.C.},
  title = {pcko1/etherscan-python},
  year = {2020},
  publisher = {Zenodo},
  url = {https://github.com/pcko1/etherscan-python},
  doi = {10.5281/zenodo.4306855}
}

Feel free to leave a if you found this package useful.


Powered by Etherscan.io APIs.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].