# LEI Lookup API: Legal Entity Identifiers & Company Ownership (`yourevenings/lei-company-lookup`) Actor

LEI lookup and LEI search API for the GLEIF Global LEI Index: legal entity identifier records with legal name, register number, addresses, LEI status and renewal date, BICs, and direct and ultimate parent companies. Find subsidiaries. Monitor mode for changes. No API key.

- **URL**: https://apify.com/yourevenings/lei-company-lookup.md
- **Developed by:** [Your Evenings](https://apify.com/yourevenings) (community)
- **Categories:** Lead generation, Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.40 / 1,000 lei record returneds

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

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 API: Legal Entity Identifiers & Company Ownership

![LEI Lookup and Company Ownership API](https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/3aJAAcuntBUjxtHMh-actor-RSmkImQs8twH4ThYo-76CDAwexVG-lei-lookup-512.png)

**LEI Lookup & Company Ownership API** returns Legal Entity Identifier (LEI) records from the public Global LEI Index as clean JSON rows, with **no API key needed**. Each record has the legal name, legal form, business-register number, legal and headquarters addresses, LEI status and renewal date, BICs, and the direct and ultimate parent companies. Three modes:

- **Look up LEIs**: the records for up to 500 LEIs you list.
- **Search**: find records by name, country, city, legal form, register number, LEI status, the date the LEI was first issued, the renewal date or the last update.
- **Subsidiaries**: the entities that report an LEI as their direct or ultimate parent.

Turn on **monitor mode** and schedule the Actor to get only records that are new or have changed since the last run, for example a lapsed LEI, a name change or a new parent.

Use it as an **LEI lookup** and **LEI search** API: look up any **legal entity identifier**, find a company's **parent company** and **ultimate parent company**, and keep **counterparty data** for **KYC** checks up to date with monitor mode. Export rows as CSV, JSON or Excel.

> **Not affiliated with GLEIF.** This Actor is independent and is not affiliated with, endorsed by or sponsored by the Global Legal Entity Identifier Foundation (GLEIF). It uses the public GLEIF API. LEI data is published by GLEIF under the CC0 licence; the data is supplied by the LEI issuing organisations and the entities themselves.

### Why use this LEI lookup API?

- **The global LEI data, no key.** Rows come straight from the public GLEIF API, which publishes the Global LEI Index.
- **Ownership in the same row.** The direct and ultimate parent LEI and name are added to each record, or the reported reason there is none (for example `NO_KNOWN_PERSON` or `NATURAL_PERSONS`).
- **Legal entities only.** Sole-proprietor records (individuals) and records whose legal form is a trust are skipped and never charged; the run says how many of each were skipped.
- **Filters are applied before you're charged.** You pay only for records that match. Status rows (invalid LEI, not found, no matches and so on) are free.
- **LEIs are checked first.** Each LEI's check digits are validated before any request, and invalid ones get a free status row.
- **Polite to the source.** Requests are paced to stay within the GLEIF API's published rate limit and are retried after rate-limit or server errors.

### How do I look up an LEI? Quick start

Press **Start** with the prefilled input, or paste this into the **JSON** view of the Input tab. It looks up two LEIs.

```json
{
  "mode": "lookup",
  "leis": ["7LTWFZYICNSX8D621K86", "529900YDAG61JYILJZ53"],
  "maxResults": 25
}
```

In our test run on 30 October 2026 it returned 2 records: Deutsche Bank AG (no parent reported, reason `NO_KNOWN_PERSON`) and the South African company Siemens (formerly Siemens Proprietary Limited), with Siemens AG as its direct and ultimate parent.

Companies in Great Britain that got their first LEI in the last 7 days:

```json
{
  "mode": "search",
  "countries": ["GB"],
  "registeredWithinDays": 7,
  "includeParents": false,
  "maxResults": 100
}
```

Direct subsidiaries of Deutsche Bank AG:

```json
{
  "mode": "subsidiaries",
  "parentLei": "7LTWFZYICNSX8D621K86",
  "childLevel": "direct",
  "maxResults": 50
}
```

Active Irish LEIs due for renewal in the next 30 days:

```json
{
  "mode": "search",
  "countries": ["IE"],
  "registrationStatuses": ["ISSUED"],
  "renewalDueWithinDays": 30,
  "maxResults": 100
}
```

### Who it's for

- **KYC, onboarding and compliance teams** checking a counterparty's legal name, register number, status and parent company.
- **Finance and data teams** mapping LEIs to legal names, BICs and group structures in spreadsheets, databases or AI agents.
- **LEI service providers and B2B sales teams** finding newly registered entities or LEIs that are about to lapse.

### What can I do with LEI data?

1. **Counterparty check.** Look up a list of LEIs and get status, renewal date, register number and parents in one table.
2. **Group structure.** List every direct or ultimate subsidiary of a parent LEI.
3. **Lapse watch.** Monitor a watch list of LEIs daily and get a row only when a record changes, for example when it lapses or a parent changes.
4. **New entities.** Entities in a country that got their first LEI in the last N days.

### What does an LEI record look like?

The 2 rows from the Quick start input (run on 30 October 2026), shortened:

| LEI | Legal name | Register number | City | LEI status | Next renewal | Ultimate parent |
|---|---|---|---|---|---|---|
| 7LTWFZYICNSX8D621K86 | DEUTSCHE BANK AKTIENGESELLSCHAFT | HRB 30000 | Frankfurt am Main | ISSUED | 2027-06-02 | none reported (`NO_KNOWN_PERSON`) |
| 529900YDAG61JYILJZ53 | Siemens | 1923/007514/07 | Midrand | ISSUED | 2027-03-16 | Siemens Aktiengesellschaft |

### Input: how do I look up, search or list subsidiaries?

Only `mode` is required. Each field below says which mode uses it.

#### Mode (`mode`)

`lookup` (default), `search` or `subsidiaries`.

#### LEIs (`leis`)

*Look up mode.* Up to 500 LEIs (20 characters). Invalid LEIs get a free status row.

#### Name (`name`)

*Search mode.* Words in the legal or other names.

#### Exact legal name (`exactName`)

*Search mode.* Match the legal name exactly instead of by words.

#### Legal address countries (`countries`)

*Search mode.* 2-letter country codes of the legal address, e.g. `GB`, `DE`, `US`.

#### Headquarters countries (`headquartersCountries`)

*Search mode.* 2-letter country codes of the headquarters address.

#### Legal address city (`city`)

*Search mode.* Legal address city, e.g. `London`.

#### LEI first issued in the last N days (`registeredWithinDays`)

*Search mode.* LEIs first issued in the last N days. 0 turns this off.

#### LEI first issued since (`registeredSince`)

*Search mode.* LEIs first issued since a date (YYYY-MM-DD). Overrides `registeredWithinDays`.

#### Renewal due within N days (`renewalDueWithinDays`)

*Search mode.* LEIs whose next renewal date is between today and N days from now. 0 turns this off.

#### Renewal due from (`renewalDueFrom`)

*Search mode.* Optional start of a renewal-date range.

#### Renewal due to (`renewalDueTo`)

*Search mode.* Optional end of a renewal-date range.

#### Record updated since (`updatedSince`)

*Search mode.* Records updated on or after a date.

#### LEI registration statuses (`registrationStatuses`)

*Search mode.* LEI statuses, e.g. `ISSUED`, `LAPSED`, `RETIRED`.

#### Entity status (`entityStatus`)

*Search mode.* `ACTIVE` or `INACTIVE`.

#### Entity category (`category`)

*Search mode.* `GENERAL`, `BRANCH`, `FUND`, `RESIDENT_GOVERNMENT_ENTITY` or `INTERNATIONAL_ORGANIZATION`.

#### Legal form codes (ISO 20275) (`legalFormCodes`)

*Search mode.* ISO 20275 legal form codes, e.g. `H0PO`.

#### Registered number (`registeredAs`)

*Search mode.* Business-register number, e.g. a Companies House number.

#### Parent LEI (`parentLei`)

*Subsidiaries mode.* The parent LEI.

#### Children (`childLevel`)

*Subsidiaries mode.* `direct` (default) or `ultimate` children.

#### Add direct and ultimate parents (`includeParents`)

All modes. Add the direct and ultimate parents. Default `true`. Uses extra requests per record, so large searches run slower.

#### Add legal form names (`includeLegalFormNames`)

All modes. Add the English name of each legal form. Default `true`.

#### Max records (`maxResults`)

All modes. Most records per run. Default 25; 0 means no limit.

#### Monitor mode (`monitorMode`)

All modes. Return only records that are new or were updated since the last run. See *How do I monitor LEIs for lapses and changes?* below.

#### Return records on the first monitor run (`emitBaselineOnFirstRun`)

Default on. See *How do I monitor LEIs for lapses and changes?* below.

#### Monitor state store name (`stateStoreName`)

Named key-value store for monitor state. Use a different name per watch list. See *How do I monitor LEIs for lapses and changes?* below.

### Output: what fields does each LEI record have?

Every row has `rowType`. An **LEI record** (`lei_record`) has `lei`, `legalName`, `otherNames`, `entityStatus`, `category`, `legalFormCode`, `legalFormName`, `jurisdiction`, `registeredAs`, `registrationAuthorityId`, `legalAddress`, `headquartersAddress`, `entityCreationDate`, `expirationDate`, `expirationReason`, `successorLei`, `successorName`, `registrationStatus`, `initialRegistrationDate`, `lastUpdateDate`, `nextRenewalDate`, `managingLou`, `corroborationLevel`, `bics`, the parent fields and `recordUrl`. Values shortened:

```json
{
  "rowType": "lei_record",
  "lei": "529900YDAG61JYILJZ53",
  "legalName": "Siemens",
  "otherNames": [{ "name": "Siemens Proprietary Limited", "type": "PREVIOUS_LEGAL_NAME" }],
  "entityStatus": "ACTIVE",
  "legalFormCode": "GQVQ",
  "legalFormName": "Private Company",
  "jurisdiction": "ZA",
  "registeredAs": "1923/007514/07",
  "legalAddress": { "addressLines": ["300, Janadel Avenue"], "city": "Midrand", "region": "ZA-GP", "postalCode": "1685", "country": "ZA" },
  "entityCreationDate": "1923-05-15",
  "registrationStatus": "ISSUED",
  "initialRegistrationDate": "2022-03-16",
  "nextRenewalDate": "2027-03-16",
  "directParentLei": "W38RGI023J3WT1HWRP32",
  "directParentName": "Siemens Aktiengesellschaft",
  "ultimateParentLei": "W38RGI023J3WT1HWRP32",
  "ultimateParentName": "Siemens Aktiengesellschaft",
  "recordUrl": "https://search.gleif.org/#/record/529900YDAG61JYILJZ53",
  "dataSource": "GLEIF API (Global LEI Index, CC0)",
  "licence": "CC0 1.0 Universal (GLEIF LEI data)",
  "attribution": "Contains LEI data from the Global Legal Entity Identifier Foundation (GLEIF), available under CC0 1.0. Not provided, endorsed or authorized by GLEIF."
}
```

In Subsidiaries mode, rows also have `childOfLei`, `childOfName` and `childLevel`.

**Status** rows (`status`, free): `invalid_lei`, `not_found`, `skipped_individual`, `skipped_individuals`, `skipped_trust`, `skipped_trusts`, `scan_limit`, `no_matches`, `source_error` or `budget_reached`, each with a plain-English `message`.

The **SUMMARY** record in the default key-value store lists the filters used, how many records matched and were returned, skipped sole proprietors and trusts, request counts and the run time. The dataset has views for Overview, Ownership and Status rows.

### How do I monitor LEIs for lapses and changes?

Set `monitorMode` to `true` and schedule a saved task. The Actor remembers each record's last update date in the named key-value store `stateStoreName`, and returns only records it hasn't returned before (`changeType: "new"`) or whose LEI data has been updated since (`changeType: "updated"`, with `previousLastUpdateDate`).

- `emitBaselineOnFirstRun` (default `true`) returns current matches on the first run. Set it to `false` to remember them silently, without charge, and get only later changes.
- Use a different `stateStoreName` for each separate watch list.

### Data source, licence and attribution

Every record row carries `licence`, `licenceUrl` and `attribution`. Rows are normalised by this Actor (field names, parents and legal form names added), so they are modified from the original records.

| Source | Feed | Licence or terms | Attribution (in every row's `attribution`) |
|---|---|---|---|
| GLEIF Global LEI Index | [GLEIF API](https://www.gleif.org/en/lei-data/gleif-api) (LEI records, Level 2 parent relationships and reporting exceptions, ISO 20275 legal form list) | [CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/), under the [GLEIF LEI Data Terms of Use](https://www.gleif.org/en/meta/lei-data-terms-of-use) | Contains LEI data from the Global Legal Entity Identifier Foundation (GLEIF), available under CC0 1.0. Not provided, endorsed or authorized by GLEIF. |

CC0 needs no attribution, but we credit GLEIF in every row. GLEIF's terms ask that no one suggests their product is a GLEIF product or that they have a special relationship with GLEIF or an LEI issuer; keep the "Not provided, endorsed or authorized by GLEIF" wording if you republish the rows. GLEIF does not warrant that the data is accurate or complete.

### Company data only

Rows hold legal-entity data: names, legal forms, register numbers, registered and headquarters addresses, LEI status and parent companies. Records of sole proprietors (individuals) and records whose legal form is a trust are skipped, never charged, and counted in free `skipped_individual(s)` and `skipped_trust(s)` status rows. LEI records don't list directors, owners or contact details (a small company's legal name can still include a person's name, as registered); when an entity's parent is a person or a family, GLEIF shows only a reason code such as `NATURAL_PERSONS`, never the person.

### What are the limits?

- **Source:** the GLEIF API only. LEI data is supplied by the LEI issuing organisations and the entities themselves, so records can be out of date until the entity renews.
- **Lookup:** up to 500 LEIs per run, fetched 100 at a time.
- **Search and subsidiaries:** the GLEIF API pages through at most 10,000 results of one search. When a search reaches that cap, the run adds a free `scan_limit` row; narrow the filters or split the search, for example by country or date.
- **Skipped records:** outside monitor mode, a search stops after reading 1,000 records beyond `maxResults` (for example when most matches are trusts) and adds a free `scan_limit` row.
- **Monitor memory:** each record's LEI and last update date are remembered per `stateStoreName`, with no expiry, so a record is returned again only when GLEIF updates it.
- **Parents:** `includeParents` uses 2 to 4 extra requests per record (about 2 to 5 seconds at the pacing below), so a large search with parents on runs slower.
- **Pacing:** at most one request every 1.1 seconds (under the GLEIF API's limit of 60 requests a minute), with retries after rate-limit or server errors.

### How much does it cost to look up an LEI?

Pay per event:

| Event | Price |
|---|---|
| LEI record returned | $0.003 |
| Alert run with new or updated records (monitor mode only, once per run that returns at least one) | $0.01 |
| Actor start | $0.00005 |

Higher Apify plans get lower prices (shown on the Pricing tab). Status rows, the SUMMARY record and monitor runs with nothing new are free of record and alert charges. Set **Maximum cost per run** in the run options: the Actor stops before going over it and adds a free `budget_reached` row.

### Use the LEI lookup API from code, spreadsheets or an AI agent

Run it with the Apify API or client libraries, schedule it, or connect it to Make, Zapier, Google Sheets or webhooks through Apify integrations. AI agents can call it through Apify's MCP server.

The examples below look up two LEIs and set a maximum cost of $0.05 for the run, so trying them costs a few cents at most. Read your API token from an environment variable (`APIFY_TOKEN`) rather than pasting it into code.

#### JavaScript (Node.js)

```js
// npm install apify-client
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('yourevenings/lei-company-lookup').call(
  {
    "mode": "lookup",
    "leis": [
      "7LTWFZYICNSX8D621K86",
      "529900YDAG61JYILJZ53"
    ],
    "maxResults": 10
  },
  { maxTotalChargeUsd: 0.05 },
);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
## pip install "apify-client>=3"
import os
from decimal import Decimal
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("yourevenings/lei-company-lookup").call(
    run_input={
        "mode": "lookup",
        "leis": [
            "7LTWFZYICNSX8D621K86",
            "529900YDAG61JYILJZ53"
        ],
        "maxResults": 10
    },
    max_total_charge_usd=Decimal("0.05"),
)
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)
```

#### HTTP API (cURL)

```bash
curl -X POST "https://api.apify.com/v2/acts/yourevenings~lei-company-lookup/run-sync-get-dataset-items?maxTotalChargeUsd=0.05" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode": "lookup", "leis": ["7LTWFZYICNSX8D621K86", "529900YDAG61JYILJZ53"], "maxResults": 10}'
```

#### AI agents (MCP)

Add Apify's MCP server with just this Actor as a tool. On first connection your browser opens so you can sign in to Apify and approve access.

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=yourevenings/lei-company-lookup"
    }
  }
}
```

### FAQ

**What is an LEI?** A 20-character code (ISO 17442) that identifies a legal entity taking part in financial transactions. Each LEI record holds reference data about the entity and, where reported, its parent companies.

**How do I find a company's ultimate parent?** Look up its LEI, or search by name, with `includeParents` on (the default). Each record has `ultimateParentLei` and `ultimateParentName`, or the reported reason there is none in `ultimateParentException`.

**Why do some records have no parent?** Entities report their parents or a reason for not reporting one. The reason is in `directParentException` and `ultimateParentException`.

**Why are sole proprietors left out?** Their records describe individuals. This Actor returns legal-entity data only.

**Why are trusts left out?** Many trusts are set up by and named after individuals or families, so records whose legal form is a trust (for example Trust, Statutory Trust or Business Trust) are skipped and not charged. Companies that provide trust services, such as a trust company or trust bank, are still returned. A trust whose legal form is reported only as "other" without the word trust can still appear. If a search matches mostly trusts, the run stops after reading about 1,000 extra records and adds a free `scan_limit` row; narrow the filters to reach more legal entities.

**How current is the data?** Each run reads the GLEIF API at that moment; records are updated by the LEI issuing organisations.

### Feedback

Found a problem or need a field? Open an issue on the Issues tab.

# Changelog

This Actor's version history is a separate document: https://apify.com/yourevenings/lei-company-lookup/changelog.md

# Actor input Schema

## `mode` (type: `string`):

<b>Look up LEIs</b> returns the records for the LEIs you list. <b>Search</b> finds records by name, country, dates or status. <b>Subsidiaries</b> lists the entities that report a parent LEI as their direct or ultimate parent.

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

For <b>Look up LEIs</b>: up to 500 LEIs (20 characters). Invalid LEIs get a free status row.

## `name` (type: `string`):

For <b>Search</b>: words in the legal or other names (full-text). Turn on 'Exact legal name' to match the legal name exactly.

## `exactName` (type: `boolean`):

Match the legal name exactly instead of full-text.

## `countries` (type: `array`):

2-letter ISO codes, e.g. <code>GB</code>, <code>DE</code>, <code>US</code>.

## `headquartersCountries` (type: `array`):

2-letter ISO codes of the headquarters address.

## `city` (type: `string`):

Exact city name as recorded, e.g. <code>London</code>.

## `registeredWithinDays` (type: `integer`):

Only LEIs first registered in the last N days (newly registered entities). 0 turns this off.

## `registeredSince` (type: `string`):

Overrides 'first issued in the last N days'.

## `renewalDueWithinDays` (type: `integer`):

Only LEIs whose next renewal date is between today and N days from now. 0 turns this off.

## `renewalDueFrom` (type: `string`):

Optional start of a renewal-date range.

## `renewalDueTo` (type: `string`):

Optional end of a renewal-date range.

## `updatedSince` (type: `string`):

Only records whose LEI data was updated on or after this date.

## `registrationStatuses` (type: `array`):

Any of <code>ISSUED</code>, <code>LAPSED</code>, <code>PENDING_TRANSFER</code>, <code>PENDING_ARCHIVAL</code>, <code>RETIRED</code>, <code>ANNULLED</code>, <code>DUPLICATE</code>, <code>MERGED</code>, <code>TRANSFERRED</code>.

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

Whether the legal entity itself is active.

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

Sole proprietors (individuals) and trusts are never returned.

## `legalFormCodes` (type: `array`):

Entity legal form codes, e.g. <code>H0PO</code> (UK private limited company).

## `registeredAs` (type: `string`):

The entity's number in its business register, e.g. a Companies House number.

## `parentLei` (type: `string`):

For <b>Subsidiaries</b>: the parent's LEI.

## `childLevel` (type: `string`):

Direct children report this LEI as their direct parent; ultimate children report it as their ultimate parent.

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

Adds the direct and ultimate parent LEI and name (or the reason no parent is reported). Uses 2 to 4 extra API requests per record, so large searches run slower.

## `includeLegalFormNames` (type: `boolean`):

Adds the English name of each legal form code (one cached request per code).

## `maxResults` (type: `integer`):

Stop after this many records. 0 means no limit. You are charged per record returned.

## `monitorMode` (type: `boolean`):

Remember each record's last update and, on later runs, return only records that are new or were updated since. Schedule the Actor to watch LEIs for lapses, renewals, name changes or new parents.

## `emitBaselineOnFirstRun` (type: `boolean`):

Off: the first monitor run only records what exists (no rows, no charges).

## `stateStoreName` (type: `string`):

Named key-value store for monitor state. Use a different name per watch list.

## Actor input object example

```json
{
  "mode": "lookup",
  "leis": [
    "7LTWFZYICNSX8D621K86",
    "529900YDAG61JYILJZ53"
  ],
  "exactName": false,
  "registeredWithinDays": 0,
  "renewalDueWithinDays": 0,
  "entityStatus": "",
  "category": "",
  "childLevel": "direct",
  "includeParents": true,
  "includeLegalFormNames": true,
  "maxResults": 25,
  "monitorMode": false,
  "emitBaselineOnFirstRun": true,
  "stateStoreName": "lei-company-monitor"
}
```

# Actor output Schema

## `overview` (type: `string`):

Overview view of the dataset.

## `ownership` (type: `string`):

Ownership view of the dataset.

## `status` (type: `string`):

Status rows (free) view of the dataset.

## `summary` (type: `string`):

SUMMARY record: input, matches, skipped individuals and trusts, request counts and timings.

# 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 = {
    "mode": "lookup",
    "leis": [
        "7LTWFZYICNSX8D621K86",
        "529900YDAG61JYILJZ53"
    ],
    "maxResults": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("yourevenings/lei-company-lookup").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 = {
    "mode": "lookup",
    "leis": [
        "7LTWFZYICNSX8D621K86",
        "529900YDAG61JYILJZ53",
    ],
    "maxResults": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("yourevenings/lei-company-lookup").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 '{
  "mode": "lookup",
  "leis": [
    "7LTWFZYICNSX8D621K86",
    "529900YDAG61JYILJZ53"
  ],
  "maxResults": 25
}' |
apify call yourevenings/lei-company-lookup --silent --output-dataset

```

## MCP server setup

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

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/RSmkImQs8twH4ThYo/builds/wBdRwoXROpqTxecMq/openapi.json
