BaseScan Developer APIs
Access Blockchain Data
Building DAPPs
Verify Contracts
Community Driven
Introduction
The BaseScan Developer APIs are provided as a community service and without warranty, so please use what you need and no more. We support both GET/POST requests and there is a rate limit of 5 calls per sec/IP.
Note: Source attribution via a link back or mention that your app is "Powered by The BaseScan Explorer APIs" is required except for personal/private usage.
Account APIs
Get ETH Balance for a single Address
https://api-goerli.basescan.org/api?module=account&action=balance&address=0x33e0e07ca86c869ade3fc9de9126f6c73dad105e&tag=latest&apikey=YourApiKeyToken
Get ETH Balance for multiple Addresses in a single call
https://api-goerli.basescan.org/api?module=account&action=balancemulti&address=0x33e0e07ca86c869ade3fc9de9126f6c73dad105e,0x2e616046b9F73efe31Fb123380B277CeEc1cBA46,0xba821dc848803900C01BA7Ac1D7a034B95B1eD97&tag=latest&apikey=YourApiKeyToken
Separate addresses by comma, up to a maxium of 20 accounts in a single batch
Get a list of 'Normal' Transactions By Address
[Optional Parameters] startblock: starting blockNo to retrieve results, endblock: ending blockNo to retrieve results
https://api-goerli.basescan.org/api?module=account&action=txlist&address=0xba821dc848803900C01BA7Ac1D7a034B95B1eD97&startblock=0&endblock=99999999&sort=asc&apikey=YourApiKeyToken
(Returned 'isError' values: 0=No Error, 1=Got Error)
(Returns up to a maximum of the last 10000 transactions only)
or
https://api-goerli.basescan.org/api?module=account&action=txlist&address=0xba821dc848803900C01BA7Ac1D7a034B95B1eD97&startblock=0&endblock=99999999&page=1&offset=10&sort=asc&apikey=YourApiKeyToken
(To get paginated results use page=<page number> and offset=<max records to return>)
Get a list of "ERC-20 - Token Transfer Events" by Address
[Optional Parameters] startblock: starting blockNo to retrieve results, endblock: ending blockNo to retrieve results
https://api-goerli.basescan.org/api?module=account&action=tokentx&address=0xba821dc848803900C01BA7Ac1D7a034B95B1eD97&startblock=0&endblock=999999999&sort=asc&apikey=YourApiKeyToken
(Returns up to a maximum of the last 10000 transactions only)
or
https://api-goerli.basescan.org/api?module=account&action=tokentx&contractaddress=0xddcb3ffd12750b45d32e084887fdf1aabab34239&page=1&offset=100&sort=asc&apikey=YourApiKeyToken
(To get paginated results use page=<page number> and offset=<max records to return>)
or
https://api-goerli.basescan.org/api?module=account&action=tokentx&contractaddress=0xddcb3ffd12750b45d32e084887fdf1aabab34239&address=0xba821dc848803900C01BA7Ac1D7a034B95B1eD97&page=1&offset=100&sort=asc&apikey=YourApiKeyToken
(To get transfer events for a specific token contract, include the contractaddress parameter)
Get list of L1 Deposits done by Address
https://api-goerli.basescan.org/api?module=account&action=getdeposittxs&address=0x47ee58801c1ac44e54ff2651ae50525c5cfc66d0&sortorder=desc&apikey=YourApiKeyToken
or
https://api-goerli.basescan.org/api?module=account&action=getdeposittxs&address=0xfb3f0661d1564a4f4fef61bf1a50cc5621301d23&tokenaddress=&0x8700daec35af8ff88c16bdf0418774cb3d7599b4sortorder=desc&apikey=YourApiKeyToken
(Filtered by its corresponding L2 token contract address, use the tokenaddress parameter)
Get list of L2 Withdrawals done by Address
https://api-goerli.basescan.org/api?module=account&action=getwithdrawaltxs&address=0x66ea2f829d4392bef3b4b01e86da0985962edc5c&apikey=YourApiKeyToken
Contract APIs
Get Contract ABI for Verified Contract Source Codes
https://api-goerli.basescan.org/api?module=contract&action=getabi&address=0x80AA7cb0006d5DDD91cce684229Ac6e398864606&apikey=YourApiKeyToken
A simple sample for retrieving the contractABI using Web3.js and Jquery to interact with a contract
var Web3 = require('web3'); var web3 = new Web3(new Web3.providers.HttpProvider()); var version = web3.version.api; $.getJSON('https://" + api-goerli.basescan.org + "/api?module=contract&action=getabi&address=0x80AA7cb0006d5DDD91cce684229Ac6e398864606&apikey=YourApiKeyToken', function (data) { var contractABI = ""; contractABI = JSON.parse(data.result); if (contractABI != ''){ var MyContract = web3.eth.contract(contractABI); var myContractInstance = MyContract.at("0x80AA7cb0006d5DDD91cce684229Ac6e398864606"); var result = myContractInstance.memberId("0xfe8ad7dd2f564a877cc23feea6c0a9cc2e783715"); console.log("result1 : " + result); var result = myContractInstance.members(1); console.log("result2 : " + result); } else { console.log("Error" ); } });
Get Contract Source Code for Verified Contract Source Codes
1. https://api-goerli.basescan.org/api?module=contract&action=getsourcecode&address=0x80AA7cb0006d5DDD91cce684229Ac6e398864606&apikey=YourApiKeyToken (replace the address parameter with the actual contract address)
2. Terms of usage: Please see the usage terms policy
Token Info APIs
Get ERC20-Token TotalSupply by ContractAddress
https://api-goerli.basescan.org/api?module=stats&action=tokensupply&contractaddress=0xddcb3ffd12750b45d32e084887fdf1aabab34239&apikey=YourApiKeyToken
Get ERC20-Token Account Balance for TokenContractAddress
https://api-goerli.basescan.org/api?module=account&action=tokenbalance&contractaddress=0xddcb3ffd12750b45d32e084887fdf1aabab34239&address=0xba821dc848803900c01ba7ac1d7a034b95b1ed97&tag=latest&apikey=YourApiKeyToken