Comments (3)
Give the following a try:
Initialise
library(httr)
library(jsonline)
Setup GET request to coinapi
base <- "https://rest.coinapi.io/"
endpoint <- "/v1/exchangerate/BTC?apikey=" # note the request is for aseets against BTC
api_key <- "[your key]"
Create query string
call <- paste0(base, endpoint, api_key)
Retrieve data via GET call
get_prices <- GET(call)
Returns class "response"
class(get_prices)
Process into a data table
get_prices_text <- content(get_prices, "text") # Convert to "character"
get_prices_json <- fromJSON(get_prices_text, flatten = TRUE) # Flatten into list
List contains two objects:
1 - asset_id_base
2 - rates
names(get_prices_json)
get_prices_json$asset_id_base
head(get_prices_json$rates)
from coinapi-sdk.
I moved this response to the readme as the example of the usage of API form the R language. Thanks @AndrewManHayChiu for the effort
from coinapi-sdk.
@Svisstack I've made an R package for the REST API: https://github.com/Ramshreyas/rcoinapi - please use and share as you see fit. Feedback welcome to improve it!
from coinapi-sdk.
Related Issues (20)
- Golang data streaming API - Requesting volume data closes connection with error 1006 HOT 3
- OEML Docker container hangs in crashloop HOT 2
- Go client high CPU load HOT 1
- Does this coinapi API support keep alive and HTTP 1.1 HOT 1
- Requesting multiple assets exchange rate HOT 1
- OrderBookEvent HOT 2
- How to format URL to receive OHLCV 5 year time-series data returned in time ascending order on BTC ? HOT 1
- C# option to toggle debug output HOT 2
- Get detailed list of all symbols (Metadata) missmatching --- Metadata_list_symbolsAsync() / Symbol type HOT 1
- Wrong format of time_start parameter in Java HOT 1
- Java SDK make the Period_identifier public HOT 1
- Question about CryptoTick HOT 1
- CERTIFICATE_VERIFY_FAILED when running example code HOT 2
- 'Parameter subscribe_data_type is required.' error when value is set in message HOT 1
- Fetching current quote for exchange CRYPTOCOM fails HOT 1
- Price for DIGIFINEX totally wrong! HOT 2
- Request for feedback on the python client HOT 1
- "Failed to verify API key privileges which are required to access this resource" HOT 2
- Why such little activity? HOT 1
- No email is sent when requesting API key HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coinapi-sdk.