# LEI Lookup & Corporate Ownership Tree | GLEIF KYB API (`andok/lei-corporate-hierarchy`) Actor

Resolve company names or LEIs to verified legal-entity data from GLEIF: legal address, status, registry ID, direct and ultimate parent, subsidiaries. No API key. $0.004 per entity.

- **URL**: https://apify.com/andok/lei-corporate-hierarchy.md
- **Developed by:** [Andok](https://apify.com/andok) (community)
- **Categories:** Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 entity resolveds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## LEI Lookup & Corporate Ownership Tree — GLEIF KYB API, No API Key

Turn company names or LEI codes into verified legal-entity records from **GLEIF**, the official global Legal Entity Identifier database. For every match you get the **LEI, legal name, legal and headquarters address, entity and registration status, national registry ID, legal form, renewal date, managing LOU**, plus the **direct parent, ultimate parent** (or the official reason none is reported) and the **number of direct subsidiaries**. Optionally list the subsidiaries too.

Typical uses: **KYB / onboarding checks**, counterparty and vendor due diligence, sanctions-screening enrichment (screen the ultimate parent, not just the subsidiary), CRM and lead enrichment with corporate group data, mapping a corporate group's legal entities.

### Input

| Field | Description |
|---|---|
| `queries` | Company legal names or 20-character LEIs (mixed is fine) |
| `matchesPerQuery` | For names: number of best matches to return (default 1) |
| `includeParents` | Resolve direct and ultimate parent (default on) |
| `includeSubsidiaries` | Also output one row per direct subsidiary (default off) |
| `maxSubsidiariesPerEntity` | Cap on subsidiary rows per entity (default 50) |
| `onlyActive` | Skip lapsed/retired LEI records |

```json
{ "queries": ["Google LLC", "Siemens AG", "HWUPKR0MPOU8FGXBT394"], "includeSubsidiaries": true, "maxSubsidiariesPerEntity": 20 }
```

### Output

One dataset row per entity (`row_type: "entity"`) and, if enabled, per direct subsidiary (`row_type: "subsidiary"`, `parent_lei` set).

| Field | Description |
|---|---|
| `lei`, `legal_name`, `entity_status`, `registration_status` | Identity and status (`ACTIVE`, `ISSUED`, `LAPSED`, ...) |
| `jurisdiction`, `country`, `legal_address`, `headquarters_address` | Where it is registered and based |
| `registered_as`, `registration_authority_id`, `legal_form_code`, `entity_category` | National registry number and form |
| `direct_parent_lei/name`, `ultimate_parent_lei/name` | Ownership chain (accounting consolidation, >50%) |
| `direct_parent_exception`, `ultimate_parent_exception` | Why no parent is reported, e.g. `NO_KNOWN_PERSON`, `NATURAL_PERSONS`, `NON_CONSOLIDATING` |
| `direct_subsidiary_count` | Number of direct subsidiaries with an LEI |
| `matched_by` | `lei`, `exact_name`, `fulltext` or `direct_child` |

A free `SUMMARY` record lists unmatched queries and notes.

### Pricing

Pay per event: **$0.005 per run**, **$0.004 per matched entity** (parents and subsidiary count included), **$0.001 per subsidiary row**. Queries with no match and failed lookups are free. 100 companies cost about **$0.41**.

### Notes

- Only entities that have an LEI are covered (mostly financial institutions and larger companies). Not every company has one.
- Name search tries an exact legal-name match first, then GLEIF fuzzy full-text; review `matched_by` and use LEIs when precision matters.
- Parent data is self-reported by entities to GLEIF (Level 2 data) and may be incomplete. Not legal advice.
- Data: GLEIF public API, CC0.

# Actor input Schema

## `queries` (type: `array`):

Company legal names or 20-character LEI codes, one per line.

## `matchesPerQuery` (type: `integer`):

For name queries, how many best matches to return (1 = best match only).

## `includeParents` (type: `boolean`):

Resolve direct and ultimate parent (or the reason none is reported).

## `includeSubsidiaries` (type: `boolean`):

Also output one row per direct subsidiary (billed as subsidiary-listed). The subsidiary count is always included.

## `maxSubsidiariesPerEntity` (type: `integer`):

Cap on subsidiary rows per matched entity.

## `onlyActive` (type: `boolean`):

Skip lapsed, retired or inactive LEI records.

## Actor input object example

```json
{
  "queries": [
    "Google LLC",
    "Siemens AG",
    "HWUPKR0MPOU8FGXBT394"
  ],
  "matchesPerQuery": 1,
  "includeParents": true,
  "includeSubsidiaries": false,
  "maxSubsidiariesPerEntity": 50,
  "onlyActive": false
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `resultsCsv` (type: `string`):

No description

## `run` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "queries": [
        "Google LLC",
        "Siemens AG",
        "HWUPKR0MPOU8FGXBT394"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("andok/lei-corporate-hierarchy").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "queries": [
        "Google LLC",
        "Siemens AG",
        "HWUPKR0MPOU8FGXBT394",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("andok/lei-corporate-hierarchy").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "queries": [
    "Google LLC",
    "Siemens AG",
    "HWUPKR0MPOU8FGXBT394"
  ]
}' |
apify call andok/lei-corporate-hierarchy --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,andok/lei-corporate-hierarchy"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/jmu3qQ9e0IIkJpkc2/builds/ab0bj3Qf95GXv1Wof/openapi.json
