0
votes

I am trying to write a simple application to track profits from purchased cryptocurrencies. I am currently using Coinbase API and here is my problem.

Coinbase provides an endpoint that returns a list of all coins but including normal currencies something like https://api.coinbase.com/v2/currencies

I use it to list in the add currency tab all coins and when user selects the currency, I send a request for a price of a given currency.

Coinbase provides request for price like

https://api.coinbase.com/v2/prices/BTC-EUR/spot

so I concatenate this link in this way

https://api.coinbase.com/v2/prices/ + coin.getSymbol() + -EUR/spot ,

but when user selects for example AED then I receive 404 code.

And here is my question:

Is there any possibility to send a request which will return only cryptocurrencies so I can avoid this problem? Or maybe I'm doing it wrong and I should approach it from a different angle

I am also open to changing api but so far I have only found coinmarketcap which allows only six request per minute.

2
Welcome to StackOverflow. As explained in the tour, this site is a repository of useful questions and their answers, not a help forum. The question as posted is much too broad to be on-topic here. You should probably be looking to any Coinbase support forums, and/or the Coinbase source code. Please take the tour, visit the help center and especially read How to Ask and Why is “Can someone help me?” not an actual question? to learn how to use this site effectively. - Jim Garrison

2 Answers

0
votes

Please be careful when reading the documentation.

Get the total price to buy one bitcoin or ether.

This means that currency pairs can be: "BTC-..." or "ETH-...".

https://developers.coinbase.com/api/v2#prices

0
votes

When user selects AED, then won't the request be like

https://api.coinbase.com/v2/prices/AED-EUR/spot which Coinbase API doesn't support.

May be you want it to be like

https://api.coinbase.com/v2/prices/BTC-" + coin.getSymbol() + "/spot"