question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What is 'requests.exceptions.HTTPError: 451 Client Error'??? (binance)

See original GitHub issue

Hello. I am operating a class that allows automatic sales through Python by communicating with CCXT through AWS server.


Traceback (most recent call last):
  File "/home/ec2-user/.local/lib/python3.7/site-packages/ccxt/base/exchange.py", line 613, in fetch
    response.raise_for_status()
  File "/home/ec2-user/.local/lib/python3.7/site-packages/requests/models.py", line 953, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 451 Client Error:  for url: https://fapi.binance.com/fapi/v1/exchangeInfo

However, some students suddenly encounter the above error and cannot call the API.

Was it blocked due to excessive API calls? Or is there another problem? Please give me feedback on when such a message comes.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:2
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
singhyun90commented, Nov 29, 2022

Try running the code in an environment other than the US. It looks like Binance has blocked the US API.

Link : https://www.binance.com/en/terms –> 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” for the purposes hereof;

0reactions
ttoduacommented, Dec 23, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

API Error 451 Unavailable For Legal Reasons - Withdrawal API
If you see HTTP status code of 451 or an error like “Service unavailable from a restricted location according to 'b. Eligibility'” returned...
Read more >
How To Fix or Bypass Error 451: Unavailable Due to Legal ...
In a nutshell, this error message indicates that the website owner or your local government/authority has blocked access to the website in order...
Read more >
451 Unavailable for Legal Reasons - HTTP - W3cubDocs
The HyperText Transfer Protocol (HTTP) 451 Unavailable For Legal Reasons client error response code indicates that the user requested a resource that is...
Read more >
451 Unavailable For Legal Reasons - HTTP - MDN Web Docs
The HyperText Transfer Protocol (HTTP) 451 Unavailable For Legal Reasons client error response code indicates that the user requested a ...
Read more >
Can not connect to binance · Issue #6066 · freqtrade ... - GitHub
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: ... During handling of the above exception, another exception occurred:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found