Troubled Getting Cryptocurrency Data API in R

219 Views Asked by At

I've tried two cryptocurrency API package for R, to name it:

  1. coinmarketcapr package
  2. riingo <- included in tidyquant I really want to get updated historical data of cryptocurrency, my goal is to predict the thing with some timeseries analysis, but with these packages I kept getting error message, for coinmarketcapr it's understandable because apparently my API subscription plan doesn't cover the historical data, but for the riingo the message shows just like this...
> riingo_crypto_latest("btcusd", resample_frequency = "10min", base_currency = NULL)
Request failed [401]. Retrying in 1.6 seconds...
Request failed [401]. Retrying in 1.5 seconds...
Error: There was an error, but riingo isn't sure why. See Tiingo msg for details.
Tiingo msg) Invalid token.

Can somebody help me? Or maybe suggesting other source for taking cryptocurrency historical data? Thank you in advance for any answer!

P.S. I've already inserted the API key, so it's not the authentication problem.

1

There are 1 best solutions below

0
On

If you trying to scrape information about new listings at crypto exchanges and some more useful info, you can be interested at using this API:

https://rapidapi.com/Diver44/api/new-cryptocurrencies-listings/

Example request in R:

library(httr)

url <- "https://new-cryptocurrencies-listings.p.rapidapi.com/new_listings"

response <- VERB("GET", url, add_headers(x_rapidapi-host = 'new-cryptocurrencies-listings.p.rapidapi.com', x_rapidapi-key = 'your-api-key', '), content_type("application/octet-stream"))

content(response, "text")

It includes an endpoint with New Listings from the biggest exchanges and a very useful endpoint with information about exchanges where you can buy specific coins and prices for this coin at that exchanges. You can use this information for trading. When currency starts to list at popular exchanges like Binance, KuCoin, Huobi, etc the price increases about 20-30%