initCoinGeckoAPI <- function() {
require(rAPI)
rAPI <- init_rAPI(baseUrl = "https://api.coingecko.com/api/v3/")
coinGeckoAPI <- list()
coinGeckoAPI$ping <- function() {
return (rAPI$api$generic(urlEndpointPart = "ping"))
}
coinGeckoAPI$getMarket <- function(vs_currency="BTC") {
return (rAPI$api$generic(urlEndpointPart = "coins/markets"))
}
return(coinGeckoAPI)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.