-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Error: Request failed with status: 451 #142
Comments
Also experiencing this error |
Same here. But I'm from Brazil. |
Exception: Request failed for https://api.binance.com returned code 451. Truncated server response: { "code": 0, "msg": "Service unavailable from a restricted location according to 'b. Eligibility' in https://www.binance.com/en/terms. Please c... (use muteHttpExceptions option to examine full response) (linha 131). |
Current urlFetchWhitelist
|
same issue from germany looks like issue on api dev side, better upvote :) |
Same here, I'm from Romania |
I'm from India and facing similar issue, hope the developer will look into it. |
Not just me then! (yay). Same issue - New Zealand based |
Same issue here in Portugal |
Same issue here in uae
…On Thu, 1 Dec 2022, 18:26 Diogo Serrano, ***@***.***> wrote:
Same issue here in Portugal
—
Reply to this email directly, view it on GitHub
<#142 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVJXIIONH74LRUMK6LNMEPDWLCYTFANCNFSM6AAAAAASPRS24E>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
com>
|
Same issue here in UAE. This script has been working perfectly for the last 12 months, but it's now just throwing our a 451 status error. Concerningly, this appears to be a legal status code exception, suggesting the API calls are now region restricted? I note the developer is based in Argentina, so I'm wondering if the API requests are now region-locked to Argentina only? Has anyone tried running this on a VPN with Argentina as the host country? |
The location of the user has nothing to do with it. Requests are sent by google server |
I might have found a work around to get some prices but obvious not balance, open orders etc. since I don't have a US account. replace: with and add .us to urlFetchWhitelist
|
Binance US have very limited no of coins also liquidity is not good so if you are using historical data you might get very poor results. |
This is a no go also for personal accout info like spot wallet. So I played a round a bit. |
Se post 1. |
When using the API I get this message: According the Binance terms. Binance started to restrict the use of API in the US and some other countries. As the Google server that runs apps script is in US and API request will be refused. |
Exactly that my friends... it's not a bug, sadly, instead, it seems that Binance's legal restrictions are blocking the US servers in where the apps script is run, and we can't choose or change what internal Google server/instance/region to use (as far as I know). It makes no sense to me that Binance blocks IPs for read-only calls too...What if I'm from any other country but I travel to USA? I wouldn't be able to access and use my account while staying there? Whatever... clearly an extremelly stupid decision. The error message also says: A non-trivial workaroud could be to use a "trusted proxy", changing all the defined URLs at Sorry folks, but no easy-fix for this one, we would need to push and wait for some resolution between Binance and Google servers 😞 |
Hi Robert, Diego suggested that there is no easy fix around, so I'm trying the solution suggested by you. Can you guide me where should I add urlFetchWhitelist to get the desired result. |
appsscript.json |
Hi Guys, I've found a good alternative, which is an extension you simply install on Google Sheets and you can get access to live prices from it; https://workspace.google.com/marketplace/app/cryptosheets/898843532532 Thanks |
From an online bot i use called shrimpy.io - they had to move their servers to ireland from california to get around this issue We have just been informed by the Binance team that they will no longer allow API access to anyone from the United States. As a result, some of our customers have received a notice from Binance that their API keys will be disabled in seven days. First and foremost, there is nothing for you to be concerned about. This will not impact the integrity of your account. However, it will require you to recreate your API keys AFTER they make their updates in seven days. Over the next week, our team will be developing updates that will connect our US-based infrastructure to other countries. As a result of that effort, we will be assigning new IPs to any customer that uses a Binance account. In seven days, we'll notify you to create your new API keys. When creating them, you will need to use the new IPs provided by Shrimpy. The old IPs will no longer work for Binance.Our team will continue to provide updates as we get closer to the migration date. First and foremost, there is nothing for you to be concerned about. This will not impact the integrity of your account. However, it will require you to recreate your API keys AFTER they make their updates in seven days. Over the next week, our team will be developing updates that will connect our US-based infrastructure to other countries. As a result of that effort, we will be assigning new IPs to any customer that uses a Binance account. In seven days, we'll notify you to create your new API keys. When creating them, you will need to use the new IPs provided by Shrimpy. The old IPs will no longer work for Binance. Our team will continue to provide updates as we get closer to the migration date. In the mean-time, please email [email protected] if you have any questions. The Shrimpy Team Shrimpy 3833 E Main St PMB 4006, St. Charles, IL 60174 |
Update: @diegomanuel |
Hi Robert, can you share a sample spreadsheet if you managed to get it. |
Se post 1 replace: and add data.binance.com to urlFetchWhitelist |
Made both the changes but still getting no update in 24h stats. Please have a look if possible https://docs.google.com/spreadsheets/d/1x3yPplVXpFnIPQ-mDDGYIvWgwXmenooTh6QlyQHr4mw/edit?usp=sharing |
I'm getting price and 24h stats, but error in DEMO is "Exceeded maximum execution time (line 0)" |
Hey folks, I've released a new version with proxy support: I've also created a basic proxy implementation that may be useful for someone else: I'm closing this ticket. [#143] How to install Add-On Proxy on Mac |
https://dev.binance.vision/t/api-error-451-unavailable-for-legal-reasons/13828 |
Didn't try Plz @cristipurdel let us know if you manage to get all the add-on functions/endpoints working with |
I have not tried |
Due to Binances changes and my inability to figure out your proxy solution i had a look about and found : |
Modifying the url to https://data.binance.com worked for me.
|
Got error 404 here |
Did you add "data.binance.com" to urlFetchWhitelist? |
Reopening the issue for better visibility since there are people still having questions/problems about this. |
Hi everyone, I believe most of us have been experiencing issues with error 451 and have had to resort to building a proxy, provided we have the knowledge to do so. This morning (28/03/2023), I was attempting some actions on my Google Sheet and encountered the typical error 451 code. However, upon returning to my desk, I magically found that the issue had been resolved, and I was able to retrieve all the necessary data from my account. Has anyone else experienced a similar occurrence? I would like to express my gratitude to @diegomanuel for the amazing work and updates they have provided for us. Would it be possible to add the option to link an unlimited number of Binance accounts? EDIT: My happiness was short-lived as I'm now back to encountering the full error 451 on my Google Sheet. I'm unsure what happened or how it was briefly working earlier. Best regards, |
For everyone who waiting for a workaround, I found one! Take a look at the this issue where I described it:
|
Describe the bug
Script has been working flawless over a year but today I started to get error 451: Unavailable For Legal Reasons
Binance API last call
Wed Nov 30 2022 09:10:50 GMT+0100 (Central European Standard Time)
I'm from Europe, I guess this error is due to that Google runs on server in a “Restricted Location” or?
attempting to access the Binance Platform or the Binance Services from, or otherwise acting on behalf of a person or legal entity that is resident or located in, a Restricted Location. For the purposes hereof, “Restricted Location” shall include the United States, Malaysia, Ontario (Canada), and such other locations as designated by Binance Operators from time to time as a “Restricted Location”
https://www.binance.com/en/terms
I'm able to call API Locally but unable to do it using Google script, simple test is to use this API call in a browser.
https://api.binance.com/api/v3/time
Update:
https://data.binance.com/ can be used for getting market data.
replace:
const SPOT_API_URL = "https://api.binance.com";
with
const SPOT_API_URL = "https://data.binance.com";
and add data.binance.com to urlFetchWhitelist
Work around (not needed any more)
I might have found a work around to get some prices but obvious not balance, open orders etc. since I don't have a US account.
replace:
const SPOT_API_URL = "https://api.binance.com";
with
const SPOT_API_URL = "https://api.binance.us";
and add .us to urlFetchWhitelist
Edit:
Same problem with DEMO
https://docs.google.com/spreadsheets/d/1AcOcPFsncrDB_ve3wWMHwfiFql6A4hmG1sFc01LLTDg
The text was updated successfully, but these errors were encountered: