0

I have the following code that uses the etherscan API to read for the most recent transfers for a particular contract-address on the Ethereum chain. I need to do the same, but on the Matic chain. From what I can see the etherscan API would not support this.

import etherscan.accounts as accounts


""" The following is an example code that continuously checks the transactions for the Tether token and prints
the most recent 3. """

key = ''  # Insert your own Etherscan API_KEY

address = '0xdac...'  # Address of coin we want to read
api = accounts.Account(address=address, api_key=key)


while(True):  # For now loop infinitely
    page = api.get_transaction_page(page=1, offset=3, sort='desc')  # Get the latest 3 transactions

    # Print them
    print(page[0])
    print(page[1])
    print(page[2])
    print('=============')

Is there an API or way to scan both Ethereum and Matic chains?

0

Is there an API or way to scan both Ethereum and Matic chains?

The official block explorer for Polygon is MaticVigil, which provides an API gateway similar to the services you've used on Etherscan.

However, given that it's only recently been released, you'll have to sign up (here) to get an invite before you can access it.

(There are other paid services, such as QuikNode.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.