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 df0 -
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
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 689 Datastream
- 1.4K DSS
- 627 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 255 ETA
- 559 WebSocket API
- 39 FX Venues
- 15 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 24 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 278 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 2K Refinitiv Data Platform
- 708 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 106 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 95 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛