gleif is a minimal R client for the gleif API. A major challenge when dealing with financial data is the mapping of entities across different data sources. Especially when dealing with legal entities, the Legal Entity Identifier (LEI) can be used to uniquely identify entities.
Installation
You can install the development version of gleif from GitHub with:
# install.packages("pak")
pak::pak("m-muecke/gleif")
Usage
Currently the download of the lei mapping data and the retrieval of records by LEI is supported:
library(gleif)
# fetch the latest LEI mapping data (single file with all mappings)
mapping <- lei_mapping("isin")
head(mapping)
#> lei isin
#> 1 00EHHQ2ZHDCFXJCPCL46 US92204Q1031
#> 2 00KLB2PFTM3060S2N216 US4138382027
#> 3 01ERPZV3DOLNXY2MLB90 US531554CN13
#> 4 01ERPZV3DOLNXY2MLB90 US531554CP60
#> 5 01KWVG908KE7RKPTNP46 US43785QQZ99
#> 6 01KWVG908KE7RKPTNP46 US43785QRA30
# fetch LEI records by a given LEI identifier
records <- lei_records("001GPB6A9XPE8XJICC14")
str(records)
#> 'data.frame': 37 obs. of 3 variables:
#> $ lei : chr "001GPB6A9XPE8XJICC14" "001GPB6A9XPE8XJICC14" "001GPB6A9XPE8XJ"..
#> $ name : chr "entity_legal_name_name" "entity_legal_name_language" "entity_"..
#> $ value: chr "Fidelity Advisor Leveraged Company Stock Fund" "en" "FIDELITY"..
Related work
- gleifr - R package to support analysis of GLEIF data