coinmarketcapr
coinmarketcapr copied to clipboard
API error
I guess this coincap's API changes.
latest_marketcap <- get_global_marketcap('EUR') ‼ The old API is used when no 'apikey' is given. x The request was not succesfull! Request URL: https://api.coinmarketcap.com/v1/global/?convert=EUR Response Content: { "statusCode": 410, "error": "Gone", "message": "WARNING: This API is now offline. Please switch to the new CoinMarketCap API. (https://pro.coinmarketcap.com/migrate/)" }
Error in check_response(d) :
I have same error, please update the functions as well, get_marketcap_ticker_all has been depricated
@iboumiza Did you try the new API functions (with the key) ?
@amrrs , I did try:
https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?api_key=API_KEY_HERE
but I keep getting:
{ "status": { "timestamp": "2020-03-23T18:29:38.913Z", "error_code": 1002, "error_message": "API key missing.", "elapsed": 0, "credit_count": 0 } }
Can you provide a working example to test, please?
In that above example you pasted, there's no API Key, you need to first get the API Key here https://pro.coinmarketcap.com/signup/?plan=0
Indeed, I removed my private API KEY as it's not public and have monthly limits (new coinmarketcap business model), that's why I'm referring to you to update the current script to work with private API KEYs
Thanks
@iboumiza The package should work with API-keys, so I dont really understand which script should be updated?
Previously it also worked without an API-key, but apparently that old API is now offline. Is that correct @amrrs ? If yes, then we should update some functions/warnings/docs, ec..
@iboumiza The package should work with API-keys, so I dont really understand which script should be updated?
Previously it also worked without an API-key, but apparently that old API is now offline. Is that correct @amrrs ? If yes, then we should update some functions/warnings/docs, ec..
Can you please post a screenshot of your code with the result, because I did all the possible combinations, and none of them work.
Thank you
I just tried out these functions. They all worked for me. But I can confirm, the old API is no longer valid.
coinmarketcapr::setup('YOUR_API_KEY')
res <- get_crypto_listings()
res <- get_global_marketcap('AUD')
res <- get_global_marketcap(latest = T, time_start = Sys.Date() - 180,
time_end = Sys.Date(), count = 10,
interval = "yearly")
Perfect, it works! Thank you :)
@trafficonese guess we might need to remove the old functions. What say ?
Yes definitly, since they will not work anymore. We also need to adapt the docs/warnings/errors/etc. And maybe make the tests finally consistent, so they always run through.
Aren't you also trying to publish the package to ropensci
? I think they require tests and a vignette?
Also, some functions will not work under the free plan (no historical data):
https://coinmarketcap.com/api/pricing/
For example:
get_crypto_quotes(latest = FALSE, symbol = c("BTC","ETH"), time_start = Sys.Date()-180, time_end=Sys.Date(), count = 10, interval = "30m")
This should be visible in the response.
"status": {
"timestamp": "2020-03-27T14:41:48.467Z",
"error_code": 1006,
"error_message": "Your API Key subscription plan doesn't support this endpoint.",
"elapsed": 0,
"credit_count": 0
}
I think that information should be sufficient.
Thank you to @trafficonese for outlining the solution. The documentation needs to be updated, it says functions like get_global_marketcap
work without an API key but that is not the case, and there is nothing that I saw outlined relating to using coinmarketcapr::setup('YOUR_API_KEY')
which is exactly what I needed. Might want to update some of the documentation accordingly. Thanks for the package!