# Company Verification, VAT (VIES) & LEI (GLEIF) Checker (`chun_yung_lo/vat-lei-company-verification`) Actor

Verify companies before doing business. Validate EU VAT numbers against VIES, look up LEI records in GLEIF, or search companies by name. Batch up to 50 checks per call, with a status field on every row.

- **URL**: https://apify.com/chun_yung_lo/vat-lei-company-verification.md
- **Developed by:** [Chun-Yung Yong Lo](https://apify.com/chun_yung_lo) (community)
- **Categories:** Business, Agents, MCP servers
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 entities checked

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/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

## Company Verification, VAT (VIES) & LEI (GLEIF) Checker

Verify that a business is real before you sign, pay or onboard. One call checks a batch of up to 50 items:

- **EU VAT numbers** are checked against the official European Commission VIES service (valid/invalid, registered name and address when the member state discloses them).
- **LEI codes** are checksum-validated (ISO 17442) and read from the public GLEIF registry (legal name, address, jurisdiction, entity status, registration status, renewal date, national registration number).
- **Company names** are searched in GLEIF and return up to 5 matching entities with their LEI.

Every output row has an explicit `status` field, so you (or your AI agent) can tell "not found" from "failed".

### Input example

```json
{
  "vatNumbers": ["DE136695976", "NL123456789B01"],
  "leis": ["HWUPKR0MPOU8FGXBT394"],
  "companyNames": ["Apple Inc"],
  "checkOnline": true
}
```

- `vatNumbers`: EU VAT numbers with country prefix (spaces, dots and dashes are ignored; `GR` is mapped to `EL`; `XI` = Northern Ireland).
- `leis`: 20-character LEI codes.
- `companyNames`: 2-200 characters each, max 10 names.
- `checkOnline`: `true` (default) queries VIES/GLEIF live; `false` runs only offline format and checksum checks.
- Max 50 items in total per call.

### Output example

```json
{
  "type": "vat",
  "query": "DE136695976",
  "status": "ok",
  "formatValid": true,
  "valid": true,
  "countryCode": "DE",
  "vatNumber": "136695976",
  "lei": null,
  "name": "Example GmbH",
  "address": "Example Street 1, 10115 Berlin",
  "requestDate": "2025-01-01T12:00:00.000Z",
  "source": "VIES",
  "message": null
}
```

(Values above are illustrative.) All rows contain the same fields: `type`, `query`, `status`, `formatValid`, `valid`, `countryCode`, `vatNumber`, `lei`, `name`, `address`, `jurisdiction`, `entityStatus`, `registrationStatus`, `nextRenewalDate`, `registrationNumber`, `requestDate`, `source`, `message`.

#### Status values

| status | meaning |
|---|---|
| `ok` | The check completed. For VAT/LEI see `valid` (true/false); `valid` is null in offline mode. |
| `invalid_input` | The VAT number or LEI is malformed or unsupported; no lookup was made. |
| `not_found` | The registry answered and has no matching record. |
| `service_unavailable` | VIES or the member state service could not answer right now. Retry later. |
| `error` | Network or unexpected response error. |
| `skipped_offline` | Name search was requested with `checkOnline=false`. |

`valid` for VAT means VIES reports the number as valid. For LEI it means the record exists and its registration status is `ISSUED` (not lapsed or retired).

### Pricing

US$0.002 per entity checked (one VAT number, one LEI, or one company-name search = one check). A single-item call costs US$0.002.

### Limits

- Max 50 items per call, max 10 company names.
- VIES covers EU member states and Northern Ireland (XI) only; other countries are rejected with `invalid_input`. VIES reflects what each member state publishes: some do not return name or address.
- VIES validity only confirms the number is registered for VAT, not that the company is trustworthy. This tool does not provide ownership, sanctions or risk scoring, and no BORME data.
- GLEIF only contains entities that have a LEI (mostly financial and larger firms).
- Requests are made one at a time with a short pause. Rate limits and outages of VIES/GLEIF are reported, never bypassed.
- Company name search uses GLEIF full-text search and may return near matches; always compare the returned name and jurisdiction.

### For AI agents (MCP)

Call this Actor through Apify's MCP server with one input like:

```json
{"vatNumbers": ["DE136695976"], "leis": ["HWUPKR0MPOU8FGXBT394"], "checkOnline": true}
```

One call does the whole job and returns one row per item (name searches can return up to 5 rows). Read `status` first: `ok` means the check ran, then read `valid`. `not_found` means the registry has no record; `service_unavailable` / `error` mean retry later. This call costs about US$0.004 (2 checks x US$0.002).

### Credits

Data comes from the public European Commission VIES service and the GLEIF Global LEI Index API (GLEIF data is published under the CC0 1.0 public domain dedication). This Actor wraps these public services with the `requests` library (Apache-2.0) and does not copy third-party code. It is not affiliated with the European Commission or GLEIF.

# Actor input Schema

## `vatNumbers` (type: `array`):

EU VAT numbers with country prefix, e.g. DE136695976 or NL123456789B01. Spaces, dots and dashes are ignored. GR is accepted for Greece (EL), XI for Northern Ireland. Max 50 items in total across all lists.

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

20-character Legal Entity Identifiers (ISO 17442), e.g. HWUPKR0MPOU8FGXBT394. The checksum is validated, then the record is read from GLEIF. Max 50 items in total across all lists.

## `companyNames` (type: `array`):

Company names to search in the GLEIF registry (2-200 characters each, max 10 names). Returns up to 5 best matches per name. Requires online checks.

## `checkOnline` (type: `boolean`):

If true, query VIES and GLEIF live. If false, only the offline format and checksum checks run (no registry lookup, no company names).

## Actor input object example

```json
{
  "vatNumbers": [
    "DE136695976"
  ],
  "leis": [
    "HWUPKR0MPOU8FGXBT394"
  ],
  "companyNames": [],
  "checkOnline": true
}
```

# Actor output Schema

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

One row per processed input

# 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 = {
    "vatNumbers": [
        "DE136695976"
    ],
    "leis": [
        "HWUPKR0MPOU8FGXBT394"
    ],
    "companyNames": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("chun_yung_lo/vat-lei-company-verification").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 = {
    "vatNumbers": ["DE136695976"],
    "leis": ["HWUPKR0MPOU8FGXBT394"],
    "companyNames": [],
}

# Run the Actor and wait for it to finish
run = client.actor("chun_yung_lo/vat-lei-company-verification").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 '{
  "vatNumbers": [
    "DE136695976"
  ],
  "leis": [
    "HWUPKR0MPOU8FGXBT394"
  ],
  "companyNames": []
}' |
apify call chun_yung_lo/vat-lei-company-verification --silent --output-dataset

```

## MCP server setup

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

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/wdsw3JTm2eks8ukbN/builds/1UStp4Pi17Z2m2BJS/openapi.json
