Search API Connector Documentation

Print

Import BscScan Data to Google Sheets

In this guide, we’ll walk through how to pull data from the BscScan API directly into Google Sheets, using the API Connector add-on for Sheets.

We’ll first get an API key from BscScan, and then set up a request to pull in data to your spreadsheet.

Contents

Before You Begin

Click here to install the API Connector add-on from the Google Marketplace.

Part 1: Get Your BscScan API Key

  1. While logged into BscScan, open the Account menu dropdown and click API Keys
    bscscan-apikey
  2. In the API Keys menu click Add
    bscscan-apikey-add
  3. Name your API key and click Continue.
    bscscan-apikey-create
  4. You will now see your API key, copy it down and keep it safe as we’ll need it shortly.
    bscscan-apikey-success

Part 2: Create Your API Request URL

For our first request, we’ll pull in a list of transactions associated with a specific address.

  • API root: https://api.bscscan.com/api
  • Parameters: ?module=account&action=txlist&address=0xF426a8d0A94bf039A35CEE66dBf0227A7a12D11e&startblock=0&endblock=99999999&sort=desc&apikey=YOUR_API_KEY

Putting it together, we get the full API request URL:

https://api.bscscan.com/api?module=account&action=txlist&address=0xF426a8d0A94bf039A35CEE66dBf0227A7a12D11e&startblock=0&endblock=99999999&sort=desc&apikey=YOUR_API_KEY

Substitute in the address you’re interested in and your own API key.

Part 3: Pull BscScan API Data into Google Sheets

We can now enter that URL into API Connector.

  1. Open up Google Sheets and click Extensions > API Connector > Open.
  2. In the Create tab, enter the Request URL we just created
    bscscan-url
  3. Leave OAuth set to None. We don’t need any Headers either, so just skip that section.
  4. Create a new tab. Name it and click Set current to use that tab as your data destination.
  5. Name your request and click Run. A moment later you’ll see a list of BscScan transactions in your sheet.
    bscscan-results
  6. That’s it! If you like, you can double-check that the data in your sheet matches the data you see when you search BscScan’s search box by address. It should be exactly the same:
    bscscan-results-compare

Part 4: More Example API URLs

Experiment with endpoints and query strings as described in the documentation to see other types of currency and crypto data from the API. Some example requests are shown below:

  • Get sorted list of ‘Internal’ Transactions by Address:
https://api.bscscan.com/api?module=account&action=txlistinternal&address=0x0000000000000000000000000000000000001004&startblock=0&endblock=2702578&sort=asc&apikey=YOUR-API-KEY
  • Get “Internal” Transactions by block range:
https://api.bscscan.com/api?module=account&action=txlistinternal&startblock=0&endblock=2702578&page=1&offset=10&sort=asc&apikey=YOUR-API-KEY
  • Get Estimated Block Countdown Time by BlockNo:
https://api.bscscan.com/api?module=block&action=getblockcountdown&blockno=8000000&apikey=YOUR-API-KEY
  • Get Block Number by Timestamp:
https://api.bscscan.com/api?module=block&action=getblocknobytime&timestamp=1601510400&closest=before&apikey=YOUR-API-KEY
  • Check Transaction Receipt Status:
https://api.bscscan.com/api?module=transaction&action=gettxreceiptstatus&txhash=0xe9975702518c79caf81d5da65dea689dcac701fcdd063f848d4f03c85392fd00&apikey=YOUR-API-KEY
  • Get Total Supply of BNB on the Binance Smart Chain:
https://api.bscscan.com/api?module=stats&action=bnbsupply&apikey=YOUR-API-KEY
  • Get BNB Last Price:
https://api.bscscan.com/api?module=stats&action=bnbprice&apikey=YOUR-API-KEY
  • Get Validators list on the Binance Smart Chain:
https://api.bscscan.com/api?module=stats&action=validators&apikey=YOUR-API-KEY

Part 5: API Documentation

Official API documentation: https://docs.bscscan.com/

Previous Import Binance Data to Google Sheets
Next Import Chargebee Data to Google Sheets

6 thoughts on “Import BscScan Data to Google Sheets”

  1. Hi, I would like to get transactions from specific data range and specific contract through API, because if I do it manually I can only get a maximum of 5000 records. Could you help me?

    Reply
  2. Hi Ana thanks for your reply, What i’m trying to do is to extract all the data in a specific period (like from 01/12/2021 to 10/12/2021) from a specific contract without restriction of 5000 records for example if try to do it there is a limitation (for example –> https://bscscan.com/exportData?type=address&a=0x6d6ba21e4c4b29ca7bfa1c344ba1e35b8dae7205)

    Resuming – >I need to analyze all the transactions from a specific contract without limit of 5000 records max.

    I’ve seen the API also has a limit of 10.000 records..

    Thanks in advance!

    Reply
    • Hey Paul, a request URL Like https://api.bscscan.com/api?module=account&action=txlist&address=0x6d6ba21e4c4b29ca7bfa1c344ba1e35b8dae7205&startblock=0&endblock=99999999&sort=desc&apikey=YOUR_KEY should get you what you’re looking for. It will send 10,000 records into your sheet.

      Reply
  3. bom eu gostaria de um script mais simples
    eu tenho algumas moedas de jogo que possuo
    queria listas essas moedas e cota-las apenas
    em USDT, ETH, BNB e BRL
    Seria possível, um scrip para encerrir as moedas que preciso nessas 4 cotações

    Reply

Leave a Comment

Table of Contents