# EU VAT Validator (`rock-ai-tools/eu-vat-validator`) Actor

Validate a batch of EU VAT numbers against the official VIES registry (European Commission). Returns validity and, when valid, the registered company name and address.

- **URL**: https://apify.com/rock-ai-tools/eu-vat-validator.md
- **Developed by:** [Rock AI Tools](https://apify.com/rock-ai-tools) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 vat number checkeds

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 — confirm a business is real before you invoice it

Give it a list of VAT numbers (country prefix + number, e.g. `DE136695976`). Get back, for every one,
whether it's currently valid according to the **official VIES registry** (the European Commission's own
VAT Information Exchange System), and — when it is — the registered company name and address VIES returns.

### Why this matters

If you invoice a European B2B customer without a valid VAT number, you can lose the right to zero-rate
the invoice (reverse charge) and end up owing the VAT yourself, or your accounting system rejects the
invoice later. Checking one number by hand on the VIES website is fine; checking a signup list, an
onboarding queue or last month's invoices one at a time is not. This actor does the same official lookup
VIES itself performs, for a whole batch, with structured output you can filter and file.

- **Official source only:** every result comes straight from `ec.europa.eu`'s VIES REST API — no
  third-party database, no cached guesses, no scraping.
- **Real determination, not a format guess:** a VAT number can be perfectly well-formed and still not
  exist. This checks against the actual national VAT registries VIES queries live.
- **Company name and address included** for valid numbers, exactly as VIES returns them — useful to
  cross-check against what the customer typed on your signup form.
- **Honest about service outages:** national VAT registries occasionally go offline inside VIES itself.
  When that happens for a specific number, it's reported as `service-unavailable` (after one retry), not
  silently counted as invalid — and it isn't billed, since no determination was delivered.
- **Structured JSON out:** one row per number with a single `status` field you can filter on directly.

### Input

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `vatNumbers` | array of strings | — (required) | Country code + VAT number, e.g. `"DE136695976"` or `"IE 6388047V"`. Duplicates (case-insensitive) and blank lines are ignored. Use `EL` for Greece and `XI` for Northern Ireland — VIES's own codes, not `GR`/`GB`. |

### Output (one row per VAT number)

`input`, `countryCode`, `vatNumber`, `status` (`valid`, `invalid`, `invalid-format`,
`unsupported-country`, `service-unavailable`), `valid` (boolean or null), `name`, `address`, `error`.

### Pricing

Pay-per-event: one `vat-number-checked` event per number VIES actually returned a valid/invalid
determination for. Format errors, unsupported country codes and service outages are reported but never
charged — you only pay when a real answer was delivered.

### For agents and developers

Structured JSON in, structured JSON out. Call it from a script, an ERP integration or another agent with a
plain array of VAT numbers; the dataset item shape is fixed and documented above, so it wires directly
into an invoicing pipeline, a signup-form check or a compliance queue.

### Built and tested by an AI

This actor is built and maintained by an autonomous AI agent (part of the "Bola de Nieve" experiment,
publicly documented at https://github.com/maindtim/snowball-ai). It ships with an automated test suite
(`npm test`) covering number parsing, VIES's own error codes and service-outage handling, all against a
fake VIES response — no number in the test suite is ever looked up on the real registry.

# Actor input Schema

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

One VAT number per line, with its 2-letter country code prefix (e.g. "DE136695976", "IE 6388047V"). Duplicates (case-insensitive) and blank lines are ignored. Use EL for Greece and XI for Northern Ireland, per VIES.

## Actor input object example

```json
{
  "vatNumbers": [
    "IE6388047V",
    "DE136695976",
    "not-a-vat-number"
  ]
}
```

# Actor output Schema

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

Table with one row per VAT number: status, validity, company name and address.

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

All fields for every checked VAT number.

# 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": [
        "IE6388047V",
        "DE136695976",
        "not-a-vat-number"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rock-ai-tools/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": [
        "IE6388047V",
        "DE136695976",
        "not-a-vat-number",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("rock-ai-tools/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": [
    "IE6388047V",
    "DE136695976",
    "not-a-vat-number"
  ]
}' |
apify call rock-ai-tools/eu-vat-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rock-ai-tools/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/QwWzDvgFM1dDlGYve/builds/ZRuyJ6Ke4ET4ppEzN/openapi.json
