DEV Community

Your Evenings Data
Your Evenings Data

Posted on

Find a company's subsidiaries from LEI data with Python (no API key)

If you do KYC or counterparty work you end up asking "which entities report this company as their parent?" The Global LEI Index answers that, it's free, and it needs no key. This post shows the raw API first, then a shortcut.

1. The raw GLEIF API

Every LEI record has relationship links. Direct children of Deutsche Bank AG (LEI 7LTWFZYICNSX8D621K86):

curl -sg "https://api.gleif.org/api/v1/lei-records/7LTWFZYICNSX8D621K86/direct-children?page[size]=10" \
  | jq -r '.data[] | [.id, .attributes.entity.legalName.name, .attributes.entity.jurisdiction] | @tsv'
Enter fullscreen mode Exit fullscreen mode

Things to know:

  • Results are paged; follow links.next until it's gone. (The -g flag stops curl treating the square brackets in page[size] as a pattern.)
  • Use ultimate-children for the whole group, not just one level.
  • Parent info can be missing for a reason: a record may carry a reporting exception such as NO_KNOWN_PERSON or NATURAL_PERSONS instead of a parent. Keep that reason; "no parent" and "parent not reported" are different answers.
  • Check digits: an LEI is 20 characters with ISO 17442 (mod 97) check digits, so validate before calling.
  • The data is CC0, which makes it easy to store.

2. Doing it in Python

import requests

def children(lei, level="direct-children"):
    url = f"https://api.gleif.org/api/v1/lei-records/{lei}/{level}?page[size]=100"
    while url:
        r = requests.get(url, timeout=30)
        r.raise_for_status()
        j = r.json()
        for rec in j["data"]:
            e = rec["attributes"]["entity"]
            yield rec["id"], e["legalName"]["name"], e["jurisdiction"]
        url = j.get("links", {}).get("next")

for row in children("7LTWFZYICNSX8D621K86"):
    print(*row, sep="\t")
Enter fullscreen mode Exit fullscreen mode

3. What a real run looked like

We ran the same question on 31 October 2026 and took the first 10 direct subsidiaries (newest first). A few of them:

LEI Legal name Jurisdiction First LEI
9598005PGS3B6FWRJ071 FAIRFIELD INVEST SL ES 2026-04-17
529900BXMRWF4BF5M980 GAHL HOLDINGS LLC US-DE 2025-09-18
529900T45ZLIP8J4FH25 DB Advisory Services S.A.S. CO 2024-08-22
5299007H1EFZEWKADW16 SGI SLP Feeder SCSp LU 2024-07-11

Each row also had the legal form, register number, addresses, renewal date and the ultimate parent, so you can sort by nextRenewalDate to see which LEIs lapse first.

4. The shortcut (we built this)

We built an Apify Actor, LEI Lookup & Company Ownership API, that wraps the steps above: lookup, search and subsidiaries modes, check-digit validation before any request, parent LEI and name (or the exception reason) in every row, and a monitor mode for scheduled runs that returns only new or changed records. It is independent and not affiliated with GLEIF.

curl -s -X POST "https://api.apify.com/v2/acts/yourevenings~lei-company-lookup/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"mode":"subsidiaries","parentLei":"7LTWFZYICNSX8D621K86","childLevel":"direct","maxResults":10}'
Enter fullscreen mode Exit fullscreen mode

It's pay per event: base price $0.003 per LEI record returned, plus $0.00005 per run per GB of memory for the Actor start (one event at the default 256 MB) and $0.01 per monitor run that returns new or changed records. Higher Apify plans pay less. Status rows are free. The code in section 2 is all you need if you'd rather run it yourself.

LEI Lookup & Company Ownership API on Apify

Your Evenings

Top comments (0)