iexcloudr
documentationsuppressWarnings(library(magrittr))
suppressWarnings(library(iexcloudr))
iexcloudr: Set api keys with iexcloudr::apikey()
iexcloudr::apikey(api_key = Sys.getenv("IEXAPIKEYPUBLIC"),
secret_key = Sys.getenv("IEXAPIKEYSECRET"),sandbox = TRUE)
iexcloudr sandbox mode
Now let’s get us a list of exchanges:
iexcloudr::exchanges() %>% dplyr::filter(region=='DE')
# A tibble: 8 x 5
exchange region description mic exchangeSuffix
<chr> <chr> <chr> <chr> <chr>
1 STU DE "tetugatrrBoe tSs" STXU -SG
2 DUS DE "irelr sefoesehkvuBreeredorsFD" XDSU -DG
3 BER DE "sBe eeonrirBl" ERBX GB-
4 FRA DE "ke erFsrurveaFrkrei hnBetfor" RXAF G-F
5 HAN DE "vssrooraenhZsaeeiseNccHried Bu ee hn" AHNX G-I
6 ETR DE "rtXea" ERXT YG-
7 HAM DE "caaurisbipasHeephenHtaremtroebWsgre " HMAX G-H
8 MUN DE "ehehrkrFres en ieeuBonvcerM" XNMU M-G
Or a list of symbols by exchange:
symbols_by_exchange('ETR') %>%
head(5) %>%
dplyr::select(symbol,name,date,type,currency,isEnabled)
# A tibble: 5 x 6
symbol name date type currency isEnabled
<chr> <chr> <chr> <chr> <chr> <lgl>
1 00XJ-GY "ded yrndUSleuEeoi ioiTrEaItdimWuAeg~ 2021-0~ et EUR TRUE
2 00XK-GY "Reist t idoeSHClEoii ee egiW s Tmo~ 2021-0~ et EUR TRUE
3 00XL-GY "Dlev olTd e -EiEG aTp pbmHeTlbrUeF~ 2021-0~ et EUR TRUE
4 00XM-GY "scusmLe ioeEet i ltegordeiei eSHmit~ 2021-0~ et EUR TRUE
5 00XN-GY "oe-RseeFosei edWtgieHymr diaSrgl To~ 2021-0~ et EUR TRUE
Or the symbols by ISIN:
symbols_by_isin('DE0008404005') %>% dplyr::filter(region=='DE')
# A tibble: 8 x 3
symbol region exchange
<chr> <chr> <chr>
1 ALV-GS DE STU
2 ALV-GH DE HAM
3 ALV-GM DE MUN
4 ALV-GD DE DUS
5 ALV-GB DE BER
6 ALV-GY DE ETR
7 ALV-GF DE FRA
8 ALV-GI DE HAN
We can also get us some company info
company_info('ALV-GY')
$symbol
[1] "ALV-GY"
$companyName
[1] "Allianz SE"
$exchange
[1] "XETRA"
$industry
[1] "tcfdhrantAFnTt ins nar iI naPireidnonons doreuPiuys mda s"
$website
[1] "otalwswti.m/./pa/cwlnhz:"
$description
[1] ""
$CEO
[1] ""
$securityName
[1] "ehid -gS las earrlAnEtRieS ezs"
$issueType
[1] "cs"
$sector
[1] "Faan Ienccensi aurdnn"
$primarySicCode
[1] 6673
$employees
NULL
$tags
[1] "u un-ILiernilneasctM"
[2] "Fnciaen"
[3] "cIsi caanadrnen unneF"
[4] "iaucron nn sddft d airaotrsinuensdishtnFnaTimyAPnIeroP "
$address
[1] "sn anees82toirgKis"
$address2
NULL
$state
[1] "rnaBey"
$city
[1] "cnhenueM"
$zip
[1] "83646"
$country
[1] "menaGry"
$phone
[1] "508645247"
and daily prices for a number of symbols:
prices(symbols = c('ALV-GY','AAPL'), start_date = '2021-05-15')
# A tibble: 76 x 9
symbol date open high low close aClose fClose volume
<chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <int>
1 AAPL 2021-05-17 129. 133. 130. 128. 131. 126. 74598177
2 AAPL 2021-05-18 132. 132. 127. 126. 130. 131. 64293816
3 AAPL 2021-05-19 124. 127. 123. 126. 129. 125. 94360572
4 AAPL 2021-05-20 129. 129. 130 128. 133. 130. 77381785
5 AAPL 2021-05-21 133. 133 130. 127. 130. 130. 80006543
6 AAPL 2021-05-24 130. 128. 127. 131. 129. 133. 65772500
7 AAPL 2021-05-25 130. 128. 132. 131. 130. 129. 72524274
8 AAPL 2021-05-26 132. 131. 132. 133. 128. 127. 58702426
9 AAPL 2021-05-27 128. 131. 131. 127. 132. 130. 95931139
10 AAPL 2021-05-28 128. 131. 131. 129. 129. 127. 72024768
# ... with 66 more rows
If you need exchange rates:
exchange_rates(symbols=c("EURUSD","EURGBP"), start_date='2021-05-15')
# A tibble: 87 x 3
date symbol rate
<chr> <chr> <dbl>
1 2021-05-15 EURUSD 1.24
2 2021-05-17 EURGBP 0.882
3 2021-05-17 EURUSD 1.23
4 2021-05-18 EURGBP 0.878
5 2021-05-18 EURUSD 1.26
6 2021-05-19 EURGBP 0.890
7 2021-05-19 EURUSD 1.23
8 2021-05-20 EURGBP 0.877
9 2021-05-20 EURUSD 1.24
10 2021-05-21 EURGBP 0.866
# ... with 77 more rows
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.