# GLEIF LEI Lookup & Corporate Ownership for AI Agents (`haketa/gleif-lei`) Actor

Look up Legal Entity Identifiers (LEI) and corporate ownership from GLEIF for AI agents & LLMs. Get the LEI code, legal name, address, status, legal form, jurisdiction and parent/child relationships. MCP-callable KYB, compliance & entity-resolution tool.

- **URL**: https://apify.com/haketa/gleif-lei.md
- **Developed by:** [Haketa](https://apify.com/haketa) (community)
- **Categories:** AI, Agents, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## GLEIF LEI Lookup & Corporate Ownership — for AI Agents

A **legal-entity (KYB) and ownership tool built for AI agents, LLMs and compliance workflows.** Look up **Legal Entity Identifiers (LEI)** and **corporate ownership** from the official **GLEIF** database — LEI code, legal name, address, status, legal form, jurisdiction and **parent/child relationships**. The "which company is this, and who owns it?" lookup an agent needs for KYB, due diligence and entity resolution.

Clean, structured output — one record per entity, ready for an LLM context or an agent tool response. Callable by **Claude, ChatGPT, LangChain, CrewAI, LlamaIndex and any MCP client** (every Apify actor is MCP-callable via `mcp.apify.com`).

> **🏦 Official, ownership-aware entity data.** "What's Deutsche Bank's LEI? Who is its ultimate parent? How many subsidiaries?" — the actor returns sourced, machine-readable answers.

---

### 🤖 Why this is an AI-agent tool

Know-Your-Business (KYB) and entity resolution are core agent needs. GLEIF is the global authority on legal-entity identity:

- ✅ **Authoritative LEI** — the ISO 17442 global identifier for legal entities
- ✅ **Ownership tree** — direct & ultimate parents and child counts (most tools skip this)
- ✅ **Structured & sourced** — clean fields for compliance and due diligence
- ✅ **MCP-ready** — call it from any agent framework or MCP client

---

### 📋 What this actor does

Search by name, full text, country or LEI and get, for each entity:

- ✅ **LEI code, legal name, status** and legal form
- ✅ **Legal & headquarters address**, city, country, jurisdiction
- ✅ **Registration** — status, initial date, next renewal
- ✅ **Ownership** — direct & ultimate parent (LEI + name), number of children

---

### 🚀 Quick start

1. Enter a **Search query** (e.g. `Deutsche Bank`) or a **Country** (e.g. `DE`).
2. Keep **Include ownership** on for the parent/child tree.
3. Set **Max results** and click **Start**.
4. Read the structured entities from **Storage → Dataset**.

---

### ⚙️ Input

| Field | Type | Description |
| --- | --- | --- |
| **Search query** | string | Company name or text, e.g. `Apple`, `Deutsche Bank`. |
| **Search mode** | select | `Full text` (broad, incl. addresses) or `Legal name` (precise). |
| **Country** | string | Filter by legal-address country (ISO 2-letter, e.g. US, DE, GB). |
| **LEI codes** | array | Look up specific LEIs directly. |
| **Active registrations only** | boolean | Keep only issued/active registrations. |
| **Include ownership** | boolean | Fetch direct & ultimate parent and child count. |
| **Max results** | integer | Cap on entities. `0` = no limit. |
| **Proxy** | object | Optional — GLEIF is keyless with no anti-bot. |

#### Example 1 — Companies named "Deutsche Bank" with ownership

```json
{ "query": "Deutsche Bank", "includeOwnership": true, "maxItems": 200 }
````

#### Example 2 — Active entities in Germany

```json
{ "country": "DE", "activeOnly": true, "maxItems": 500 }
```

#### Example 3 — Specific LEIs

```json
{ "leis": ["7LTWFZYICNSX8D621K86"], "includeOwnership": true }
```

***

### 📦 Output

```json
{
  "lei": "7LTWFZYICNSX8D621K86",
  "legalName": "Deutsche Bank Aktiengesellschaft",
  "entityStatus": "ACTIVE",
  "registrationStatus": "ISSUED",
  "legalForm": "6QQB",
  "category": "GENERAL",
  "jurisdiction": "DE",
  "legalAddress": "Taunusanlage 12, Frankfurt am Main, 60325, DE",
  "legalCity": "Frankfurt am Main",
  "legalCountry": "DE",
  "hqCountry": "DE",
  "initialRegistrationDate": "2012-11-27",
  "nextRenewalDate": "2026-11-26",
  "ultimateParentLei": null,
  "ultimateParentName": null,
  "directParentLei": null,
  "directParentName": null,
  "childrenCount": "412",
  "gleifUrl": "https://search.gleif.org/#/record/7LTWFZYICNSX8D621K86",
  "scrapedAt": "2026-07-04T00:00:00.000Z"
}
```

#### Output fields

| Field | Description |
| --- | --- |
| `lei` | Legal Entity Identifier (20 chars). |
| `legalName` | Registered legal name. |
| `entityStatus` / `registrationStatus` | Entity and registration status. |
| `legalForm` / `category` / `jurisdiction` | Legal form (ELF), category, jurisdiction. |
| `legalAddress` / `legalCity` / `legalCountry` | Legal address. |
| `hqAddress` / `hqCountry` | Headquarters. |
| `initialRegistrationDate` / `lastUpdateDate` / `nextRenewalDate` | Registration dates. |
| `ultimateParentLei` / `ultimateParentName` | Ultimate parent (if part of a group). |
| `directParentLei` / `directParentName` | Direct parent. |
| `childrenCount` | Number of direct children/subsidiaries. |
| `gleifUrl` | GLEIF record link. |

> **Note:** ownership fields are populated only when the entity is part of a corporate group; independent entities have no parent.

***

### 🔌 AI & integrations

- **MCP:** every Apify actor is callable from `mcp.apify.com` — add this as a tool in Claude Desktop, VS Code or any MCP client.
- **Frameworks:** LangChain (`ApifyActorsTool`), LlamaIndex, CrewAI, Vercel AI SDK, n8n.
- **API:** run and fetch results with the Apify API or JS / Python clients.

***

### 💡 Use cases

| Use case | How it helps |
| --- | --- |
| **KYB / onboarding** | Verify a legal entity and its LEI in seconds. |
| **AML / compliance** | Resolve ownership trees for due diligence. |
| **Entity resolution** | Map company names to a global identifier. |
| **Supplier / counterparty risk** | Check status, jurisdiction and parentage. |

***

### ❓ FAQ

**Do I need an API key?**
No — GLEIF is keyless and open.

**What is an LEI?**
A 20-character ISO 17442 identifier for a legally distinct entity, issued globally under GLEIF.

**Why are ownership fields sometimes empty?**
Only entities that are part of a corporate group have parents; independent entities don't.

**Can an AI agent call this directly?**
Yes — it's designed as a tool-call source and is MCP-callable via Apify.

***

### ⚖️ Legal & responsible use

This actor uses the public GLEIF API. LEI data is published under CC0. Respect the API's rate limits and use the data for lawful purposes such as KYB, compliance and research.

***

### 🛟 Support

Need an extra field or relationship? Open a ticket from the actor's **Issues** tab.

Happy resolving! 🏦

# Actor input Schema

## `query` (type: `string`):

Company name or text to search, e.g. "Apple", "Deutsche Bank". Matches legal entity names (and addresses in fulltext mode).

## `searchField` (type: `string`):

How to match the query. "Legal name" is precise; "Full text" is broader (also matches addresses).

## `country` (type: `string`):

Filter by legal-address country, 2-letter ISO code, e.g. US, DE, GB. Combine with or use instead of a query.

## `leis` (type: `array`):

Look up specific LEI codes directly, e.g. \["7LTWFZYICNSX8D621K86"].

## `activeOnly` (type: `boolean`):

Keep only LEIs with an active/issued registration status.

## `includeOwnership` (type: `boolean`):

Fetch each entity's direct & ultimate parent and count of children (corporate ownership tree). Adds lookups; slower but this is GLEIF's key value.

## `maxItems` (type: `integer`):

Maximum number of entities to return. Set 0 for no limit.

## `proxyConfiguration` (type: `object`):

Apify Proxy settings. GLEIF is keyless with no anti-bot, so a proxy is OFF by default.

## Actor input object example

```json
{
  "query": "Deutsche Bank",
  "searchField": "fulltext",
  "leis": [],
  "activeOnly": false,
  "includeOwnership": true,
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `lei` (type: `string`):

Legal Entity Identifier (20 chars)

## `legalName` (type: `string`):

Registered legal name

## `entityStatus` (type: `string`):

ACTIVE / INACTIVE

## `registrationStatus` (type: `string`):

ISSUED / LAPSED / ...

## `legalForm` (type: `string`):

Legal form code (ELF)

## `category` (type: `string`):

Entity category

## `jurisdiction` (type: `string`):

Registration jurisdiction

## `legalAddress` (type: `string`):

Full legal address

## `legalCity` (type: `string`):

Legal address city

## `legalCountry` (type: `string`):

Legal address country

## `hqAddress` (type: `string`):

Headquarters address

## `hqCountry` (type: `string`):

Headquarters country

## `initialRegistrationDate` (type: `string`):

Initial registration date

## `lastUpdateDate` (type: `string`):

Last update date

## `nextRenewalDate` (type: `string`):

Next renewal date

## `ultimateParentLei` (type: `string`):

Ultimate parent LEI

## `ultimateParentName` (type: `string`):

Ultimate parent name

## `directParentLei` (type: `string`):

Direct parent LEI

## `directParentName` (type: `string`):

Direct parent name

## `childrenCount` (type: `string`):

Number of direct children

## `gleifUrl` (type: `string`):

GLEIF record URL

## `scrapedAt` (type: `string`):

Extraction timestamp

# 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 = {
    "query": "Deutsche Bank",
    "leis": [],
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("haketa/gleif-lei").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 = {
    "query": "Deutsche Bank",
    "leis": [],
    "maxItems": 100,
}

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

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

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

```

## CLI example

```bash
echo '{
  "query": "Deutsche Bank",
  "leis": [],
  "maxItems": 100
}' |
apify call haketa/gleif-lei --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=haketa/gleif-lei",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "GLEIF LEI Lookup & Corporate Ownership for AI Agents",
        "description": "Look up Legal Entity Identifiers (LEI) and corporate ownership from GLEIF for AI agents & LLMs. Get the LEI code, legal name, address, status, legal form, jurisdiction and parent/child relationships. MCP-callable KYB, compliance & entity-resolution tool.",
        "version": "0.1",
        "x-build-id": "ndp5CgWaBp2kMnolo"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/haketa~gleif-lei/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-haketa-gleif-lei",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/haketa~gleif-lei/runs": {
            "post": {
                "operationId": "runs-sync-haketa-gleif-lei",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/haketa~gleif-lei/run-sync": {
            "post": {
                "operationId": "run-sync-haketa-gleif-lei",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "query": {
                        "title": "Search query",
                        "type": "string",
                        "description": "Company name or text to search, e.g. \"Apple\", \"Deutsche Bank\". Matches legal entity names (and addresses in fulltext mode)."
                    },
                    "searchField": {
                        "title": "Search mode",
                        "enum": [
                            "fulltext",
                            "legalName"
                        ],
                        "type": "string",
                        "description": "How to match the query. \"Legal name\" is precise; \"Full text\" is broader (also matches addresses).",
                        "default": "fulltext"
                    },
                    "country": {
                        "title": "Country (optional)",
                        "type": "string",
                        "description": "Filter by legal-address country, 2-letter ISO code, e.g. US, DE, GB. Combine with or use instead of a query."
                    },
                    "leis": {
                        "title": "LEI codes (optional)",
                        "type": "array",
                        "description": "Look up specific LEI codes directly, e.g. [\"7LTWFZYICNSX8D621K86\"].",
                        "items": {
                            "type": "string"
                        }
                    },
                    "activeOnly": {
                        "title": "Active registrations only",
                        "type": "boolean",
                        "description": "Keep only LEIs with an active/issued registration status.",
                        "default": false
                    },
                    "includeOwnership": {
                        "title": "Include ownership",
                        "type": "boolean",
                        "description": "Fetch each entity's direct & ultimate parent and count of children (corporate ownership tree). Adds lookups; slower but this is GLEIF's key value.",
                        "default": true
                    },
                    "maxItems": {
                        "title": "Max results",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum number of entities to return. Set 0 for no limit.",
                        "default": 100
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify Proxy settings. GLEIF is keyless with no anti-bot, so a proxy is OFF by default.",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
