Skip to content

Instantly share code, notes, and snippets.

@0xV4L3NT1N3
Last active July 16, 2025 01:53
Show Gist options
  • Save 0xV4L3NT1N3/0aecbb6a1040ecc1d4d4d31dd235e915 to your computer and use it in GitHub Desktop.
Save 0xV4L3NT1N3/0aecbb6a1040ecc1d4d4d31dd235e915 to your computer and use it in GitHub Desktop.
Get Address Full Transaction History
async function getAddressFullTransactionHistory() {
var address = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
var fullTransactions = []
var nextBlock = 0
while (true) {
const requestTransactions = await fetch(`https://api.etherscan.io/v2/api?chainid=1&module=account&action=txlist&address=${address}&startblock=${nextBlock}&endblock=latest&page=1&offset=1000&sort=asc&apikey=YourApiKeyToken`)
const transactions = await requestTransactions.json()
nextBlock = Number(transactions.result[transactions.result.length - 1].blockNumber)
transactions.result.forEach((tx) => {
if (tx.blockNumber != nextBlock || transactions.result.length != 1000) {
fullTransactions.push(tx.hash);
}
})
if (transactions.result.length < 1000) break
}
console.log(`Retrieved ${fullTransactions.length} transactions for ${address}`)
}
getAddressFullTransactionHistory()
@Amjadkkh
Copy link

Amjadkkh commented Apr 2, 2025

@Amjadkkh
Copy link

Amjadkkh commented Apr 2, 2025

@Bahdboi66
Copy link

Uploading C897AB19-8A41-4C7C-8573-CB0A136ED537.png…

@bitcoin80
Copy link

0xBE0eB53F46cd790Cd13851d5EFf43D12404d33E8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment