How to connect the R Script to the latest version of Eikon API?
Raising this on behalf of an external client. I would like to use this language to access the Eikon API and I see there is a Python package, but looking for an R package.
Best Answer
-
Thank you for reaching out to us.
As far as I know, we don't officially provide the R library for Eikon Data API.
There is the Eikon Data API library for R available on GitHub but it is a community version.
0
Answers
-
Hello @mariellejoy
Please note that the eikonapir is not LSEG product and is not supported by LSEG.
If you have any questions or encounter issues with the product, please contact the developer directly via GitHub directly.
0 -
Use the latest refinitiv-data library (or the old eikon one) and use the reticulate package to connect to the python environment where you pull the data via python. Then you only need to focus on data pulling via python and can continue with data wrangling in R.
In my case reticulate had problems with x64 data formats and I wrote the following function for cleaning/transforming these:def CleanDtypes(df):
df.reset_index(drop = True,inplace = True)
for col in df.select_dtypes(include=['float64']).dtypes.to_dict():
df[[col]] = df[[col]].astype("float32")
for col in df.select_dtypes(include=['Int64']).dtypes.to_dict():
df[[col]] = df[[col]].astype(int)
for col in df.select_dtypes(include=['string']).dtypes.to_dict():
df[[col]] = df[[col]].astype(str)
return df1 -
P.s.: You can also keep it more R style using the reticulate wrappers for direct python execution in R:
> library(reticulate)
> Sys.getenv("RETICULATE_PYTHON")
[1] "C:\\ProgramData\\Anaconda3\\envs\\someenv"
> rd <- import("refinitiv.data")
> pd <- import("pandas")
> datetime <- import("datetime")
>
> rd$open_session()
<refinitiv.data.session.Definition object at 0x2a248194650 {name='workspace'}>
> IndexConst <- rd$get_data(
+ universe = c('.FTSE'),
+ fields =
+ c('TR.IndexConstituentRIC',
+ 'TR.IndexConstituentName',
+ 'TR.IndexConstituentWeightPercent'),
+ parameters =
+ list(
+ 'SDate' = '2023-06-01'
+ ),
+ use_field_names_in_headers = TRUE
+ )
>
> tibble::as_tibble(IndexConst)
# A tibble: 100 × 4
Instrument TR.INDEXCONSTITUENTRIC TR.INDEXCONSTITUENTNAME TR.INDEXCONSTITUENTW…¹
<chr> <chr> <chr> <dbl>
1 .FTSE STAN.L STANDARD CHARTERED PLC ORD 0.789
2 .FTSE CRDA.L CRODA ORD 0.444
3 .FTSE ANTO.L ANTOFAGASTA ORD 0.248
4 .FTSE BNZL.L BUNZL ORD 0.551
5 .FTSE SGE.L SAGE GROUP ORD 0.460
6 .FTSE SVT.L SEVERN TRENT ORD 0.352
7 .FTSE BLND.L BRITISH LAND REIT 0.166
8 .FTSE ICAG.L INTL CONSOLIDATED AIRLINES G… 0.302
9 .FTSE REL.L RELX PLC ORD 2.54
10 .FTSE SMIN.L SMITHS GROUP ORD 0.297
# ℹ 90 more rows
# ℹ abbreviated name: ¹TR.INDEXCONSTITUENTWEIGHTPERCENT
# ℹ Use `print(n = ...)` to see more rows0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛