Import Binance API Data to Google Sheets [2023] | API Connector (2024)

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

The nice thing about Binance is that it doesn't require any authentication (though this also makes it more likely to produce errors). It also provides some detailed data that other APIs don't, like open orders and candlestick chart data.

Contents

  • Before You Begin
  • Part 1: Pull Data from Binance to Sheets
  • Part 2: Create a Custom Request
  • Part 3: Handle Timestamps
  • Part 4: Binance Error Messages
  • Part 5: API Documentation
  • Appendix: Binance Template

Before You Begin

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

Part 1: Pull Data from Binance to Sheets

The easiest way to get started with the Binance API is through API Connector’s built-in integration.

  1. Select Binance from the drop-down list of applications
    Import Binance API Data to Google Sheets [2023] | API Connector (1)
  2. Select an endpoint. These endpoints are all open so you don't need an API key. For this example we'll choose the /ticker/24hr endpoint, which provides 24hr price change statistics.
    Import Binance API Data to Google Sheets [2023] | API Connector (2)
  3. Choose a destination sheet, name your request, and hit Run. A moment later you'll see price change stats for all currency pairs in your sheet.
    Import Binance API Data to Google Sheets [2023] | API Connector (3)

Part 2: Create a Custom Request

Alternatively, you can run your own custom requests instead of using API Connector’s pre-built integration, using any of the API URLs shown in the APIdocumentation. Here's an example request setup:

  • Application:Custom
  • Method:GET
  • Request URL:https://data.binance.com/api/v3/ticker/24hr
Import Binance API Data to Google Sheets [2023] | API Connector (4)

Part 3: Handle Binance Timestamps

For most endpoints, Binance returns dates as UNIX timestamps .

To convert these timestamps to a human readable date, set your data destination to cell B1, and add the following formula to cell A2:
=arrayformula((B2:B/1000)/86400+date(1970,1,1))
Import Binance API Data to Google Sheets [2023] | API Connector (5)

B2:B reflects the column in which the timestamp is located, so just modify it to match the column in which you want to convert timestamps.

Part 4: Binance Error Messages

If you use Binance for a little while, you'll almost certainly run into an error message from their server.

There are a few different errors you might see:

(403). <Request blocked. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error.
OR (418) {"code":-1003,"msg":"Way too much request weight used; IP banned until 1616682165041. Please use the websocket for live updates to avoid bans."}

You can see some information about these errors in Binance's docs, but basically Binance is sensitive to rate limits.

When you run your requests through API Connector / Google Sheets, you're more likely to hit these rate limits because all requests running through Google Sheets share the same pool of IP addresses from Google's servers. Unfortunately there isn't always enough capacity for Binance to handle the massive request volume from Google Sheets.

If you continue to have issues, I recommend switching to a crypto API that limits by your own API key rather than the shared pool of IP addresses for Google Apps Script. Please check this article for a list of alternative crypto APIs.

(451) { "code": 0, "msg": "Service unavailable from a restricted location according to 'b. Eligibility' in https://www.binance.com/en/terms.}

As of Nov 2022, Binance began blocking API calls sent through Google Cloud, which includes requests through Google Sheets (more info). This can be worked around through one of the following methods:

  1. Use the data sub-domain, e.g. https://data.binance.com/api/v3/ticker/24hr
  2. Use API Connector's preset integration instead of making a custom request. The preset integration automatically applies the data domain.

Part 5: API Documentation

Official API documentation: https://binance-docs.github.io/apidocs/spot/en/#general-info

Interactive request builder: https://binance.github.io/binance-api-swagger/

Appendix: Binance Template

In this template, everything is configured for you to simply type in whatever coins you’re interested in and get a dashboard like below:
Import Binance API Data to Google Sheets [2023] | API Connector (6)

You can jump right to a copy of the templatehere. Happy data grabbing!

Import Binance API Data to Google Sheets [2023] | API Connector (2024)

FAQs

How do I import data from API to Google Sheets? ›

Example 1: Connecting Google Sheets to the Numbers API
  1. Step 1: Open a new Sheet. ...
  2. Step 2: Go to the Apps Script editor. ...
  3. Step 3: Name your project. ...
  4. Step 4: Add API example code. ...
  5. Step 5: Run your function. ...
  6. Step 6: Authorize your script. ...
  7. Step 7: View the logs. ...
  8. Step 8: Add data to Sheet.
Aug 7, 2019

How do I import API Binance? ›

Select Add Account then choose the Binance tab on CoinLedger. Click on Auto-Import then enter your API Key and API Secret into CoinLedger. Click Connect.

How to extract data from Binance? ›

Binance provides historical market data that can be downloaded via the Binance website or API.
...
You can view all candlestick charts, trading, and aggregated trading data for Spot and Futures pairs.
  1. Log in to your Binance account and go to [Institutional] - [Historical Market Data].
  2. Select the data you want to download.
Mar 22, 2022

How do I open API connector in Google Sheets? ›

Click here to install the API Connector extension from the Google Marketplace.
  1. Step 1: Open the Sidebar. ...
  2. Step 2: Add a New Request. ...
  3. Step 3: Select an API. ...
  4. Step 4: Set Authentication. ...
  5. Step 5: Select an Endpoint. ...
  6. Step 6: Set Parameters. ...
  7. Step 7: Set Destination Sheet. ...
  8. Step 8: Choose Output Options.
Dec 28, 2022

Can you add an API to Google Sheets? ›

Options to connect REST API to Google Sheets

There are two common ways to add JSON API to Google Sheets: code and no-code. The code option is suitable for tech-savvy users who are more or less proficient in Google Apps Script, Python, or another programming language.

How do I import crypto data into Google Sheets? ›

Simply type in, between quotation marks, the ticker symbol for the cryptocurrency as the only argument for the function. Alternatively, type the ticker symbol, without quotation marks, into a cell and use the cell reference in the formula.

How do I import JSON data into Google Sheets? ›

Ways to Import JSON Into Google Sheets
  1. Open a spreadsheet on Google Sheets.
  2. Click on Extensions.
  3. In the dropdown menu, click on Apps Script.
  4. This will open a new page with some placeholder text. ...
  5. Search for an open source script on Google and copy it. ...
  6. Write a name for the function.
  7. Click on the Save icon.

How do I get JSON data into Google Sheets? ›

This is a free, open-source script someone created to import JSON into a Google Sheet.
  1. Copy the import json script.
  2. Paste the import json script.
  3. Click the save button.
  4. Name your project.
  5. Import JSON formula.
  6. Enter your JSON URL and hit Enter.
  7. JSON data imported into Google Sheets.
  8. Apipheny add-on for Google Sheets.

How do I get live data from Binance API? ›

Obtaining an API key. After logging in to your Binance account, click on the profile icon on the top right-hand side of the screen. From there, select API Management. Next, you will be asked to create a label for the API key.

How do I get my CSV from Binance? ›

How to download and export your transaction history CSV file from Binance
  1. From your Binance account, select wallet from the top navigation menu.
  2. From the drop down menu, select transaction history.
  3. Now select generate all statements.
  4. Under time, select customized. ...
  5. Select generate.
Dec 2, 2022

How do I get API Binance in USA? ›

Log in to your Binance.US account.
  1. On the upper navigation menu, click API Management on the dropdown menu that appears when you hover over your Username.
  2. View your API Key and click copy or scan the QR code to copy your public API Key. ...
  3. If you lose this key, you will need to delete your API and set up a new one.
Dec 21, 2022

Is Binance API data free? ›

Yes, you can utilize Binance Spot Testnet and Futures Testnet to test your use case, for free.

Can I connect Binance to excel? ›

Access Binance in Excel. Binance is the biggest cryptocurrency exchange in the world. Use this connector in Excel to access public exchange information, as well as your personal trading data.

Can you scrape Binance? ›

Scrape and extract data on top users and their current positions from Binance Futures Leaderboard, the largest cryptocurrency exchange in the world. Use all filtering and sorting options provided by Binance to integrate top user crypto positions into your coin trading strategy.

Is Google Sheets API connector safe? ›

Are API Connector requests secure? Yes. API Connector does not view or store API credentials or any of the data that gets retrieved. All requests run through Google's servers only, and API Connector does not have its own external databases.

How do I add API connector to Excel? ›

To import this on excel go to Data>Get Data>From other Sources> From Web or simply Data>From Web. Paste the API URL on the prompt then click OK. Then select Into Table on the Convert tab.

Where is data connectors in Google Sheets? ›

Open BigQuery datasets from Connected Sheets

Create or open a Google Sheets spreadsheet. Click Data, click Data connectors, and then click Connect to BigQuery.

Is Google Sheet API free? ›

All use of the Google Sheets API is available at no additional cost.

Is Google data API free? ›

All use of Google Search Console API is free of charge. However, it is subject to usage limits. Was this helpful?

What is an API connector? ›

An API connector provides Azure Active Directory with the information needed to call API endpoint by defining the HTTP endpoint URL and authentication for the API call. Once you configure an API connector, you can enable it for a specific step in a user flow.

Is Cryptosheets free? ›

Can I get started for free? Yes! All accounts receive 1000 free queries per month that reload automatically.

How do I get my CSV from Crypto? ›

How to export my Crypto.com App transaction records?
  1. On the Accounts page, tap the history icon (top right).
  2. Tap on the 'Export' button (top right).
  3. Select the Start and End Date (inclusive) then tap "Export to CSV'.

Can Google Sheets track crypto? ›

To pull cryptocurrency prices into Google Sheets, follow these steps: Type =GOOGLEFINANCE( in a spreadsheet cell to begin the formula. Type a symbol for a cryptocurrency (between quotation marks), like this "BTCUSD" Press enter on the keyboard (Final formulas will look like this: =GOOGLEFINANCE("BTCUSD")

How to convert JSON to XLSX? ›

Aspose app
  1. Visit the Aspose app website.
  2. Click on “Drag or upload your files”
  3. Choose the JSON file you want to convert to an MS Excel file.
  4. In the save as option, make sure you have selected the “XLSX” option.
  5. Choose Convert into one sheet or Convert into multiple sheets based on your need.
Jun 5, 2022

How do I automatically import a CSV file into Google Sheets? ›

The following steps will show you how to import CSV data into a Google Sheet:
  1. Open an empty Google Sheet.
  2. Go to File > Import.
  3. Click on the “Upload” tab.
  4. Double-click the CSV file you want to import.
  5. Select the “Append to current sheet” from the “Import location” dropdown menu.
Feb 9, 2022

How to convert JSON file to CSV? ›

Convert JSON to CSV - Here's how:
  1. 1Upload your JSON file. Browse your computer for a JSON document you wish to convert into a CSV file. ...
  2. 2Convert JSON to CSV file. Once uploaded, your JSON file will automatically start converting your data to the new format. ...
  3. 3Save your file or send to your email.

How do I get the secret key in Binance API? ›

Register and log in to your Binance account, then go to [API Management]. Enter the label API key and click [Create API]. Upon successful creation, you can get the API Key and Secret Key.

Can you withdraw with Binance API? ›

Binance has upgraded its API deposit and withdrawal functions, allowing users to more freely deposit and withdraw interoperable tokens across multiple networks, as shown below. Allows withdrawals across multiple networks using API. Returns deposit addresses for multiple networks.

How do I get a CSV Binance in USA? ›

How to download and export your transaction history CSV file from Binance US
  1. Log in to your Binance US account.
  2. Hover over your email address in the top right corner.
  3. Select export reports from the drop down menu.
  4. Under history & tax reports, select generate reports.
  5. Select tax.
  6. Select yearly report.
Dec 14, 2022

How do I create a CSV file from Binance us? ›

CSV files.
  1. Log in to your Binance.US account. Then, hover over the User Profile button in the top-right corner and click 'Export Reports' from the drop-down menu. ...
  2. Click 'Generate Reports' to continue.
  3. To customize your report, select the Asset, Transaction Type, Date Range, and File Format, available as a . CSV or .
Dec 19, 2022

How do you export all transactions from Binance us? ›

Binance US
  1. Visit the Tax Statements page in Binance US.
  2. Choose Export Statement.
  3. Select the years for which you had any transactions and press Generate.
  4. Download the report and unzip the file.
Aug 18, 2022

Can US citizens access Binance? ›

Binance.US is available to many, albeit not all, U.S. residents. It's important to note that this crypto exchange is not available to residents of Hawaii, New York, Texas and Vermont.

How do I download Binance API? ›

Register and log in to your Binance account, then go to [API Management]. Enter the label API key and click [Create API]. Upon successful creation, you can get the API Key and Secret Key.

Can non US citizen use Binance US? ›

Binance requires identity verification before it lets you deposit or withdraw funds. That's easy If you aren't a US citizen. Simply provide your ID information, complete your KYC, and use Binance freely.

How do I connect crypto to Google Sheets? ›

Google Sheets' GOOGLEFINANCE function can be used to get cryptocurrency prices. Simply type in, between quotation marks, the ticker symbol for the cryptocurrency as the only argument for the function. Alternatively, type the ticker symbol, without quotation marks, into a cell and use the cell reference in the formula.

How do I connect Google pay to Binance? ›

  1. Open the Google Pay App and tap [Add Payment Method]
  2. Enter your Binance Card number and details.
  3. Click [Activate]. You will get an SMS One Time Password (“OTP”)
  4. Enter the SMS OTP.
  5. You will receive a “success” message.

How do I add API key to Google Sheets? ›

From the projects list, select a project or create a new one. If the APIs & services page isn't already open, open the left side menu and select APIs & services. On the left, choose Credentials. Click Create credentials and then select API key.

How do I connect to API sheets? ›

Create a Google Service Account
  1. Access the Google APIs Console while logged into your Google account.
  2. Create a new project and give it a name.
  3. Click on ENABLE APIS AND SERVICES .
  4. Find and enable the Google Sheet API .
  5. Create new credentials to the Google Sheets API .

Does Binance have Google Pay? ›

Binance users can now purchase crypto using Apple Pay & Google Pay. According to Binance, users can now use these payment methods to buy crypto coins and tokens listed on the platform.

How do I download Google Play Binance? ›

How to Download & Install the Binance App on Android
  1. Go to the Binance app download page.
  2. Scan the QR code to directly download the Binance app to your mobile device.
Oct 21, 2022

Does Binance have a payment gateway? ›

Binance offers the Binance Pay payment option method to crypto-friendly companies. By displaying the store's unique QR code, merchants can set up Binance Pay in their physical location for a contactless, secure cryptocurrency payment experience.

How do I get a CSV from Binance us? ›

CSV files.
  1. Log in to your Binance.US account. Then, hover over the User Profile button in the top-right corner and click 'Export Reports' from the drop-down menu. ...
  2. Click 'Generate Reports' to continue.
  3. To customize your report, select the Asset, Transaction Type, Date Range, and File Format, available as a . CSV or .
Dec 19, 2022

How do I send data to Google Sheets? ›

Import data sets & spreadsheets
  1. On your computer, open a spreadsheet in Google Sheets.
  2. Open or create a sheet.
  3. At the top, click File. Import.
  4. Choose a non-password-protected file in one of these file types: . ...
  5. Select an import option. ...
  6. Optional: If you import a plain text file, like . ...
  7. Click Import.

How do I use JSON endpoint in Google Sheets? ›

How to use Google Sheets as a JSON Endpoint
  1. Create a spreadsheet in Google Spreadsheets.
  2. Publish the spreadsheet to the web.
  3. Generate a JSON endpoint.
  4. Open the spreadsheet for public collaboration.
  5. Pass the JSON endpoint to your back-end developer.
Jun 21, 2019

Is Google Sheets API free? ›

All use of the Google Sheets API is available at no additional cost.

Top Articles
Latest Posts
Article information

Author: Errol Quitzon

Last Updated:

Views: 6157

Rating: 4.9 / 5 (59 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Errol Quitzon

Birthday: 1993-04-02

Address: 70604 Haley Lane, Port Weldonside, TN 99233-0942

Phone: +9665282866296

Job: Product Retail Agent

Hobby: Computer programming, Horseback riding, Hooping, Dance, Ice skating, Backpacking, Rafting

Introduction: My name is Errol Quitzon, I am a fair, cute, fancy, clean, attractive, sparkling, kind person who loves writing and wants to share my knowledge and understanding with you.