In [0]:
#!pip install web3
#!pip install requests

In [0]:
#from google.colab import drive
#drive.mount('/content/drive/')

In [0]:
!ls "/content/drive/My Drive/"

In [0]:
import requests
from eth_abi import decode_abi
from eth_utils import encode_hex, function_signature_to_4byte_selector
from web3 import Web3, HTTPProvider
from web3.utils.encoding import (
    to_hex,
)

In [0]:
w3=Web3(HTTPProvider(endpoint_uri="https://mainnet.infura.io/KOlHZQ8Rm8c3rxAW3yrC"))

In [0]:
addr="0x135c70a836a3819afa8b257ee6ef345ef38f92d7"
tran_info = requests.get('https://api.etherscan.io/api', params={
            "module": "account",
            "action": "tokentx",
            "address": addr,
            "startblock": 0,
            "endblock": 999999999,
            "sort": "desc",
        }).json()

In [12]:
tran_info


Out[12]:
{'message': 'OK',
 'result': [{'blockHash': '0x32201b375b629b442eada472064fd79e760f7949e490a8f5f8ddc31a006fcdce',
   'blockNumber': '6504249',
   'confirmations': '148536',
   'contractAddress': '0xc4bf277257c140a799b785c6c5096c6da7ef6a62',
   'cumulativeGasUsed': '1087291',
   'from': '0xd8ccbfcf6b4fd3d1ae85f8c0cc92c9170081d144',
   'gas': '102724',
   'gasPrice': '18000000000',
   'gasUsed': '102724',
   'hash': '0xb9d3944f880097fe4f36c7038c7eef1cfbfa975fbfa009666f513f83ce5b3ee5',
   'input': '0xa9059cbb000000000000000000000000135c70a836a3819afa8b257ee6ef345ef38f92d70000000000000000000000000000000000000000000000000000000000551959',
   'nonce': '1078',
   'timeStamp': '1539390172',
   'to': '0x135c70a836a3819afa8b257ee6ef345ef38f92d7',
   'tokenDecimal': '',
   'tokenName': '',
   'tokenSymbol': '',
   'transactionIndex': '9',
   'value': '5577049'}],
 'status': '1'}