# EU VAT Validator — VIES Check & Change Monitoring (`darknezz/eu-vat-validator`) Actor

Validate EU VAT numbers against VIES and get only the numbers that changed since the last run: validity, registered name and address. Bulk input, 24 h cache, and an honest 'unknown' when a member state is down instead of a false 'invalid'.

- **URL**: https://apify.com/darknezz/eu-vat-validator.md
- **Developed by:** [Oaida Adrian](https://apify.com/darknezz) (community)
- **Categories:** Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 vat number validateds

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/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

## EU VAT Validator — VIES check with change monitoring

Validates EU VAT numbers against **VIES** (the European Commission's own VAT
registry) and, on scheduled runs, emits only the numbers whose answer changed.

No API key. No proxy. The data comes from `ec.europa.eu`, so a run costs nothing
but the lookups.

### What you get per number

```json
{
  "vatNumber": "RO14399840",
  "status": "valid",
  "valid": true,
  "name": "DANTE INTERNATIONAL SA",
  "address": "MUNICIPIUL BUCUREŞTI, SECTOR 2 …",
  "reason": null,
  "changed": null,
  "isChange": false,
  "checkedAt": "2026-11-06T22:40:11Z"
}
```

`status` is one of three, and the third one is the point:

| status | meaning |
|---|---|
| `valid` | VIES confirms the number is an active VAT registration |
| `invalid` | VIES says the number is not a VAT registration |
| `unknown` | **VIES could not answer** — member-state outage, concurrency cap, timeout |

Most validators report `unknown` as `invalid`, which is how a compliance check
silently flags a good customer as a fraud risk. Here `unknown` is never billed,
never emitted as a change, and carries the VIES `reason`
(`MS_UNAVAILABLE`, `MS_MAX_CONCURRENT_REQ`, `GLOBAL_MAX_CONCURRENT_REQ`, `TIMEOUT`).

### Monitoring mode

Default `emit: "changes"`. The last answer per number is kept in a named key-value
store; a later run emits a row only when validity, registered name or address
differs, with a per-field `changed` map:

```json
{"status": false, "name": true, "address": false}
```

A quiet day costs a handful of calls and produces an empty dataset — which is the
answer. Set `emit: "all"` for a full re-validation dump.

### Input

| field | default | notes |
|---|---|---|
| `vatNumbers` | — | `RO14399840`, `DE811569869`, `FR40303265045`. Spaces, dots, dashes ignored; `GR` is mapped to `EL` |
| `defaultCountry` | — | used when a number has no prefix |
| `emit` | `changes` | or `all` |
| `cacheHours` | `24` | reuse a stored answer instead of calling VIES; `0` = always call |
| `maxItems` | `10000` | cap per run |

### Pricing

Pay per event: **$0.002 per VAT number validated** (`vat-validated`, the primary
event), plus a **$0.01 run-start fee** and Apify's standard platform compute — no
subscription, no minimum. 100 numbers cost about **$0.21** (100 x $0.002 + $0.01);
1,000 numbers about **$2.01**. Cap the spend of a run with Console -> *Run options*
-> *Maximum cost per run* (`maxTotalChargeUsd` in the API).

### Run it on a schedule

Save the task and schedule it daily (or hourly for onboarding checks). Because the
state lives outside the run, every run after the first is a true diff — this is
the difference between a scrape and a monitor.

### Notes from the source

- VIES answers a valid number with `{"isValid": true, "userError": "VALID"}` — the
  verdict is in `isValid`, and `userError` only matters when it is false.
- Some member states return `---` in place of unknown fields; those are normalised
  to an empty string rather than passed through as data.
- Concurrency is capped at 3 with a small delay, because VIES throttles per member
  state and answers a burst with `MS_MAX_CONCURRENT_REQ`.

# Actor input Schema

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

EU VAT numbers, with the country prefix: RO14399840, DE811569869, FR40303265045. Spaces, dots and dashes are ignored. Without a prefix the Default country is used.

## `defaultCountry` (type: `string`):

Two-letter code used for numbers that carry no prefix (e.g. RO).

## `emit` (type: `string`):

changes = only numbers whose answer changed since the last run (the monitoring mode). all = every number checked or served from cache.

## `cacheHours` (type: `integer`):

Reuse a stored answer for this many hours instead of calling VIES again. 0 = always call VIES.

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

Hard cap on numbers processed in one run.

## Actor input object example

```json
{
  "vatNumbers": [
    "RO14399840",
    "DE811569869"
  ],
  "emit": "changes",
  "cacheHours": 24,
  "maxItems": 10000
}
```

# Actor output Schema

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

Dataset items: one row per VAT number, with status (valid / invalid / unknown), the registered name and address, and whether it changed since the previous run.

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

Counts for the run: checked, cached, valid, invalid, unknown, changed, emitted, errors.

# 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": [
        "RO14399840"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("darknezz/eu-vat-validator").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": ["RO14399840"] }

# Run the Actor and wait for it to finish
run = client.actor("darknezz/eu-vat-validator").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": [
    "RO14399840"
  ]
}' |
apify call darknezz/eu-vat-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,darknezz/eu-vat-validator"
        }
    }
}
```

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/G4sLFG9VCRgabpauC/builds/gHglhzK0tqimlrjpm/openapi.json
