# Corporate hierarchy: direct and ultimate parent by LEI

**Use case:** 

For each LEI, return the direct and ultimate accounting-consolidating parent reported to GLEIF, or the reason none is reported. Example: three Siemens group subsidiaries in the US, Malaysia and Germany.

## Input

```json
{
  "leis": [
    "529900E4SCUF263AXA86",
    "5299005SCD5ZIME65422",
    "529900T3CXYPCIUFE011"
  ],
  "names": [],
  "bics": [],
  "isins": [],
  "nameMatching": "exact_then_similar",
  "maxCandidatesPerName": 3,
  "preferPrimaryRecord": true,
  "entityStatus": "ANY",
  "includeDirectParent": true,
  "includeUltimateParent": true,
  "includeDirectChildren": false,
  "includeUltimateChildren": false,
  "maxChildrenPerEntity": 100,
  "maxRequestsPerMinute": 50,
  "includeRawRecord": false
}
```

## Output

```json
{
  "lei": {
    "label": "LEI",
    "format": "string"
  },
  "legalName": {
    "label": "Legal name",
    "format": "string"
  },
  "directParentLei": {
    "label": "Direct parent LEI",
    "format": "string"
  },
  "directParentName": {
    "label": "Direct parent",
    "format": "string"
  },
  "ultimateParentLei": {
    "label": "Ultimate parent LEI",
    "format": "string"
  },
  "ultimateParentName": {
    "label": "Ultimate parent",
    "format": "string"
  },
  "directChildrenTotal": {
    "label": "Direct children",
    "format": "integer"
  },
  "ultimateChildrenTotal": {
    "label": "Ultimate children",
    "format": "integer"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The LEI Lookup & GLEIF API: Batch LEI, Name, BIC & ISIN Search Actor is ready to run with the inputs already set for "Corporate hierarchy: direct and ultimate parent by LEI". [Sign up or log in](https://console.apify.com/create-task-from-example/j9zRsy4RPrPtRgnKc) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Corporate hierarchy: direct and ultimate parent by LEI" task

The LEI Lookup & GLEIF API: Batch LEI, Name, BIC & ISIN Search Actor will start running based on the input automatically. You can also change all the input fields, like LEIs, company names, and more, to match your specific use case.

### 3. Receive the "Corporate hierarchy: direct and ultimate parent by LEI" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as LEI, legal name, direct parent lei, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Corporate hierarchy: direct and ultimate parent by LEI" task via API](https://apify.com/clearpath-data/lei-lookup.md).

## About this Actor

This example demonstrates how to use [LEI Lookup & GLEIF API: Batch LEI, Name, BIC & ISIN Search](https://apify.com/clearpath-data/lei-lookup.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/clearpath-data/lei-lookup.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/clearpath-data/lei-lookup.md

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`).
