| Title: | Client for the 'GLEIF' API |
| Version: | 0.1.0 |
| 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. |
| License: | MIT + file LICENSE |
| URL: | https://m-muecke.github.io/gleifr/, https://github.com/m-muecke/gleifr |
| BugReports: | https://github.com/m-muecke/gleifr/issues |
| Depends: | R (≥ 4.1.0) |
| Imports: | curl, httr2, rvest, stats, utils |
| Suggests: | testthat (≥ 3.0.0) |
| Config/roxygen2/markdown: | TRUE |
| Config/roxygen2/version: | 8.0.0 |
| Config/testthat/edition: | 3 |
| Encoding: | UTF-8 |
| NeedsCompilation: | no |
| Packaged: | 2026-06-15 13:51:00 UTC; mmuecke |
| Author: | Maximilian Mücke |
| Maintainer: | Maximilian Mücke <muecke.maximilian@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-06-20 14:00:07 UTC |
gleifr: 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.
Author(s)
Maintainer: Maximilian Mücke muecke.maximilian@gmail.com (ORCID)
Authors:
Maximilian Mücke muecke.maximilian@gmail.com (ORCID)
See Also
Useful links:
Report bugs at https://github.com/m-muecke/gleifr/issues
Get or manage the gleifr API cache
Description
lei_cache_dir() returns the path where cached API responses are stored.
lei_cache_clear() clears all cached responses.
Usage
lei_cache_dir()
lei_cache_clear()
Details
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).
Value
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.
Examples
## Not run:
# enable caching
options(gleifr.cache = TRUE)
# view cache location
lei_cache_dir()
# clear the cache
lei_cache_clear()
## End(Not run)
Autocomplete LEI records
Description
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().
Usage
lei_autocomplete(q, field = c("fulltext", "owns"))
Arguments
q |
( |
field |
( |
Value
A data.frame() with columns:
-
value: The matched value
-
lei: The Legal Entity Identifier of the matched record, or
NAif none is linked
Source
https://www.gleif.org/en/lei-data/gleif-api
See Also
lei_fuzzy() for typo-tolerant matching, lei_record_by_id() for full records.
Examples
lei_autocomplete("Appl")
Fetch LEI child records
Description
Fetches the direct or ultimate child records of a given LEI.
Usage
lei_children(id, type = c("direct", "ultimate"), limit = 200L, simplify = TRUE)
Arguments
id |
( |
type |
( |
limit |
( |
simplify |
( |
Value
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.
See Also
lei_parent() to fetch the parent record of a LEI.
Examples
# get direct children
head(lei_children("O2RNE8IBXP4R0TD8PU41", limit = 5))
# get ultimate children
head(lei_children("O2RNE8IBXP4R0TD8PU41", type = "ultimate", limit = 5))
Fetch the list of countries
Description
Fetches the list of countries (ISO 3166-1) recognized by the GLEIF API.
Usage
lei_countries()
Value
A data.frame() with columns:
-
code: The country code
-
name: The country name
Examples
head(lei_countries())
Fuzzy search for LEI records
Description
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().
Usage
lei_fuzzy(q, field = c("fulltext", "entity.legalName", "owns", "ownedBy"))
Arguments
q |
( |
field |
( |
Value
A data.frame() with columns:
-
value: The matched value
-
lei: The Legal Entity Identifier of the matched record, or
NAif none is linked
Source
https://www.gleif.org/en/lei-data/gleif-api
See Also
lei_autocomplete() for prefix-based completion, lei_record_by_id() for full records.
Examples
lei_fuzzy("Deutsch Bank", field = "entity.legalName")
Fetch ISINs for a LEI
Description
Fetches the ISINs associated with a given LEI.
Usage
lei_isins(id, limit = 200L)
Arguments
id |
( |
limit |
( |
Value
A data.frame() with columns:
-
lei: The Legal Entity Identifier
-
isin: The ISIN
Examples
head(lei_isins("529900W18LQJJN6SJ336", limit = 10))
Fetch LEI issuers
Description
Fetches the list of LEI issuers (Local Operating Units) from the GLEIF API.
Usage
lei_issuers()
Value
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
Examples
head(lei_issuers())
Fetch the list of jurisdictions
Description
Fetches the list of jurisdictions (countries and their subdivisions) recognized by the GLEIF API.
Usage
lei_jurisdictions()
Value
A data.frame() with columns:
-
code: The jurisdiction code
-
name: The jurisdiction name
Examples
head(lei_jurisdictions())
Fetch the list of entity legal forms
Description
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.
Usage
lei_legal_forms()
Value
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
Examples
head(lei_legal_forms())
Download the latest LEI mapping data
Description
Download the latest Legal Entity Identifier (LEI) mapping data from the Global Legal Entity Identifier Foundation (GLEIF).
Usage
lei_mapping(type = c("isin", "bic", "mic", "oc"))
Arguments
type |
( |
Value
A data.frame() with the lei and the corresponding mapping.
Source
https://www.gleif.org/en/lei-data/lei-mapping
Examples
head(lei_mapping("isin"))
Fetch the change history of a LEI record
Description
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").
Usage
lei_modifications(id, limit = 200L)
Arguments
id |
( |
limit |
( |
Value
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
NAif none -
value_new: The new value, or
NAif none
Source
https://www.gleif.org/en/lei-data/gleif-api
Examples
head(lei_modifications("529900W18LQJJN6SJ336", limit = 10))
Fetch a LEI parent record
Description
Fetches the direct or ultimate parent record of a given LEI.
Usage
lei_parent(id, type = c("direct", "ultimate"), simplify = TRUE)
Arguments
id |
( |
type |
( |
simplify |
( |
Value
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.
See Also
lei_children() to fetch the child records of a LEI.
Examples
# get direct parent
head(lei_parent("529900W18LQJJN6SJ336"))
# get ultimate parent
head(lei_parent("529900W18LQJJN6SJ336", type = "ultimate"))
Fetch a LEI record
Description
Fetch a single LEI record by its Legal Entity Identifier. To fetch records by attribute filters,
see lei_records().
Usage
lei_record_by_id(id, simplify = TRUE)
Arguments
id |
( |
simplify |
( |
Value
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.
See Also
lei_records() to fetch records by attribute filters.
Examples
# 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
Description
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().
Usage
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
)
Arguments
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 |
( |
Value
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.
See Also
lei_record_by_id() to fetch a single record by its LEI.
Examples
# 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))
Fetch LEI regions
Description
Fetches the list of regions from the GLEIF API.
Usage
lei_regions()
Value
A data.frame() with columns:
-
code: The region code
-
language: The language of the region name
-
name: The region name
Examples
head(lei_regions())
Fetch the list of registration authorities
Description
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.
Usage
lei_registration_authorities()
Value
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
NAif none -
website: The authority website, or
NAif none
Examples
head(lei_registration_authorities())