The goal of ubci is to get UBCI(UpBit Crypto Index) & Crypto price data form upbit.

  • notice : This is a personal project and not relevant to upbit.

Installation

ubci is now on cran!

You can install on cran with:

install.packages("ubci")

You can install the development version of ubci from GitHub with:

source("https://install-github.me/mrchypark/ubci")

please check encoding UTF-8 for unix-like os.

Example

index options

ubci_index_options() function return list of index code & descriptions.

ubci_index_options() function provide lang param for korean descriptions.

index

ubci_index() function return index data with code, range of date with from/to.

loi<-ubci_index_options()
loi$index[1]
#> [1] "UBMI"
ubci_index(loi$index[1])
#> # A tibble: 262 x 6
#>    index date        open  high   low close
#>    <chr> <date>     <dbl> <dbl> <dbl> <dbl>
#>  1 UBMI  2018-06-19 1718. 1787. 1709. 1754.
#>  2 UBMI  2018-06-18 1666. 1737. 1641. 1718.
#>  3 UBMI  2018-06-17 1678. 1694. 1661. 1665.
#>  4 UBMI  2018-06-16 1660. 1690. 1641. 1678.
#>  5 UBMI  2018-06-15 1722. 1726. 1655. 1660.
#>  6 UBMI  2018-06-14 1621. 1729. 1602. 1721.
#>  7 UBMI  2018-06-13 1698. 1704. 1575. 1621.
#>  8 UBMI  2018-06-12 1796. 1810. 1672. 1697.
#>  9 UBMI  2018-06-11 1780. 1800. 1718. 1795.
#> 10 UBMI  2018-06-10 1970. 1970. 1722. 1779.
#> # ... with 252 more rows
tail(ubci_index(loi$index[1], from="2018-05-15"))
#> # A tibble: 6 x 6
#>   index date        open  high   low close
#>   <chr> <date>     <dbl> <dbl> <dbl> <dbl>
#> 1 UBMI  2018-05-20 2216. 2300. 2198. 2290.
#> 2 UBMI  2018-05-19 2231. 2255. 2197. 2215.
#> 3 UBMI  2018-05-18 2199. 2232. 2140. 2229.
#> 4 UBMI  2018-05-17 2281. 2317. 2177. 2200.
#> 5 UBMI  2018-05-16 2319. 2330. 2183. 2281.
#> 6 UBMI  2018-05-15 2419. 2439. 2301. 2317.
ubci_index(loi$index[1], to="2018-05-15")
#> # A tibble: 227 x 6
#>    index date        open  high   low close
#>    <chr> <date>     <dbl> <dbl> <dbl> <dbl>
#>  1 UBMI  2018-05-15 2419. 2439. 2301. 2317.
#>  2 UBMI  2018-05-14 2431. 2456. 2305. 2417.
#>  3 UBMI  2018-05-13 2313. 2445. 2274. 2430.
#>  4 UBMI  2018-05-12 2206. 2356. 2138. 2313.
#>  5 UBMI  2018-05-11 2446. 2465. 2088. 2239.
#>  6 UBMI  2018-05-10 2598. 2608. 2431. 2446.
#>  7 UBMI  2018-05-09 2549. 2594. 2441. 2583.
#>  8 UBMI  2018-05-08 2618. 2644. 2521. 2567.
#>  9 UBMI  2018-05-07 2700. 2700. 2538. 2612.
#> 10 UBMI  2018-05-06 2699. 2699. 2699. 2699.
#> # ... with 217 more rows
ubci_index(loi$index[1], from="2018-05-10", to="2018-05-15")
#> # A tibble: 6 x 6
#>   index date        open  high   low close
#>   <chr> <date>     <dbl> <dbl> <dbl> <dbl>
#> 1 UBMI  2018-05-15 2419. 2439. 2301. 2317.
#> 2 UBMI  2018-05-14 2431. 2456. 2305. 2417.
#> 3 UBMI  2018-05-13 2313. 2445. 2274. 2430.
#> 4 UBMI  2018-05-12 2206. 2356. 2138. 2313.
#> 5 UBMI  2018-05-11 2446. 2465. 2088. 2239.
#> 6 UBMI  2018-05-10 2598. 2608. 2431. 2446.

crypto price

ubci_get() function return crypto prcie data with code, range of date with from/to.

loc<-ubci_get_options()
loc$code[1]
#> [1] "UPBIT.KRW-BTC"
ubci_get(loc$code[1])
#> # A tibble: 268 x 7
#>    code          date          open    high     low   close volume
#>    <chr>         <date>       <dbl>   <dbl>   <dbl>   <dbl>  <dbl>
#>  1 UPBIT.KRW-BTC 2018-06-19 7461000 7649000 7428000 7553000  3189.
#>  2 UPBIT.KRW-BTC 2018-06-18 7231000 7550000 7135000 7461000  3051.
#>  3 UPBIT.KRW-BTC 2018-06-17 7275000 7329000 7206000 7218000  1502.
#>  4 UPBIT.KRW-BTC 2018-06-16 7180000 7336000 7116000 7277000  2031.
#>  5 UPBIT.KRW-BTC 2018-06-15 7363000 7399000 7151000 7180000  3302.
#>  6 UPBIT.KRW-BTC 2018-06-14 7039000 7380000 6977000 7355000  6512.
#>  7 UPBIT.KRW-BTC 2018-06-13 7350000 7390000 6951000 7040000  4943.
#>  8 UPBIT.KRW-BTC 2018-06-12 7635000 7685000 7270000 7350000  5044.
#>  9 UPBIT.KRW-BTC 2018-06-11 7576000 7662000 7362000 7635000  4309.
#> 10 UPBIT.KRW-BTC 2018-06-10 8233000 8247000 7425000 7576000  7445.
#> # ... with 258 more rows
tail(ubci_get(loc$code[1], from="2018-05-15"))
#> # A tibble: 6 x 7
#>   code          date          open    high     low   close volume
#>   <chr>         <date>       <dbl>   <dbl>   <dbl>   <dbl>  <dbl>
#> 1 UPBIT.KRW-BTC 2018-05-20 9112000 9398000 9051000 9370000  4901.
#> 2 UPBIT.KRW-BTC 2018-05-19 9165000 9299000 9068000 9112000  6285.
#> 3 UPBIT.KRW-BTC 2018-05-18 9072000 9186000 8881000 9165000  5904.
#> 4 UPBIT.KRW-BTC 2018-05-17 9297000 9390000 9020000 9090000  6922.
#> 5 UPBIT.KRW-BTC 2018-05-16 9500000 9542000 9015000 9297000 12219.
#> 6 UPBIT.KRW-BTC 2018-05-15 9802000 9879000 9458000 9500000  8326.
ubci_get(loc$code[1], to="2018-05-15")
#> # A tibble: 233 x 7
#>    code          date           open     high      low    close volume
#>    <chr>         <date>        <dbl>    <dbl>    <dbl>    <dbl>  <dbl>
#>  1 UPBIT.KRW-BTC 2018-05-15  9802000  9879000  9458000  9500000  8326.
#>  2 UPBIT.KRW-BTC 2018-05-14  9804000  9935000  9400000  9797000 12813.
#>  3 UPBIT.KRW-BTC 2018-05-13  9480000  9851000  9360000  9803000  8513.
#>  4 UPBIT.KRW-BTC 2018-05-12  9257000  9644000  9014000  9481000 10980.
#>  5 UPBIT.KRW-BTC 2018-05-11  9976000  9985000  8788000  9256000 20998.
#>  6 UPBIT.KRW-BTC 2018-05-10 10405000 10474000  9895000  9976000  9078.
#>  7 UPBIT.KRW-BTC 2018-05-09 10230000 10433000  9917000 10405000  9955.
#>  8 UPBIT.KRW-BTC 2018-05-08 10439000 10499000 10130000 10233000  7651.
#>  9 UPBIT.KRW-BTC 2018-05-07 10684000 10721000 10264000 10422000  8143.
#> 10 UPBIT.KRW-BTC 2018-05-06 10820000 10963000 10500000 10684000  8806.
#> # ... with 223 more rows
ubci_get(loc$code[1], from="2018-05-10", to="2018-05-15")
#> # A tibble: 6 x 7
#>   code          date           open     high     low   close volume
#>   <chr>         <date>        <dbl>    <dbl>   <dbl>   <dbl>  <dbl>
#> 1 UPBIT.KRW-BTC 2018-05-15  9802000  9879000 9458000 9500000  8326.
#> 2 UPBIT.KRW-BTC 2018-05-14  9804000  9935000 9400000 9797000 12813.
#> 3 UPBIT.KRW-BTC 2018-05-13  9480000  9851000 9360000 9803000  8513.
#> 4 UPBIT.KRW-BTC 2018-05-12  9257000  9644000 9014000 9481000 10980.
#> 5 UPBIT.KRW-BTC 2018-05-11  9976000  9985000 8788000 9256000 20998.
#> 6 UPBIT.KRW-BTC 2018-05-10 10405000 10474000 9895000 9976000  9078.

Session info is below.

Data source license is below.

“UBCI 인덱스”
Copyright 2018 두나무(주) All rights reserved.
Powered by 두나무/Upbit

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.