sstoeckl / crypto2 Goto Github PK
View Code? Open in Web Editor NEWCryptocurrency Market Data
Home Page: https://sstoeckl.github.io/crypto2/
License: Other
Cryptocurrency Market Data
Home Page: https://sstoeckl.github.io/crypto2/
License: Other
To start with, amazing package!
Not sure if intended but when filtering on a single coin in the coin_list argument by first using the crypto_list (within the crypto_history) function) it looks like the limit needs to be set in order for the function to work properly. It gives an error when the limit argument is kept at default (NULL) and when provided it runs.
Not setting the limit argument and keeping it to NULL (Default) causes error below.
Line 77 in 3059e48
Hi there,
I would like to retreive the historical global/aggregated marketcap over all coins as shown in the first chart here: https://coinmarketcap.com/charts/
Unfortunately, I haven't found the respective function in the package reference.
Any help would be highly appreciated!
Thank you very much in advance for a short reply.
Best,
André
I can see in the documentation that
https://coinmarketcap.com/api/documentation/v1/#operation/getV1CryptocurrencyListingsHistorical
This endpoint is available on the following API plans - the cheapest plans don't allow to use this endpoint.
I'm not R developer, what I'd like to get are the prices of top N market-cap cryptos over a few years by day.
Can I expect crypto2 to allow me to get this data?
Hi, thanks for making this package, this is really useful.
I was trying out the crypto_history function and it seems that no matter if you put a short timeline to cover (just the past 7 days for example), it fetches the whole data anyway and executes a filter at the end. Would it be possible to fetch only the data of interest instead to make for much faster queries?
Thanks!
Thanks for this great package. Is there any reason for using tibble over data.frame as the data format? Tibble is as slow as data.frame but more noisey, and can cause issues when converted to data.table. Would you consider using data.frame as the data format?
Create loop to do the history download in chunks of coins. It takes very long already and needs quite some RAM and time. Can (of cousre) be done manually.
Love the package. Thanks for developing this. Question: Do you have plans to integrate the "hourly" interval by chance? If not, I recommend removing it from the docs.
This:
> crypto_listings(which="latest", limit=10, quote=TRUE, finalWait=FALSE)
Gives:
Error in open.connection(con, "rb") :
cannot open the connection to 'https://web-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?limit=10&aux=market_cap_by_total_supply&convert=USD&sort=cmc_rank&sort_dir=desc&start=1'
In addition: Warning message:
In open.connection(con, "rb") :
cannot open URL 'https://web-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?limit=10&aux=market_cap_by_total_supply&convert=USD&sort=cmc_rank&sort_dir=desc&start=1': HTTP status was '400 Bad Request'
sessionInfo()
> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.6
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] dplyr_1.1.2 crypto2_1.4.5.99
loaded via a namespace (and not attached):
[1] progress_1.2.2 zoo_1.8-12 tidyselect_1.2.0 remotes_2.4.2 purrr_1.0.1 lattice_0.21-8
[7] vctrs_0.6.3 generics_0.1.3 miniUI_0.1.1.1 htmltools_0.5.5 usethis_2.1.6 utf8_1.2.3
[13] rlang_1.1.1 pkgbuild_1.4.0 later_1.3.1 pillar_1.9.0 urlchecker_1.0.1 glue_1.6.2
[19] withr_2.5.0 sessioninfo_1.2.2 plyr_1.8.8 lifecycle_1.0.3 stringr_1.5.0 devtools_2.4.5
[25] htmlwidgets_1.6.2 memoise_2.0.1 callr_3.7.3 fastmap_1.1.1 httpuv_1.6.10 ps_1.7.5
[31] curl_5.0.0 fansi_1.0.4 Rcpp_1.0.10 xtable_1.8-4 promises_1.2.0.1 cachem_1.0.8
[37] desc_1.4.2 pkgload_1.3.2 jsonlite_1.8.4 mime_0.12 fs_1.6.2 hms_1.1.3
[43] digest_0.6.31 stringi_1.7.12 processx_3.8.1 shiny_1.7.4 RJSONIO_1.3-1.8 grid_4.2.1
[49] rprojroot_2.0.3 cli_3.6.1 tools_4.2.1 magrittr_2.0.3 tibble_3.2.1 profvis_0.3.8
[55] tidyr_1.3.0 crayon_1.5.2 pkgconfig_2.0.3 ellipsis_0.3.2 prettyunits_1.1.1 timechange_0.2.0
[61] lubridate_1.9.2 rstudioapi_0.14 R6_2.5.1 compiler_4.2.1
This package has always worked for me before, but today I am getting this error when I use crypto_list():
Error: Problem with mutate()
input ..1
.
i ..1 = dplyr::across(7:8, as.Date)
.
x 'origin' must be supplied
Hello
crypto_history() returns the above error in most cases. It is particularly frustrating when it happens after a very long download time, as nothing is saved due to the error. Is there a way around this? Thanks
> data_1 <- crypto_history(start_date = "20130101", end_date = "20130201", sleep = 1)
> Scraping historical crypto data
| [32 / 32] [=====================================================] 100% in 00:32:00 ETA: 0s
Error in if (limit == 1) { : argument is of length zero
> data_1
Error: object 'data_1' not found
nest self-reported tags (the coin-info-list has more entries than the coin-list due to the self-reported tags). Current workaround:
ALLINFO %>% group_by(slug) %>% nest(self_reported_tags = c(self_reported_tags))
Thanks for this great R package! I used the crypto_history function to get all historical crypto prices from CoinMarketCap and got a tibble. When I convert this tibble to a data.frame, the resulted data.frame only has 11 rows. Not sure how this issue happened.
For the next release we implement:
I could only get 100 requests out before it threw HTTP error 429 for the rest of the day.
When trying to collect historical price data of e.g., BTC for time intervals smaller than daily, I run into errors.
For example:
CMC_coin_data <- crypto_history(selected_coin, finalWait=FALSE, interval="hourly")
will give this error:
In crypto_history(selected_coin, finalWait = FALSE, interval = "hourly") :
interval was not valid, using "daily". see documentation for allowed values.
However, these work just fine:
CMC_coin_data <- crypto_history(selected_coin, finalWait=FALSE, interval="daily")
CMC_coin_data <- crypto_history(selected_coin, finalWait=FALSE, interval="monthly")
Which is strange, especially since the documentation in the crypto_history.R file states the following:
#' @param interval string Interval with which to sample data, default 'daily'. Must be one of "hourly" "daily" "weekly" #' "monthly" "yearly" "1d" "2d" "3d" "7d" "14d" "15d" "30d" "60d" "90d" "365d"
Or am I missing something here? Thank you!
Hey there,
First of all, I just wanted to say that the package is really really good and I am a very happy user!
I was wondering whether there is a way to retrieve a list of coins (and time series) based on consensus mechanism such as "proof-of-work"?
For instance, there is a list of pow coins on CMC:
https://coinmarketcap.com/view/pow/
I have also found a category identifier in the API description on CMC called "consensus_mechanism" (see attachment).
That way crypto2 package users would be able to create coin indices based on consensus mechanism as well.
Thank you very much in advance for a short reply!
Best regards,
André
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.