# Gleif Lei Company Lookup (`b2b_lead_generation/gleif-lei-company-lookup`) Actor

Look up legal entity identifiers, company statuses, and corporate details instantly. Search by legal name, exact code, or fuzzy query to export clean records into JSON, CSV, or Excel.

- **URL**: https://apify.com/b2b_lead_generation/gleif-lei-company-lookup.md
- **Developed by:** [B2B Lead Generation](https://apify.com/b2b_lead_generation) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

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

### GLEIF LEI Company Lookup

Search the global registry for Legal Entity Identifiers (LEIs) by legal name, exact code, or fuzzy matching. This tool helps you pull structured corporate records directly into an Apify dataset for export as JSON, CSV, or Excel.

### What You Can Do

- **Vendor Checks**: Look up the LEI behind a corporate name before onboarding a new supplier or partner.
- **KYC Lists**: Transform a spreadsheet of company names into verifiable identifiers to join with other financial feeds.
- **Exact LEI Lookup**: Quickly confirm entity status, jurisdiction, and renewal dates for codes you already have.
- **Name Cleanup**: Use fuzzy search when you only have a partial or approximate legal name.
- **Research & Export**: Download structured company files without writing custom client scripts.

### Search Modes

- **Search by Legal Name**: Find companies matching a specific business name. You can also narrow results by country and active entity status.
- **LEI Lookup**: Retrieve precise records using an exact LEI code.
- **Fuzzy Search**: Find approximate name matches and retrieve corresponding records.

### Input Parameters

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `mode` | string | `search_name` | Choose between legal name search, exact LEI lookup, or fuzzy name search. |
| `names` | array | `["Apple Inc."]` | Legal names or fuzzy query strings, one per line. |
| `leis` | array | `["HWUPKR0MPOU8FGXBT394"]` | Exact LEI codes for direct lookup. |
| `country` | string | empty | Optional country filter for legal-name searches (for example, `US`). |
| `status` | string | empty | Optional entity status filter (for example, `ACTIVE`). |
| `maxItems` | integer | `100` | Maximum number of records to save (hard cap at 1000). |
| `requestDelaySecs` | number | `1` | Pause duration between requests. |
| `timeoutSecs` | integer | `300` | Maximum overall runtime for the scraper in seconds. |
| `requestTimeoutSecs` | integer | `30` | Timeout per individual network request. |
| `userAgent` | string | `B2B Lead Generation` | Custom User-Agent string. |
| `proxyConfiguration` | object | no proxy | Optional proxy setup if required by your environment. |

#### Example Input

```json
{
  "mode": "search_name",
  "names": ["Apple Inc."],
  "country": "US",
  "status": "ACTIVE",
  "maxItems": 100,
  "requestDelaySecs": 1,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "userAgent": ""
}

```

### Output Data Fields

Each saved record includes:

- `lei`: Legal Entity Identifier code
- `legalName`: Official registered legal name
- `status`: Current entity status
- `jurisdiction`: Jurisdiction code
- `legalForm`: Legal form classification
- `registeredAs`: Local registry identification number
- `hq_city`: Headquarters city
- `hq_country`: Headquarters country
- `hq_addressLines`: Physical headquarters address lines
- `creationDate`: Entity creation date
- `registrationStatus`: Registration state
- `nextRenewalDate`: Upcoming renewal date
- `bic`: Associated BIC codes
- `scraped_at`: UTC timestamp when the record was saved

#### Example Output Record

```json
{
  "lei": "HWUPKR0MPOU8FGXBT394",
  "legalName": "Apple Inc.",
  "status": "ACTIVE",
  "jurisdiction": "US-CA",
  "legalForm": "H1UM",
  "registeredAs": "806592",
  "hq_city": "Cupertino",
  "hq_country": "US",
  "hq_addressLines": ["One Apple Park Way"],
  "creationDate": "1977-01-03T00:00:00Z",
  "registrationStatus": "ISSUED",
  "nextRenewalDate": "2027-03-08T17:27:20Z",
  "bic": ["APLEUS66XXX"],
  "scraped_at": "2026-10-12T00:00:00+00:00"
}

```

### Practical Tips

- **Handling Missing Records**: If an identifier or company name isn't found, the run logs the event cleanly and continues processing the rest of your list without crashing.
- **Exporting Datasets**: Gathered results can be downloaded instantly in JSON, CSV, or Excel formats from your Apify dashboard.
- **Deduplication**: Duplicate records encountered during a single run are automatically filtered out.

#### Trademark Notice

GLEIF LEI and related names, logos, and trademarks belong to their respective owners. Their use in this documentation is solely to identify the relevant corporate registry and does not imply affiliation, sponsorship, endorsement, or partnership.

#### Disclaimer

This actor is an independent data extraction tool created by B2B Lead Generation. All records are collected from publicly accessible corporate registers. Users are responsible for complying with relevant terms of use, operational rate limits, and attribution guidelines.

#### Is web scraping legal?

This Actor only collects publicly available data without bypassing any access controls. Scraping public data is generally legal, but how you use it matters:

- **Personal data:** If the results include personal data (for example names, emails, or profile details), laws such as the GDPR in the EU and the CCPA in California may apply. Only collect and store personal data when you have a legitimate reason.
- **Copyright:** Some content may be protected by copyright. Do not republish full copyrighted content without permission.
- **Terms of use:** Respect source terms, rate limits, and attribution requirements.
- **Legal advice:** This is general information, not legal advice. If you're unsure, consult a lawyer.

To learn more, read Apify's guide: [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

# Actor input Schema

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

Lookup mode. search_name filters lei-records by legal name. by_lei loads one record per LEI. autocomplete calls fuzzycompletions on entity.legalName, then loads each matched record.

## `names` (type: `array`):

Legal names for search_name, or query strings for autocomplete. One name per line. Ignored in by_lei mode.

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

20-character Legal Entity Identifiers for by_lei mode. One code per line. Ignored in the other modes.

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

Optional country code sent as filter\[entity.legalAddress.country] during search_name. Example: US. Leave empty to skip the filter.

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

Optional entity status sent as filter\[entity.status] during search_name. Example: ACTIVE. Leave empty to skip the filter.

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

Maximum number of LEI records to save in one run. Hard cap is 1000.

## `requestDelaySecs` (type: `number`):

Seconds to wait between GLEIF API calls. Default is 1 so runs stay polite.

## `timeoutSecs` (type: `integer`):

Stop the run after this many seconds, even if maxItems is not reached.

## `requestTimeoutSecs` (type: `integer`):

Seconds to wait for a single GLEIF HTTP response before treating it as failed.

## `userAgent` (type: `string`):

User-Agent header sent to the GLEIF API. Include an app name and a contact address.

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

Optional proxy for GLEIF requests. Default is no proxy. Enable Apify Proxy only if your IP is blocked.

## Actor input object example

```json
{
  "mode": "search_name",
  "names": [
    "Apple Inc."
  ],
  "leis": [
    "HWUPKR0MPOU8FGXBT394"
  ],
  "country": "",
  "status": "",
  "maxItems": 100,
  "requestDelaySecs": 1,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "userAgent": "",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

LEI records saved by this run.

# 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 = {
    "names": [
        "Apple Inc."
    ],
    "leis": [
        "HWUPKR0MPOU8FGXBT394"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("b2b_lead_generation/gleif-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 = {
    "names": ["Apple Inc."],
    "leis": ["HWUPKR0MPOU8FGXBT394"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("b2b_lead_generation/gleif-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 '{
  "names": [
    "Apple Inc."
  ],
  "leis": [
    "HWUPKR0MPOU8FGXBT394"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call b2b_lead_generation/gleif-lei-company-lookup --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,b2b_lead_generation/gleif-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/GkXLdSPf3IiATiKWW/builds/1kGOUA72oUUVgep1Z/openapi.json
