# EU VAT Number Validator (VIES) (`pricen/eu-vat-check`) Actor

Validate EU and Northern Ireland (XI) VAT numbers via the official EU VIES service. Use when an agent needs to verify a customer's VAT number before invoicing.

- **URL**: https://apify.com/pricen/eu-vat-check.md
- **Developed by:** [Peter Price](https://apify.com/pricen) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$30.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 Number Validator (VIES)

Validate EU VAT numbers against the **official EU VIES** service (all 27 member states + Northern Ireland `XI`). Returns validity, registered trader name and address, and optionally a VIES **consultation number** as audit proof.

**Use when…** you must confirm customer EU VAT numbers before reverse-charge invoicing or B2B onboarding.

### Input

| Field | Required | Description |
|-------|----------|-------------|
| `vatNumbers` | Yes | List of VAT numbers with country prefix (e.g. `DK34223858`, `IE6388047V`) |
| `requesterVat` | No | Your own EU VAT number. When set, VIES returns a **consultation number** tied to your VAT as proof of the check |

#### Example

```json
{
  "vatNumbers": ["IE6388047V", "DK34223858"],
  "requesterVat": "DE123456789"
}
```

### Output

One dataset row per VAT number:

| Field | Description |
|-------|-------------|
| `vat` | Normalized VAT number with country prefix |
| `valid` | `true` / `false` from VIES; `null` if no definitive answer |
| `name` | Registered trader name |
| `address` | Registered trader address |
| `country` | ISO country code (EU member state or `XI`) |
| `checked_at` | ISO timestamp of the check |
| `consultation_number` | VIES consultation number (only when `requesterVat` is provided) |
| `status` | `ok`, `unavailable`, `invalid_input`, etc. |

### Pricing

**$0.03 per definitive check** (pay-per-event `vat-check`). You are charged only when VIES returns a clear valid/invalid answer. VIES outages and non-definitive responses are **not charged**.

### FAQ

**Which countries are supported?**\
All EU member states via the official VIES REST API, plus Northern Ireland (`XI`). Numbers must include the 2-letter country prefix.

**What is a consultation number?**\
Provide your own VAT as `requesterVat`. VIES then returns a consultation number you can keep as evidence that the check was performed against your VAT identity.

**Why is `valid` sometimes null?**\
When VIES is down or returns an error, the Actor reports `status: unavailable` and does not charge. Retry later.

**Is there a rate limit?**\
Requests to VIES are paced (about 5/s) with automatic retries on transient errors so bulk lists stay reliable.

# Actor input Schema

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

VAT numbers with country prefix, e.g. DK34223858, IE6388047V

## `requesterVat` (type: `string`):

Optional. Your own EU VAT number; VIES then returns a consultation number tied to YOUR VAT as audit proof.

## Actor input object example

```json
{
  "vatNumbers": [
    "IE6388047V",
    "DK34223858"
  ]
}
```

# Actor output Schema

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

Validity, registered name/address and optional consultation number for each 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",
        "DK34223858"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("pricen/eu-vat-check").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",
        "DK34223858",
    ] }

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

```

## MCP server setup

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

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/fIGy4RKuwtKxp0EBg/builds/lZ6qjcp61NAzJNSZO/openapi.json
