# EU VAT ID Validator (`juliandev/vat-id-validator`) Actor

Validate EU VAT IDs instantly using the official VIES API. Returns company name & address for all 27 EU\
countries. Perfect for e-commerce checkout, invoicing & compliance checks.

- **URL**: https://apify.com/juliandev/vat-id-validator.md
- **Developed by:** [Julian](https://apify.com/juliandev) (community)
- **Categories:** E-commerce, MCP servers, Automation
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## EU VAT ID Validator

Validates EU VAT/USt-ID numbers using the **official European Commission VIES API**. Get instant verification with company name and address.

### Features

- Validates VAT IDs from all **27 EU countries**
- Returns **company name and address** (if available from VIES)
- Uses the **official VIES API** (100% accurate, real-time data)
- Handles various input formats (spaces, lowercase)
- Clean JSON output for easy integration

### Use Cases

- **E-Commerce**: Validate VAT IDs at checkout for B2B transactions
- **Invoice Processing**: Automatically verify VAT numbers before invoicing
- **KYC/Compliance**: Verify business identities for compliance checks
- **Accounting Automation**: Enrich your accounting data with verified company info
- **CRM Data Enrichment**: Add verified company details to your CRM records

### Input

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `vatId` | string | Yes | EU VAT ID to validate (e.g., "DE123456789") |

#### Supported Formats

All of these work:

- `DE123456789` (standard)
- `de123456789` (lowercase - auto-converted)
- `DE 123 456 789` (with spaces - auto-cleaned)

### Output

```json
{
    "valid": true,
    "vatId": "DE123456789",
    "countryCode": "DE",
    "vatNumber": "123456789",
    "companyName": "Example GmbH",
    "companyAddress": "Musterstraße 1, 12345 Berlin",
    "requestDate": "2026-01-24",
    "error": null
}
```

#### Output Fields

| Field | Type | Description |
|-------|------|-------------|
| `valid` | boolean | Whether the VAT ID is valid |
| `vatId` | string | The cleaned VAT ID that was validated |
| `countryCode` | string | Two-letter country code (e.g., "DE") |
| `vatNumber` | string | The VAT number without country code |
| `companyName` | string/null | Company name (if available from VIES) |
| `companyAddress` | string/null | Company address (if available from VIES) |
| `requestDate` | string | Date of the validation request |
| `error` | string/null | Error message if validation failed |

### Supported Countries

All 27 EU member states:

| Code | Country | Code | Country | Code | Country |
|------|---------|------|---------|------|---------|
| AT | Austria | FI | Finland | MT | Malta |
| BE | Belgium | FR | France | NL | Netherlands |
| BG | Bulgaria | HR | Croatia | PL | Poland |
| CY | Cyprus | HU | Hungary | PT | Portugal |
| CZ | Czechia | IE | Ireland | RO | Romania |
| DE | Germany | IT | Italy | SE | Sweden |
| DK | Denmark | LT | Lithuania | SI | Slovenia |
| EE | Estonia | LU | Luxembourg | SK | Slovakia |
| EL | Greece | LV | Latvia | | |
| ES | Spain | | | | |

> **Note**: Greece uses "EL" (not "GR") as per EU standard.

### Example Usage

#### Via Apify Console

1. Go to the Actor page
2. Enter a VAT ID (e.g., `DE123456789`)
3. Click "Start"
4. View results in the Dataset tab

#### Via API

```bash
curl -X POST "https://api.apify.com/v2/acts/YOUR_USERNAME~vat-id-validator/runs" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{"vatId": "DE123456789"}'
```

#### Via JavaScript/Node.js

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('YOUR_USERNAME/vat-id-validator').call({
    vatId: 'DE123456789'
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0]);
```

#### Via Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("YOUR_USERNAME/vat-id-validator").call(
    run_input={"vatId": "DE123456789"}
)

items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items[0])
```

### Error Handling

The Actor handles errors gracefully and always returns a result:

```json
{
    "valid": false,
    "vatId": "XX123456789",
    "countryCode": "XX",
    "vatNumber": "123456789",
    "companyName": null,
    "companyAddress": null,
    "requestDate": "2026-01-24T12:00:00.000Z",
    "error": "Invalid country code: XX. Must be an EU country."
}
```

### Data Source

This Actor uses the official **VIES (VAT Information Exchange System)** API provided by the European Commission:

- Endpoint: `https://ec.europa.eu/taxation_customs/vies/rest-api/check-vat-number`
- Documentation: [VIES FAQ](https://ec.europa.eu/taxation_customs/vies/#/faq)

The data is real-time and comes directly from EU member states' tax authorities.

### Limitations

- Only validates **EU VAT IDs** (UK VAT IDs are no longer supported since Brexit)
- Company name/address availability depends on what each country shares with VIES
- VIES API may have occasional downtime for maintenance

### Support

If you have questions or need help, feel free to open an issue or contact the developer.

### Changelog

#### v1.0.0 (2026-01-24)

- Initial release
- Support for all 27 EU countries
- Clean JSON output with company details

# Actor input Schema

## `vatId` (type: `string`):

EU VAT ID to validate (e.g., DE123456789, FR12345678901, AT12345678)

## Actor input object example

```json
{
  "vatId": "DE123456789"
}
```

# 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 = {
    "vatId": "DE123456789"
};

// Run the Actor and wait for it to finish
const run = await client.actor("juliandev/vat-id-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 = { "vatId": "DE123456789" }

# Run the Actor and wait for it to finish
run = client.actor("juliandev/vat-id-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 '{
  "vatId": "DE123456789"
}' |
apify call juliandev/vat-id-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,juliandev/vat-id-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/MFffrWIsmKUTVwPjG/builds/b4dXH3RKo1JikbzaT/openapi.json
