LogoLogo
HomeMetadata APIAPI PROTwitter
Etherscan V2
Etherscan V2
  • Introduction
  • Chef's Pick
  • Rate Limits
  • V1 to V2 API Migration Guide
  • ✨Getting Started
    • Creating an Account
    • Getting an API Key
    • Supported Chains
    • Supported Endpoints
  • 🎯API Endpoints
    • Nametags
    • Accounts
    • Contracts
    • Transactions
    • Blocks
    • Logs
    • Geth/Parity Proxy
    • Tokens
    • Gas Tracker
    • Stats
    • L2 Deposits/Withdrawals
    • Usage
  • 🏆API PRO
    • Etherscan API PRO
    • Metadata/Name Tag API
  • 🍳Cookbook
    • Track Uniswap V4 DEX Trades
  • Get An Address's Full Transaction History
  • 🤝Support
    • FAQ
    • Legacy V1 Docs
    • Checking Usage
    • Common Error Messages
    • Getting Help
  • Visit Etherscan.io
Powered by GitBook
On this page
  • 1. First Fetch
  • 2. Second Fetch Using Next Block Number
  • 3. Rinse And Repeat

Get An Address's Full Transaction History

PreviousTrack Uniswap V4 DEX TradesNextFAQ

Last updated 1 month ago

Sample

1. First Fetch

Start by fetching transactions from the block 0 up to the latest block.

https://api.etherscan.io/v2/api
   ?chainid=1
   &module=account
   &action=txlist
   &address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
   &startblock=0
   &endblock=latest
   &page=1
   &offset=1000
   &sort=asc
   &apikey=YourApiKeyToken

In most cases, if your address has less than max records ( 1k for free and 5k for paid tiers ), you're good to go

If you receive = max records, its likely that your address has exceeded the query limit.

2. Second Fetch Using Next Block Number

Its important to set the next startBlock to the block number of the last record - 1

The next block number to start your query from should be the block number of the last record - 1.

https://api.etherscan.io/v2/api
   ?chainid=1
   &module=account
   &action=txlist
   &address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
   &startblock=${lastBlockNumber - 1}
   &endblock=latest
   &page=1
   &offset=1000
   &sort=asc
   &apikey=YourApiKeyToken

The transactions from the last block number skipped will subsequently be fully queried in the next request.

3. Rinse And Repeat

This address took approximately 30s to fully pull for free tiers and 10s for paid tiers.

This is due to the possibility of transactions from the last block returned being cut off by the limit, particularly if a block contains to that address.

Once we receive less than max records limit, we've gotten all 71134 transactions

The same pagination applies to ERC20 token transactions, NFT transactions to get an address's full transaction history across .

🎉
🐙
⚡
code gist
many transactions
50+ supported chains