Search API Connector Documentation


Import Binance Data to Google Sheets

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.  This article is only about accessing Binance’s open, unauthenticated endpoints. If you are looking to get your private account data, please see this sheet instead.

The Binance API is, in my opinion, a bit confusing because it returns data in currency pairs (e.g. BTCAUD, BTCBBTC, BTCBIDR, BTCBKRW, BTCBRL, BTCBUSD, etc.). Other crypto APIs would just return “BTC”, either in USD or in the conversion currency of your choice. But as long as you’re aware of that, it isn’t too hard to get used to. Also, the nice thing about Binance is that it provides some detailed data that other APIs don’t, like open orders and candlestick chart data.

If you want to skip the details, you can jump right to the end and grab a copy of the Binance crypto tracking template. Or if you are more of a video person, head over to our YouTube video.


Before You Begin

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

Part 1: Create Your API Request URL

All the request URLs in this article can be accessed from within API Connector by entering “Binance” into the URL field. This will search the built-in API library so you can simply click and load the URL you’re interested in.

For our first request, we’ll first access 24 hour price change statistics for all currency pair symbols.

  • API root:
  • Endpoint: /api/v3/ticker/24hr

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

Part 2: Pull Binance API Data into Sheets

Now let’s paste 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.
  3. Leave OAuth set to none. Leave the Headers section empty as well.
  4. Create a new tab 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 24 hour rolling window price change statistics for all Binance’s supported currency pairs:

Part 3: More Example Binance API URLs

Experiment with endpoints and query strings as described in the documentation to see other types of crypto data from the API. If you just want to jump in and get a feel for it, play around with the URLs you enter into the API URL path field. Try the following (one at a time).

Note that for futures data, the base endpoint is

  • latest price of BTC in USD
  • recent trade orders for specified currency pair
  • order book data (list of open orders for specified currency pair). Select the “compact” report style for this one to avoid all the data lining up on a single row.
  • Kline/candlestick chart data. This is great for seeing the price of a pair at a recurring interval. For example, this request URL will show the daily price of Bitcoin:
    Binance doesn’t return column names for this request, so open the visual field editor (click Edit Fields) to manually add these field names in across the top: Open Time, Open, High, Low, Close, Volume, Close Time, Quote Asset Volume, Number of Trades, Taker buy base asset volume, Taker buy quote asset volume, Ignore
  • historical trades data requires an API key. For this you’ll need an account at Binance. You can retrieve your API key by navigating to the API Management section of your account (located under Settings). Enter your key into the Headers section of API Connector, where Key = X-MBX-APIKEY, and Value = your API key

Part 4: 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:

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 5: Get Private Binance Account Data

The above endpoints deal with public market data from Binance’s API.

If you are instead a Binance customer looking to get API data from your own account, they require a more complex authentication process that includes generating a “signature”.

To access your private account data, please copy this sheet and follow the instructions within:

It will produce a sheet of data from YOUR account, like this:


Part 6: Binance Limits

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:

  • Server responded with an error (418) {“code”:-1003,”msg”:”Way too much request weight used; IP banned until 1616682165041. Please use the websocket for live updates to avoid bans.”}
  • Server responded with an error (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.>

You can see some information about these errors in Binance’s docs, but basically Binance is sensitive to rate limits. And 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 Binance doesn’t seem to have increased their rate limits enough for Google.

To resolve, you can try the following:

  • Instead of calling, use one of their other base domains:,, and
  • reduce the number of requests you’re calling at once. DON’T smash their servers with thousands of requests as it will make the problem worse for everyone.
  • wait 5 minutes and try again

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. You can see a list of free crypto APIs here.

Part 7: API Documentation

Official API documentation:

Interactive request builder:

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:

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

Previous Import BigQuery Data to Google Sheets
Next Import BscScan Data to Google Sheets

116 thoughts on “Import Binance Data to Google Sheets”

      • Hi Igor, please click Refresh All Now to refresh the data. You will need to first follow the the instructions in the Information tab.

    • Does anyone have any idea how to separate the currency pair? Ex: BTC USDC.

      But in a way that it is possible to use the same code in case they change places or the coins are touched. Ex: USDT BTC or ETH BNB?

      • I’m not totally sure what you mean by separating the currency pair, but we can’t change how Binance sends back the data if that’s what you mean. If you just want to keep coins in place, I suggest making a summary sheet where you list out the currencies you’re interested in, and then use a VLOOKUP function to pull in the associated price. That way it doesn’t matter where exactly the data is located in your sheet, since you’ll be pulling in data based on the name of the currency pair rather than a specific cell. The template in this article contains that exact setup if you want to take a look and see how it works.

  1. The API works pretty well but also has certain limitations.
    If You have too many cells importing data through API, You will quickly hit the error like this one:

    Exception: Request failed for returned code 418.
    Truncated server response: {“code”:-1003,”msg”:”Way too much request weight used; IP banned until 1611528105765.
    Please use the websocket for live updates to avoid bans.”}
    (use muteHttpExceptions option to examine full response)
    (line 127).

    Do you know any way to use websockets from google sheet?

    • I don’t, but maybe you can try an API like CoinMarketCap instead, that way you’ll get your own API key. Part of the issue with Binance is that everyone using Google’s IPs is sharing the same public quota.

    • What’s your full URL? Please make sure your URL is formed correctly, e.g. multiple query strings should be separated with ampersands, not question marks. I tested and it worked for me, try that and let me know if it fixes your error.

  2. thanks man!

    i`m keep getting error code 403 using the google apps script.
    i want to get all the bids & asks from any coin.

    is there any solotion to error 403 ? or there will allways be a problem with binance api using google apps script?

    • The Binance faq says I’m receiving an HTTP 403 error when using the API. Why?
      You have violated the WAF (Web Application Firewall) rules, most likely by violating a rate limit or sending a malicious request (as outlined in the limits section of this document). Typically, these bans last a period of 5 minutes.
      So in these cases I think you just need to wait and try again.
      If you continue to have issues, you could also try pulling data from other crypto APIs, e.g. CoinMarketCap or CoinGecko.

  3. Good day
    How can I pull in the transactions only for the coins I have, in order to automatically calculate the cost I paid for the coins vs current market price?

  4. Hey Ana,

    Great article. Thank you so much for the information and the file. It really helps.

    Is there a way to automatically refresh the data every minute or 5 minute without the need of clicking “Refresh All Now” every time.

    Thanks again.

  5. CAKE doesn’t work because there is no CAKEUSDT pair. I can manually add CAKEBUSD to the sheet but it breaks any other pair. Otherwise, awesome.

  6. Hello! An incredibly helpful article! You explained the sequence of actions very easily, thank you!
    I have a few questions:
    1) is it possible to make the data updated? Perhaps by a button that will start the update. Because it helped me only to restart the API (that is, to do everything again according to your instructions). I need to update such a table two or three times a day. When I try to update the table via the “Refresh All Now” button, the system shows me the error “ERROR can’t find sheet undefined”

    2) I also need to save the previous data of this table so that I can compare the “updated data” and “previous data”.
    I’m only interested in the price of the cryptocurrency to USDT

    • Hey Renne, you can update the data by opening the request in the sidebar and clicking Run. If it says ERROR can’t find the sheet, that just means you changed or deleted your output sheet and need to re-select one. You can select a new output sheet when you open your request.
      As for saving previous data from your table, you can check out my other add-on as it does exactly that (and it’s free): Archive Data
      Hope that helps 🙂

  7. Dear Ana, Thanks a bunch, super nice to work with.

    I can only add up to 23 coins in the “Inputs” tab. Adding more outputs no value in the “Summary” tab.

    I tried changing the formula value B8:B25 to B8:B100 in columns C8-CL but this did not allow me to add more coin.

    Would love to see your feedback Ana, thanks!

    • Sorry, I don’t totally understand the question, is ‘USDT Coin’ a currency pair?
      But if you only want the price of a single coin you can use a URL like this, just substitute in the pair that you’re interested in:

      • Yes that’s a coin and a base pair for prices.
        How can I use this in Microsoft excel?
        I can convert but I don’t know how I can update prices in excel?

  8. Hi Ana,
    First of all, thank you so much for your articles – I learnt a ton from them. Don’t have any technical background, and these are super well written, so thank you!

    I was super happy when I managed to connect to the binance API 🙂 I used the /v3/ticker/price endpoint and it was working great for a couple of weeks but today I got the 418 error message:

    {“code”:-1003,”msg”:”Way too much request weight used; IP banned until 1617596675170. Please use the websocket for live updates to avoid bans.”}

    Sounds like binance have blocked my IP but I was only making 8 calls per day! Am I missing something? And do I need to use the websocket for occasional updates?

    Any help would be super appreciated!

    • Hey Antoine, thanks for the message, I’m glad you like the articles :). For the 418 error, unfortunately this is a common problem with Binance’s API. Please check the section above called “Binance Limits” for a couple of suggestions to resolve it.

    • Agreed, it’s really frustrating.
      Switching to their alternate hostnames usually helps, but it might be better to just use other crypto APIs that don’t limit by IP address.

  9. Hi Ana,
    I am an end-user and find your google sheet quite interesting.
    Can you show me how to update the Binance Update sheet and also add more data to it. I am not too familiar with Google sheets. A detailed instruction will be well appreciated.
    p.s You did a good job preparing the template. Thumbs up!

    • Hi Eddy, thanks for the nice comment. The instructions for using the template are in the Information tab. Basically you need to make a copy of the template, import in the request file, and then fill out the Inputs tab with the coins you want to track. Does that answer your question?

    • As far as I know, Binance doesn’t provide any endpoint that returns only volume, so you have to use the /api/v3/ticker/24hr endpoint and pull it out yourself. There are 2 ways to do this:
      1) Use standard Google Sheets functions like HLOOKUP or MATCH to extract the metric you want into a second sheet.
      2) If you’re using the pro version of API Connector, you can enter a JMESPath expression to display only the volume field. For example this expression would pull in just the symbol and volume: [].{symbol:symbol,volume:volume}
      Update: you can now also use the visual field editor to display just the columns you want.

  10. Bonjour, je souhaiterais pouvoir choisir une date et une heure bien précise dans un url comme celui-ci :

    Je demande de l’aide merci

  11. Hi! I just recently installed your add-ons to test it out. I’m very interested in your add-ons so I try get the binance data buy running it manually and thru scheduling

    Google Sheet: testSheet
    API URL path:
    Destination sheet: Sheet1
    NAME AND SAVE REQUEST – Name: binanceData

    Upon testing the status error below always show up.

    Completed with errors
    – Server responded with an error (403)
    – Server responded with an error (418)

    But when I try to go to
    the binance raw data is there.

    Is there wrong in my settings?
    Are there any work around with this?
    Hope you can help me out in evaluating and testing your product.

    • Hi Richard, you can see information on this issue in this article (check the section called “Binance Limits”).

      Basically, Binance rate limits requests by IP address, and when you run requests through Google Sheets you’re using the same IP address pool as everyone else using Google Sheets. When you put their request URL into the browser, you’re using your own personal IP address instead, so you don’t hit their rate limits.

      To resolve, try using Binance’s other hostnames, e.g. That usually helps. Otherwise you can try other crypto APIs that don’t limit by IP address.

  12. Hi Ana,

    Thank you for the clear tutorial, however, i am trying to get my user data from the binance api using myTrades or Allorders. I have to set a timestamp, but i have no idea what this should be. Can you maybe explain how to extract my user data to google sheets?

  13. Hi !

    Thank you for this article, it’s nice ! 🙂

    Quick question, I would like to obtain recent trade orders for 2 or more currency pairs, like this for example, but it doesn’t work with a comma,ETHUSDT

    Can you tell me how I should write it ?

    Thank you !


    • Hello! Sorry, I believe Binance only lets you specify a single symbol at a time, so you’d need to set up multiple requests to pull trade orders for multiple currency pairs.

    • Binance is always updating its supported trading pairs, so the best way to check is just run a request for the trading pairs you’re interested in. Or you can view them all with a request like

      • No, I mean that Binance in addition to classic trading also has a kind of trading called “CONVERT” where although you are limited to exchanging only 2-3 currencies between them it is totally free. Here I want to try to use “CONVERT” to trade with 0 fees, is it possible?
        For example on CONVERT I can change: Matic in VET; VET in Doge, Doge in BNB.

        Thank you

  14. Hi I was wondering if it is at all possible to extract data using Mixed Analytics for USD-M Futures. I’m been trying to figure it out but nothing I try is working.

    • Sure, you can check here for a link to Binance’s documentation on getting futures data.
      Based on that, here are a couple example Futures API request URLs:

    • Binance’s API only lets you get candlestick data for one pair at a time. So you would need to use API Connector’s multi-request feature (paid) to loop through and run the request for different cryptos. If you were using that, you’d set up your request like this:
      Request URL
      Report style: compact
      Add request URL: ☑ (this will let you see which results match to which symbol)

  15. Hi,

    I would like to get the trading, deposit & withdrawal data from my binance account, but facing difficulty in finding the correct api endpoint.

    Can anyone share, what the correct api endpoint would be and where to use my API_KEY and SECRET_KEY?

  16. Hi!
    Thanks for sharing this infos.
    I am trying to set the sheet to display my spot wallet. I followed the instructions but when I hit run it says:
    1) SPOT: Completed with errors
    – We received an error from the API server (400) show response
    {“code”:-1021,”msg”:”Timestamp for this request is outside of the recvWindow.”}
    Can you help me on this?

    • The recvWindow sets how much of a buffer you have over the timestamp set in your signed URL, so it seems like you may have waited too long (or there’s some timestamp sync issue). Can you please check the following?
      1) make sure to leave recvWindow=60000
      2) click the checkbox to produce a fresh timestamp right before you hit Run, to help ensure that the timestamp is within the window.

      • Hi, did step 1 and 2, but it still does not work.

        See here:

        Would it be useful to add these to your script? does your script already account for this?

        binance = ccxt.binance ({
        'options': {
        'adjustForTimeDifference': True, # ←---- resolves the timestamp
        'enableRateLimit': True, # ←---------- required as described in the Manual
        'apiKey': 'YOUR_API_KEY',
        'apiKey': 'YOUR_SECRET',
        pprint(binance.fetch_balance ())

      • Sorry, I’m not really sure what that code is for (couldn’t find those extra parameters on Binance’s site), but you can see and edit the script by clicking Extensions > Apps Script.

      • Hello, could you do a explanative youtube video on how to pull all binance coins and order them by marketcap either using cmc or coingecko api? It is a simple request but im having trouble figuring how.


      • You can enter this URL to see coins sorted by market cap in CMC: This article has more info on the CMC API, and there’s a video tutorial for it here.

  17. Thanks, i am only interested in binance coins. Is there a simple way to sustract the binance coins from the CmC list? maybe using two excels?

    • You can pull the coin list from each exchange so you have one sheet for each exchange. Then do a VLOOKUP to mark which coins on CMC are also on Binance, and delete the ones that don’t get a mark. If you aren’t sure about VLOOKUP there are a lot of resources online, like here’s a video about comparing lists (seems similar to what you want to do):

  18. Comment, I copied it over to my sheet, it worked almost great, but I had to adjust the TimestampHelper method. The number returned was a factor 1000 too small
    I’ve noticed the script uses /1000 but that didn’t work for me

    • Thanks, that’s great feedback. Can you please explain exactly how you adjusted the TimestampHelper method? That might be useful for others facing the same issue.

  19. thank you, if i understand correctly this would be therm right path to have binance coins listed my market capitalization, right?

    • Not really. Binance’s API only lets you get data for all coins or a specific coin, not multiple coins.
      So I suggest using a different crypto API for this: CoinGecko, CryptoCompare and CoinMarketCap are provide that type of multi-coin endpoint.

  20. Hey. Great post! Thank!
    I wanted to find out how to get prices data from certain dates – for example 1st of January 2020, 31st December 2020, etc.
    Is it possible at all?

    • Sure, you can do the following:
      1. Use a URL like this to get daily data:
      2. Set your destination cell to B1
      3. (optional, but recommended) Click Edit fields and give your columns field names: Open time, Open, High, Low, Close, Volume, Close time, Quote asset volume, Number of trades, Taker buy base asset volume, Taker buy quote asset volume, Ignore.
      4. Save and run your request.
      5. In cell A2, add the following formula to convert their timestamps to regular dates: =arrayformula((B2:B/1000)/86400+date(1970,1,1))

      You should now have a list of dates with prices (and other data). Let me know if that works for you.

      • Thank you very much for your answer!

        One more question – probably I wasn’t clear enough before – we would like to import prices of all tokens (like you did in an example – with specific date. For example:
        CELL A – here would be all pairs available
        CELL B – prices of all pairs on the first of January
        CELL C – prices of all pairs on the first of February
        CELL D – prices of all pairs on the first of March

        and so on.

        Is that possible?

      • Hmm, I don’t think this is possible. I see endpoints for getting all pairs at the current date, and endpoints for getting a specific pair at a historical date, but I don’t see any endpoints for getting all pairs at a historical date.
        You might want to check their API documentation or their API forum to confirm.

  21. Hi,
    Nice platform.
    The issue I have right now is that I am trying to retrieve a large volume of data from Binance within every hour but it does not seem to work, so due to Binance limits, I broke down the large request into three smaller request and at the same time of every hour, the first of the three returns data but the second starts request starts and never completes while the third does not even start at all. and this happens on every hourly cycle.
    I wish there was a way to input the exact time when each schedule should begin just as it is on the daily schedule so as to separate the three requests by an interval of say 10 minutes apart to avoid the second request trying to load immediately after the first.

    • Oh I forgot to mention that i used the API1, APT2 and API3 to help reduce the requests on one API but still come across the issue stated above.

    • Hi Ibiye, triggers are managed by Google, and unfortunately they don’t allow us to specify a specific start time. You can see more about that in our article on triggers, but basically they enforce various limits related to the frequency and quantity of data pulls.
      Can you please share some information about your request URL, either here or via support? Then I can try to replicate the issue and help you find a solution.

  22. Also, the time that returns on the log is different from my time zone so I have to always try to do a mental adjustment every time I look in the log to figure out when the request was triggered. It would highly be appreciated if this can also be fixed.


    • The time returned in the log should match the time zone of the sheet, so it sounds like your sheet may be set wrong. In Google Sheets can you please click File > Settings > Time zone and make sure the value there matches your time zone?

  23. Hi Ana,

    Thanks for the helpful guideline. I did copy your shared API Connector – HMAC-SHA256 and followed the steps there. I has already check the check box in “Timestamp Helper”. However, it always shows below error. Appreciate if you could advice. My timezone is Vietnam (GMT7)

    Completed with errors
    – We received an error from (400) show response{“code”:-1021,”msg”:”Timestamp for this request is outside of the recvWindow.”}

    • Can you please check the timezone of your sheet under File > Settings?
      Please make sure it matches your actual timezone, let me know if that resolves the issue.

      • Hi Ana,

        As I checked they are same.
        Google sheets> Files> Settings> Timezone = (GMT+07:00 Hanoi)
        Laptop clock> Data and Time setting = (UTC+07:00) Bangkok, Hanoi, Jakarta

  24. Hello!
    Can you tell me plz, how to put all futures pairs in one sheet, with blocking every single pair in ther place, and without duplicating names of colums?

    • We can’t change how the API sends back the data (and I’m not sure I really understand what you’re looking for). However you can use Sheets to restructure data any way you like. I suggest looking into the VLOOKUP and QUERY functions, they let you pull data from one sheet into another using whichever criteria you define.

  25. Very nice info you put out there, i haven’t started the process and i’m quite new to this but i want to know if i can specify the date of the data i need to grab like for example
    i only want to collect trading data on two tokens, higstreet/usdt and btc/usdt for lets say on the 18/12/2021. will this be possible?

    • Sure, you can check the “Kline/candlestick chart data” example above for how to get daily btc/usdt prices, and then optionally add startTime and endTime parameters to specify a date. For example, this would get btc/usdt priceson 18/12/2021: (Note that Binance’s API requires a timestamp in milliseconds.)

    • Sorry, I’m not really familiar with futures but you can see all their futures endpoints here. An example working futures API call would be

  26. Hi Friends,

    I want use the Binance Trade history in my google sheets (Trade Journal)
    How can i connect binance in livetime with the google Sheets? ( symbol, entry time,entrydate, exit time, exit date, entry price ….)

    Thank you

    • You can enter an endpoint like /api/v3/myTrades?symbol=BNBBTC into the private data sheet. Note that you can only fetch trades for a specific currency at one time, you can’t automatically get all your trades (discussed here).

  27. hello.
    how can i change automaticlly on the API price column from “.” to “,” so i can make formulas containing numbers.
    i can change it manually but every time the API runs it goes to “.” again…
    thank you

    • The API sends back data with a “.” so it will always get replaced. Therefore you have 2 options:
      1) Send your data to cell B1 (instead of A1). Then in column A, you can add a formula to convert the price column to use commas. This formula should work: =arrayformula(substitute(L1:L,".",",")) (substitute in your price column where it says L1:L. Btw you only need to enter this formula once, it will copy down the sheet as it’s an array formula)

      2) change your sheet locale to US under File > Settings. Then the sheet will let you do calculations on decimal numbers (though you’ll have to adjust yourself to get used to it :p)


Leave a Comment

Table of Contents