LEI lookup API: legal entity identifiers and parent companies in code
A Legal Entity Identifier (LEI) is a 20-character code that identifies a legal entity in financial transactions. The Global Legal Entity Identifier Foundation (GLEIF) publishes every LEI record in the Global LEI Index, with a public API that needs no key. The data is CC0.
This guide is independent and is not a GLEIF resource.
Look up an LEI and its ultimate parent in Python
import json, urllib.request
lei = "529900YDAG61JYILJZ53"
def get(path):
req = urllib.request.Request("https://api.gleif.org/api/v1/" + path,
headers={"Accept": "application/vnd.api+json"})
with urllib.request.urlopen(req, timeout=30) as r:
return json.load(r)
rec = get(f"lei-records/{lei}")["data"]["attributes"]
print(rec["entity"]["legalName"]["name"], rec["entity"]["legalAddress"]["country"],
rec["registration"]["status"], "renews", rec["registration"]["nextRenewalDate"][:10])
parent = get(f"lei-records/{lei}/ultimate-parent")["data"]["attributes"]
print("ultimate parent:", parent["entity"]["legalName"]["name"], parent["lei"])
On 31 October 2026 it printed Siemens ZA ISSUED renews 2027-03-16 and ultimate parent: Siemens Aktiengesellschaft W38RGI023J3WT1HWRP32.
Things that trip people up
- No parent is a 404. When an entity reports no parent,
/ultimate-parentreturns 404. The reason is under/ultimate-parent-reporting-exception; for Deutsche Bank AG it wasNO_KNOWN_PERSON. - Parents that are people show only a code. When the parent is a person or a family, GLEIF gives a reason code such as
NATURAL_PERSONS, never the person. - Status matters. An LEI is
ISSUEDwhile it is renewed each year. Look at the registration status and the next renewal date, because aLAPSEDLEI hasn't been renewed. - Searches stop at 10,000 results. The API pages through at most 10,000 results of one search, so split big searches by country or date.
- The rate limit is 60 requests a minute. Pace your calls.
- Check digits catch typos. The last two characters are ISO 7064 check digits, so you can reject a mistyped LEI before calling the API.
We built this
Disclosure: Your Evenings Ltd built and sells this. It's independent and isn't affiliated with, endorsed by or sponsored by the Global Legal Entity Identifier Foundation (GLEIF). The LEI Lookup API: Legal Entity Identifiers & Company Ownership on Apify Store reads the same public API. It looks up to 500 LEIs at once, searches by name, country, register number, status or renewal date, and lists an LEI's subsidiaries. Each row has the direct and ultimate parent, or the reason none is reported, plus the register number, addresses, LEI status, renewal date and BICs. It checks LEI check digits before any request and paces its calls to GLEIF's limit. In monitor mode, scheduled daily, it returns only records that are new or have changed. Rows hold company-level data only.
It costs $0.003 per LEI record returned, plus $0.01 for a monitor run that finds new or updated records (base Apify prices; higher plans pay less). Status rows, such as an invalid LEI or no matches, are free.
FAQ
Does the GLEIF API need a key? No. The GLEIF API is public, needs no key, and the LEI data is CC0.
How do I find a company's ultimate parent? Call /lei-records/{lei}/ultimate-parent. If it returns 404, the reason no parent is reported is under /ultimate-parent-reporting-exception.
What does a LAPSED LEI mean? The LEI has not been renewed by its renewal date. An ISSUED LEI is current.
Can I list a company's subsidiaries? Yes. The API lists direct and ultimate children of an LEI, and the Actor's subsidiaries mode returns them as rows.
Product names and logos belong to their owners. Your Evenings Ltd is not affiliated with or endorsed by them. LEI data from the public GLEIF API (CC0). Your Evenings Ltd is not affiliated with or endorsed by the Global Legal Entity Identifier Foundation (GLEIF).
