# EU VAT Validator (VIES) & GLEIF LEI Lookup | VatPulse (`liebreich-software/vatpulse-eu-vies-vat-lei-kyb-verifier`) Actor

Bulk EU VAT number validator (official European Commission VIES API: validity, legal name, address) and GLEIF LEI lookup (ISO 17442) for B2B KYB, § 6a UStG reverse-charge checks & EU DORA Register of Information. 0 API keys, $0.01/verified entity.

- **URL**: https://apify.com/liebreich-software/vatpulse-eu-vies-vat-lei-kyb-verifier.md
- **Developed by:** [Seyithan Akay](https://apify.com/liebreich-software) (community)
- **Categories:** Lead generation, Business, MCP servers
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 entity verified (vies / gleif)s

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## VatPulse — Official EU VIES VAT, GLEIF LEI & B2B KYB Verifier

**Liebreich Software** — the 5th commercial Apify Store product.

VatPulse verifies business entities against **official government/standards
APIs only** — zero API keys, zero proxies, zero CAPTCHAs, ~80 % margin at
256–512 MB RAM:

| Authority | API | What you get |
|---|---|---|
| **EU Commission VIES** | `ec.europa.eu/taxation_customs/vies/rest-api/ms/{cc}/vat/{num}` | `isValid`, official registered **name**, **address**, request timestamp — the same answer German tax advisors use for **§ 6a UStG reverse-charge** invoice checks |
| **GLEIF** | `api.gleif.org/api/v1/lei-records` | ISO 17442 **LEI**, legal name, legal & HQ address, **register number** (HRB/HRA/FN/UID), registration authority, `ISSUED`/`LAPSED` status, next renewal date |
| **Offline validators** | built-in | All 27 EU VAT formats + `XI` (Northern Ireland) + `GB` + `CH` (`CHE-…-MWST`), ISO-7064 / mod-11 / mod-97 checksum pre-filters, ISO 17442 LEI mod-97-10 — invalid formats rejected in **< 1 ms** without loading the EU API |

### Pricing (Pay-Per-Event)

| Event | Price | When charged |
|---|---|---|
| `entity-verified` | **$0.01** | Only when an authority returned a **definitive** answer: VIES `valid`/`invalid_registered` or GLEIF `lei_verified` |
| — | **$0.00** | `syntax_invalid` (offline rejection), `upstream_unavailable` (VIES `MS_UNAVAILABLE` / timeouts), `not_found`, `error` — all still pushed to the dataset for transparency |

That is **$10 per 1,000 verified entities**. Typo'd VAT IDs and VIES
maintenance windows never cost the user a cent.

### Input — one flexible `queries` array

Each entry is auto-classified:

- **EU VAT ID** — `DE811128135`, `ATU 12345678`, `FR…`, `NL…`, `ES…`, `PL…`,
  `BE…`, `XI…`, `GB…`, `CH…` (with or without spaces/dots/dashes).
- **LEI** — any 20-char ISO 17442 code, e.g. `529900T8BM49AURSDO55`.
- **Company search** — `COMPANY:SAP SE|DE` or `COMPANY:Siemens` for a direct
  GLEIF legal-name lookup.

Identical normalized inputs are deduplicated before any upstream call.

Other options: `enrichWithGleifLei` (default `true` — attaches LEI, register
number, ISSUED/LAPSED status to valid VIES hits), `maxConcurrency` (1–8,
default 3 — gentle on VIES), `timeoutSeconds` (3–20, default 10),
`exportCsvToKeyValueStore` (OWASP-safe `KYB_AUDIT_CSV` + `KYB_AUDIT_CSV_SHA256`
for auditor hash-chaining).

### Dataset record

`query`, `queryType`, `status`, `countryCode`, `vatNumber`, `viesValid`,
`lei`, `leiStatus`, `legalName`, `registerNumber`, `legalAddress`,
`checkedAtIso`, `viesConsultationId`, `kybSummary`, plus full address /
renewal / candidate detail fields.

### Use cases

- **§ 6a UStG reverse-charge** invoice verification before booking input VAT.
- **Supplier / vendor KYB onboarding** — VAT validity + LEI + register data
  in one call.
- **EU DORA Register of Information** — LEI lookups for ICT third-party
  registers.
- **Clay / n8n / Make** — enrich lead tables with official VAT/LEI truth.
- **Auditor-ready exports** — `KYB_AUDIT_CSV` with SHA-256 hash.

### MCP server

`mcp_server.py` exposes JSON-RPC tools over stdio (and optional FastAPI HTTP):

- `verify_vat_id` — VIES check + optional GLEIF enrichment
- `verify_lei` — GLEIF LEI record
- `lookup_company_lei` — GLEIF name search
- `batch_verify_entities` — up to 25 mixed queries (honest batch semantics:
  one record per input, billable statuses only on authoritative answers)

```bash
python mcp_server.py            # stdio JSON-RPC
python -m apify_main --queries "DE811128135,529900T8BM49AURSDO55"
```

### Honesty notes

- VIES member states occasionally go down (`MS_UNAVAILABLE`,
  `GLOBAL_MAX_CONCURRENT_REQ`). VatPulse retries with backoff, then reports
  `upstream_unavailable` — **never billed**, never silently marked invalid.
- Local checksums are a *pre-filter only*. For countries where the checksum
  algorithm is less standardized (AT/NL/FR/ES), the result is informational;
  VIES remains the authoritative answer and the billable event.
- GLEIF enrichment is best-effort: a VIES-valid record is still billable
  even if the LEI lookup is skipped or fails.

# Actor input Schema

## `queries` (type: `array`):

Entities to verify. Accepts EU VAT IDs (e.g. DE811128135, ATU12345678, with or without separators), 20-char ISO 17442 LEI codes, or 'COMPANY:<legal name>|<country>' for GLEIF company search. Identical normalized inputs are deduplicated before querying.

## `enrichWithGleifLei` (type: `boolean`):

When VIES returns a legal name (or a COMPANY: search is used), automatically look up the matching GLEIF LEI, register number, ISSUED/LAPSED status and renewal date.

## `maxConcurrency` (type: `integer`):

Number of queries processed concurrently (1-8). Keep low to be gentle on EU VIES.

## `timeoutSeconds` (type: `number`):

Network timeout per upstream API call in seconds (3.0 to 20.0).

## `exportCsvToKeyValueStore` (type: `boolean`):

Write an OWASP formula-injection-safe KYB_AUDIT_CSV file plus its SHA-256 hash to the Apify Key-Value Store for accounting/auditor archival.

## Actor input object example

```json
{
  "queries": [
    "DE811128135",
    "529900T8BM49AURSDO55"
  ],
  "enrichWithGleifLei": true,
  "maxConcurrency": 3,
  "timeoutSeconds": 10,
  "exportCsvToKeyValueStore": true
}
```

# Actor output Schema

## `verifications` (type: `string`):

Dataset containing one record per input query with authority answers, status and KYB summary.

## `auditCsv` (type: `string`):

OWASP-safe CSV export of all records plus SHA-256 hash in the Key-Value Store.

# 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 = {
    "queries": [
        "DE811128135",
        "529900T8BM49AURSDO55"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("liebreich-software/vatpulse-eu-vies-vat-lei-kyb-verifier").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 = { "queries": [
        "DE811128135",
        "529900T8BM49AURSDO55",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("liebreich-software/vatpulse-eu-vies-vat-lei-kyb-verifier").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 '{
  "queries": [
    "DE811128135",
    "529900T8BM49AURSDO55"
  ]
}' |
apify call liebreich-software/vatpulse-eu-vies-vat-lei-kyb-verifier --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,liebreich-software/vatpulse-eu-vies-vat-lei-kyb-verifier"
        }
    }
}
```

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/jMxedmeCLXLUsCV5z/builds/ShHNe5osXKxAI4jgK/openapi.json
