| Title: | Client for the 'GLEIF' API |
|---|---|
| Description: | Download legal entity reference data from the 'Global Legal Entity Identifier Foundation' ('GLEIF') API. Retrieve Legal Entity Identifier ('LEI') records, their direct and ultimate parent and child relationships, accredited issuers ('Local Operating Units'), and mappings from 'LEI' codes to other identifiers such as 'ISIN', 'BIC', and 'MIC'. See <https://www.gleif.org/en/lei-data/gleif-api> for further details. |
| Authors: | Maximilian Mücke [aut, cre] (ORCID: <https://orcid.org/0009-0000-9432-9795>) |
| Maintainer: | Maximilian Mücke <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-06-20 17:29:35 UTC |
| Source: | https://github.com/cran/gleifr |
lei_cache_dir() returns the path where cached API responses are stored.
lei_cache_clear() clears all cached responses.
lei_cache_dir() lei_cache_clear()lei_cache_dir() lei_cache_clear()
The cache is only used when enabled with options(gleifr.cache = TRUE).
Cached responses are stored for 1 day by default, but this can be customized with
options(gleifr.cache_max_age = seconds).
lei_cache_dir() returns a single string giving the path to the cache directory.
lei_cache_clear() is called for its side effect of deleting the cached responses and returns
NULL invisibly.
## Not run: # enable caching options(gleifr.cache = TRUE) # view cache location lei_cache_dir() # clear the cache lei_cache_clear() ## End(Not run)## Not run: # enable caching options(gleifr.cache = TRUE) # view cache location lei_cache_dir() # clear the cache lei_cache_clear() ## End(Not run)
Performs a prefix-based completion against the GLEIF API, returning candidate values together
with their LEI. Useful for typeahead-style lookups. For typo-tolerant matching, see lei_fuzzy().
lei_autocomplete(q, field = c("fulltext", "owns"))lei_autocomplete(q, field = c("fulltext", "owns"))
q |
( |
field |
( |
A data.frame() with columns:
value: The matched value
lei: The Legal Entity Identifier of the matched record, or NA if none is linked
https://www.gleif.org/en/lei-data/gleif-api
lei_fuzzy() for typo-tolerant matching, lei_record_by_id() for full records.
lei_autocomplete("Appl")lei_autocomplete("Appl")
Fetches the direct or ultimate child records of a given LEI.
lei_children(id, type = c("direct", "ultimate"), limit = 200L, simplify = TRUE)lei_children(id, type = c("direct", "ultimate"), limit = 200L, simplify = TRUE)
id |
( |
type |
( |
limit |
( |
simplify |
( |
When simplify = TRUE, a long-format data.frame() with columns:
lei: The Legal Entity Identifier
name: The attribute name
value: The attribute value
When simplify = FALSE, a named list() containing the raw API response.
lei_parent() to fetch the parent record of a LEI.
# get direct children head(lei_children("O2RNE8IBXP4R0TD8PU41", limit = 5)) # get ultimate children head(lei_children("O2RNE8IBXP4R0TD8PU41", type = "ultimate", limit = 5))# get direct children head(lei_children("O2RNE8IBXP4R0TD8PU41", limit = 5)) # get ultimate children head(lei_children("O2RNE8IBXP4R0TD8PU41", type = "ultimate", limit = 5))
Fetches the list of countries (ISO 3166-1) recognized by the GLEIF API.
lei_countries()lei_countries()
A data.frame() with columns:
code: The country code
name: The country name
head(lei_countries())head(lei_countries())
Performs a typo-tolerant, approximate search against the GLEIF API. Unlike the filters in
lei_records(), which match literal substrings, this matches on edit distance and returns
candidate values together with their LEI. Useful for resolving messy or misspelled entity names
to a LEI, which can then be passed to lei_record_by_id().
lei_fuzzy(q, field = c("fulltext", "entity.legalName", "owns", "ownedBy"))lei_fuzzy(q, field = c("fulltext", "entity.legalName", "owns", "ownedBy"))
q |
( |
field |
( |
A data.frame() with columns:
value: The matched value
lei: The Legal Entity Identifier of the matched record, or NA if none is linked
https://www.gleif.org/en/lei-data/gleif-api
lei_autocomplete() for prefix-based completion, lei_record_by_id() for full records.
lei_fuzzy("Deutsch Bank", field = "entity.legalName")lei_fuzzy("Deutsch Bank", field = "entity.legalName")
Fetches the ISINs associated with a given LEI.
lei_isins(id, limit = 200L)lei_isins(id, limit = 200L)
id |
( |
limit |
( |
A data.frame() with columns:
lei: The Legal Entity Identifier
isin: The ISIN
head(lei_isins("529900W18LQJJN6SJ336", limit = 10))head(lei_isins("529900W18LQJJN6SJ336", limit = 10))
Fetches the list of LEI issuers (Local Operating Units) from the GLEIF API.
lei_issuers()lei_issuers()
A data.frame() with columns:
lei: The Legal Entity Identifier of the issuer
name: The issuer name
marketing_name: The marketing name
website: The issuer website
accreditation_date: The accreditation date
head(lei_issuers())head(lei_issuers())
Fetches the list of jurisdictions (countries and their subdivisions) recognized by the GLEIF API.
lei_jurisdictions()lei_jurisdictions()
A data.frame() with columns:
code: The jurisdiction code
name: The jurisdiction name
head(lei_jurisdictions())head(lei_jurisdictions())
Fetches the list of entity legal forms (ELF codes) recognized by the GLEIF API. These resolve the
legal form codes that appear in lei_record_by_id() output to human-readable names.
lei_legal_forms()lei_legal_forms()
A data.frame() with columns:
code: The entity legal form (ELF) code
country: The country the legal form applies to
country_code: The country code
status: The status of the legal form, e.g. "ACTV"
name: The local name of the legal form
language: The language of the name
head(lei_legal_forms())head(lei_legal_forms())
Download the latest Legal Entity Identifier (LEI) mapping data from the Global Legal Entity Identifier Foundation (GLEIF).
lei_mapping(type = c("isin", "bic", "mic", "oc"))lei_mapping(type = c("isin", "bic", "mic", "oc"))
type |
( |
A data.frame() with the lei and the corresponding mapping.
https://www.gleif.org/en/lei-data/lei-mapping
head(lei_mapping("isin"))head(lei_mapping("isin"))
Fetches the field-level modification history of a given LEI, i.e. an audit log of every recorded
change to the entity (recordType "LEI") and its relationships (recordType "RR").
lei_modifications(id, limit = 200L)lei_modifications(id, limit = 200L)
id |
( |
limit |
( |
A data.frame() with columns:
lei: The Legal Entity Identifier
record_type: The record the change applies to, "LEI" or "RR"
modification_type: The type of change, e.g. "UPDATE"
field: The path of the changed field
date: The date of the change
value_old: The previous value, or NA if none
value_new: The new value, or NA if none
https://www.gleif.org/en/lei-data/gleif-api
head(lei_modifications("529900W18LQJJN6SJ336", limit = 10))head(lei_modifications("529900W18LQJJN6SJ336", limit = 10))
Fetches the direct or ultimate parent record of a given LEI.
lei_parent(id, type = c("direct", "ultimate"), simplify = TRUE)lei_parent(id, type = c("direct", "ultimate"), simplify = TRUE)
id |
( |
type |
( |
simplify |
( |
When simplify = TRUE, a long-format data.frame() with columns:
lei: The Legal Entity Identifier
name: The attribute name
value: The attribute value
When simplify = FALSE, a named list() containing the raw API response.
lei_children() to fetch the child records of a LEI.
# get direct parent head(lei_parent("529900W18LQJJN6SJ336")) # get ultimate parent head(lei_parent("529900W18LQJJN6SJ336", type = "ultimate"))# get direct parent head(lei_parent("529900W18LQJJN6SJ336")) # get ultimate parent head(lei_parent("529900W18LQJJN6SJ336", type = "ultimate"))
Fetch a single LEI record by its Legal Entity Identifier. To fetch records by attribute filters,
see lei_records().
lei_record_by_id(id, simplify = TRUE)lei_record_by_id(id, simplify = TRUE)
id |
( |
simplify |
( |
When simplify = TRUE, a long-format data.frame() with columns:
lei: The Legal Entity Identifier
name: The attribute name
value: The attribute value
When simplify = FALSE, a named list() containing the raw API response.
lei_records() to fetch records by attribute filters.
# get simplified long-format data.frame head(lei_record_by_id("529900W18LQJJN6SJ336")) # get raw API response as named list str(lei_record_by_id("529900W18LQJJN6SJ336", simplify = FALSE), max.level = 2)# get simplified long-format data.frame head(lei_record_by_id("529900W18LQJJN6SJ336")) # get raw API response as named list str(lei_record_by_id("529900W18LQJJN6SJ336", simplify = FALSE), max.level = 2)
Fetch LEI records from the GLEIF database, optionally filtered by attribute. The filters are
combined with logical AND, so each one you supply narrows the results further. To fetch a single
record by its LEI, see lei_record_by_id().
lei_records( legal_name = NULL, fulltext = NULL, country = NULL, jurisdiction = NULL, registration_status = NULL, entity_status = NULL, category = NULL, isin = NULL, ..., limit = 200L, simplify = TRUE )lei_records( legal_name = NULL, fulltext = NULL, country = NULL, jurisdiction = NULL, registration_status = NULL, entity_status = NULL, category = NULL, isin = NULL, ..., limit = 200L, simplify = TRUE )
legal_name |
( |
fulltext |
( |
country |
( |
jurisdiction |
( |
registration_status |
( |
entity_status |
( |
category |
( |
isin |
( |
... |
Additional filter parameters passed to the GLEIF API.
These are appended as query parameters, e.g.
|
limit |
( |
simplify |
( |
When simplify = TRUE, a long-format data.frame() with columns:
lei: The Legal Entity Identifier
name: The attribute name
value: The attribute value
When simplify = FALSE, a list() of the raw record objects from the API.
lei_record_by_id() to fetch a single record by its LEI.
# search by legal name head(lei_records(legal_name = "Deutsche Bank", limit = 5)) # filter by country and registration status head(lei_records(country = "DE", registration_status = "ISSUED", limit = 5))# search by legal name head(lei_records(legal_name = "Deutsche Bank", limit = 5)) # filter by country and registration status head(lei_records(country = "DE", registration_status = "ISSUED", limit = 5))
Fetches the list of regions from the GLEIF API.
lei_regions()lei_regions()
A data.frame() with columns:
code: The region code
language: The language of the region name
name: The region name
head(lei_regions())head(lei_regions())
Fetches the list of registration authorities (RA codes) recognized by the GLEIF API. These
resolve the registration authority codes that appear in lei_record_by_id() output to the issuing
business registries.
lei_registration_authorities()lei_registration_authorities()
A data.frame() with columns:
code: The registration authority (RA) code
international_name: The international name of the authority
local_name: The local name of the authority, or NA if none
website: The authority website, or NA if none
head(lei_registration_authorities())head(lei_registration_authorities())