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.

Coinbase BadRequest https://api.coinbase.com/v2/exchange-rates

See original GitHub issue

This just happened even though I did not change any of my code. All I am calling is a fetchbalance(). I did upgrade to the latest ccxt version 1.41.81 but it didn’t fix the issue.

vmware@ubuntu20041a:~/extra$ python3 ccoinbase.py
Traceback (most recent call last):
  File "/home/vmware/.local/lib/python3.8/site-packages/ccxt/base/exchange.py", line 589, in fetch
    response.raise_for_status()
  File "/home/vmware/.local/lib/python3.8/site-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.coinbase.com/v2/exchange-rates

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "ccoinbase.py", line 5, in <module>
    pp.pprint(coinbase.fetchBalance())
  File "/home/vmware/.local/lib/python3.8/site-packages/ccxt/coinbase.py", line 688, in fetch_balance
    self.load_markets()
  File "/home/vmware/.local/lib/python3.8/site-packages/ccxt/base/exchange.py", line 1354, in load_markets
    currencies = self.fetch_currencies()
  File "/home/vmware/.local/lib/python3.8/site-packages/ccxt/coinbase.py", line 575, in fetch_currencies
    response = self.fetch_currencies_from_cache(params)
  File "/home/vmware/.local/lib/python3.8/site-packages/ccxt/coinbase.py", line 566, in fetch_currencies_from_cache
    exchangeRates = self.publicGetExchangeRates(params)
  File "/home/vmware/.local/lib/python3.8/site-packages/ccxt/base/exchange.py", line 466, in inner
    return entry(_self, **inner_kwargs)
  File "/home/vmware/.local/lib/python3.8/site-packages/ccxt/base/exchange.py", line 491, in request
    return self.fetch2(path, api, method, params, headers, body)
  File "/home/vmware/.local/lib/python3.8/site-packages/ccxt/base/exchange.py", line 487, in fetch2
    return self.fetch(request['url'], request['method'], request['headers'], request['body'])
  File "/home/vmware/.local/lib/python3.8/site-packages/ccxt/base/exchange.py", line 605, in fetch
    self.handle_errors(http_status_code, http_status_text, url, method, headers, http_response, json_response, request_headers, request_body)
  File "/home/vmware/.local/lib/python3.8/site-packages/ccxt/coinbase.py", line 1145, in handle_errors
    self.throw_exactly_matched_exception(self.exceptions['exact'], errorCode, feedback)
  File "/home/vmware/.local/lib/python3.8/site-packages/ccxt/base/exchange.py", line 505, in throw_exactly_matched_exception
    raise exact[string](message)
ccxt.base.errors.ExchangeError: coinbase {"errors":[{"id":"invalid_request","message":"Invalid currency (USD)"}]}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
chiwalfrmcommented, Feb 11, 2021

it’s fixed! must be coinbase messing around… closing this issue.

0reactions
kroitorcommented, Feb 11, 2021

The endpoint for currencies is broken… Doesn’t work for me either.

Try this with curl or with your browser: curl https://api.coinbase.com/v2/exchange-rates

Docs: https://developers.coinbase.com/api/v2#exchange-rates

If it does not work for you without CCXT, then this is not an issue inside CCXT – looks like a problem at Coinbase or smth.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prices | Coinbase Cloud
Note that exchange rates fluctuates so the price is only correct for seconds at the time. This buy price includes standard Coinbase fee...
Read more >
Can't place buy orders · Issue #62 · bchavez/Coinbase - GitHub
However, I try to place a buy order for an amount of Bitcoin with it, and I keep getting 400 Bad Request from...
Read more >
Coinbase API v2 Getting Historic Price for Multiple Days
The api all depends on what you are looking for. If you want accurate historical data, there are better options, but usually require...
Read more >
How To Connect Coinbase to Google Sheets [API Tutorial]
Some Coinbase API endpoints require HMAC SHA256 and others don't. This tutorial goes through examples that ... https://api.coinbase.com/v2/exchange-rates.
Read more >
Coinbase API - A Introduction Guide - AlgoTrading101 Blog
How to get real time price data for Bitcoin using Coinbase API? ... and refresh tokens in the Coinbase API? Potential errors and...
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