# EU VIES VAT Number Checker (`downright_blessing/eu-vies-vat-checker`) Actor

Validate EU VAT identification numbers via the official European Commission VIES REST API. Returns validity, registered name/address when available, country code and raw VIES fields as structured JSON.

- **URL**: https://apify.com/downright\_blessing/eu-vies-vat-checker.md
- **Developed by:** [Joao Pedro Rosado](https://apify.com/downright_blessing) (community)
- **Categories:** Other, Developer tools, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 vat results

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 VIES VAT Number Checker

Validate **EU VAT identification numbers** against the official **European Commission VIES** (VAT Information Exchange System) REST API. Returns structured JSON with validity, registered trader name and address when the member state provides them, country code, request date and raw VIES fields.

No API key. Public EU service used by finance, compliance and e-commerce teams across Europe.

**Official UI:** [VIES VAT validation](https://ec.europa.eu/taxation_customs/vies/#/vat-validation)\
**REST endpoint used:** `POST https://ec.europa.eu/taxation_customs/vies/rest-api/check-vat-number`

***

### What it does

1. Accepts a list of VAT numbers (`IE6388047V`, `DE123456789`, …) and/or structured `{ countryCode, vatNumber }` pairs.
2. Calls the official VIES JSON REST API for each number (with optional throttle + retries on member-state concurrency limits).
3. Writes one Dataset row per check: `valid`, `name`, `address`, `countryCode`, `vatNumber`, `requestDate`, plus raw VIES fields.

#### Notes

- **Greece** uses country code **`EL`** in VIES (not `GR`). The Actor remaps `GR` → `EL`.
- Name/address are returned only when the member state chooses to disclose them; empty/`---` means “not provided”, not “invalid”.
- VIES member-state backends can return `MS_MAX_CONCURRENT_REQ` under load — the Actor retries with backoff and respects `requestDelayMs`.

### Who it's for

- Finance / tax teams validating EU B2B customer VAT IDs
- E-commerce and SaaS billing that need reverse-charge eligibility checks
- Compliance and KYC pipelines enriching company records with VIES data
- Agents and ETL jobs that need **official** VIES results as JSON (not scraped HTML)

### Input summary

| Field | Required | Description |
|---|---|---|
| `vatNumbers` | no\* | List of VAT IDs with or without country prefix, e.g. `IE6388047V` |
| `checks` | no\* | Array of `{ "countryCode": "IE", "vatNumber": "6388047V" }` |
| `maxItems` | no | Hard Dataset cap (default 50, max 5000) |
| `requestDelayMs` | no | Delay between VIES calls in ms (default 250) |

\*Provide at least one of `vatNumbers` or `checks`.

### Output fields

One Dataset row per VAT:

`countryCode`, `vatNumber`, `vatFull`, `valid`, `name`, `address`, `requestDate`, `requestIdentifier`, optional trader-match fields, `error` (null on success), `sourceUrl`, `viesEndpoint`, `raw`, `scrapedAt`.

### Pricing

**Pay-per-event** suggested for the Store:

- **Actor start** (`apify-actor-start`): about **$0.04** / run
- **Dataset item** (`apify-default-dataset-item`): about **$0.003** / VAT result

Use `maxItems` as the spend cap. See Store pricing panel once published.

### Quick start (Apify Console)

1. Open the Actor → **Start**.
2. Paste VAT numbers (e.g. `IE6388047V`) or structured `checks`.
3. Set `maxItems` / `requestDelayMs` if needed.
4. Run → export Dataset JSON/CSV.

```json
{
  "vatNumbers": ["IE6388047V", "DE111111125"],
  "checks": [
    { "countryCode": "FR", "vatNumber": "40303265045" }
  ],
  "maxItems": 50,
  "requestDelayMs": 250
}
```

#### Local smoke

```bash
npm run local
## or: APIFY_LOCAL=1 node src/main.js
```

Writes `storage/datasets/default/000000001.json` and `storage/key_value_stores/default/OUTPUT.json`.

### Legal / data source

Data comes from the official **European Commission VIES** public REST API (`ec.europa.eu/taxation_customs/vies`). Results reflect member-state replies at query time and are **not** a legal opinion or tax advice. Respect fair-use request rates; do not overwhelm VIES or individual member-state backends. See the [Commission VIES pages](https://ec.europa.eu/taxation_customs/vies/) for service terms and availability (`/rest-api/check-status`).

***

### Português (resumo)

Valida números de **IVA da UE** pelo serviço oficial **VIES** da Comissão Europeia (REST JSON). Devolve validade, nome/endereço quando o Estado-membro informa, país e campos brutos. Sem API key. Ideal para compliance, faturamento B2B e enriquecimento de cadastros. **Pay-per-event** sugerido: ~US$0,04 por execução + ~US$0,003 por resultado. Fonte legal = VIES oficial da UE.

# Actor input Schema

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

List of EU VAT IDs, e.g. IE6388047V, DE123456789, or FR40303265045. Country prefix is parsed when present. Spaces and punctuation are stripped.

## `checks` (type: `array`):

Optional alternative to vatNumbers: objects with countryCode (ISO-2; use EL for Greece) and vatNumber (digits/letters without country prefix).

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

Hard Dataset row cap (one row per VAT check).

## `requestDelayMs` (type: `integer`):

Throttle to reduce MS\_MAX\_CONCURRENT\_REQ / rate-limit errors from member-state backends. Default 250.

## Actor input object example

```json
{
  "vatNumbers": [
    "IE6388047V",
    "DE811111125"
  ],
  "checks": [
    {
      "countryCode": "IE",
      "vatNumber": "6388047V"
    }
  ],
  "maxItems": 50,
  "requestDelayMs": 250
}
```

# Actor output Schema

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

Default dataset items: validity, name, address, country, raw VIES fields.

# 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",
        "DE811111125"
    ],
    "checks": [
        {
            "countryCode": "IE",
            "vatNumber": "6388047V"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("downright_blessing/eu-vies-vat-checker").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",
        "DE811111125",
    ],
    "checks": [{
            "countryCode": "IE",
            "vatNumber": "6388047V",
        }],
}

# Run the Actor and wait for it to finish
run = client.actor("downright_blessing/eu-vies-vat-checker").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",
    "DE811111125"
  ],
  "checks": [
    {
      "countryCode": "IE",
      "vatNumber": "6388047V"
    }
  ]
}' |
apify call downright_blessing/eu-vies-vat-checker --silent --output-dataset

```

## MCP server setup

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

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/2jvOJtqqLVhc7xULL/builds/dpKGSngPYlv5XiJzb/openapi.json
