UK VAT HMRC API avatar
UK VAT HMRC API

Pricing

from $5.00 / 1,000 results

Go to Apify Store
UK VAT HMRC API

UK VAT HMRC API

Supports Proof of Check. Scrapes UK VAT numbers using the official HMRC service. Validates UK VAT numbers against the official HMRC database.

Pricing

from $5.00 / 1,000 results

Rating

0.0

(0)

Developer

No-Code Venture

No-Code Venture

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

9 days ago

Last modified

Categories

Share

UK VAT Number Checker

This Apify Actor validates UK VAT numbers using the official HMRC (Her Majesty's Revenue and Customs) service at tax.service.gov.uk.

Features

  • Validates UK VAT numbers against the official HMRC database
  • Returns registration status (valid/invalid)
  • Extracts registered business name (for valid numbers)
  • Extracts registered business address (for valid numbers)
  • Proof of Check: Optionally obtain an official HMRC proof reference for your records

How It Works

This Actor integrates with a server-rendered VAT checker that uses a stateful, session-based HTML flow:

  1. Initialize Session: GET request to fetch the form page and extract the CSRF token
  2. Submit VAT Number: POST request with the VAT number and CSRF token
  3. Follow Redirect: After receiving a 303 redirect, fetch the result page
  4. Parse Results: Extract VAT validity and business details from the HTML response

Input

FieldTypeRequiredDescription
vatNumbersString[]YesArray of UK VAT numbers to validate. Can include or exclude the 'GB' prefix (e.g., "GB123456789" or "123456789")
withProofBooleanNoSet to true to obtain an official HMRC proof of check reference. Default: false
requesterVatNumberStringConditionalYour own UK VAT number. Required when withProof is true

Example Input (Basic)

{
"vatNumbers": ["GB123456789"]
}

Example Input (With Proof of Check)

{
"vatNumbers": ["GB727255821"],
"withProof": true,
"requesterVatNumber": "GB123456789"
}

Output

The Actor outputs a dataset with the following fields:

FieldTypeDescription
vatNumberStringThe VAT number that was checked
isValidBooleanWhether the VAT number is valid and registered
businessNameStringThe registered business name (null if invalid)
businessAddressStringThe registered business address (null if invalid)
proofReferenceStringOfficial HMRC proof of check reference (null if withProof is false or VAT is invalid)
checkedAtStringISO 8601 timestamp of when the check was performed

Example Output (Valid VAT Number)

{
"vatNumber": "727255821",
"isValid": true,
"businessName": "Example Company Ltd",
"businessAddress": "123 High Street, London, SW1A 1AA",
"proofReference": null,
"checkedAt": "2024-01-15T10:30:00.000Z"
}

Example Output (With Proof Reference)

{
"vatNumber": "727255821",
"isValid": true,
"businessName": "AMAZON EU SARL",
"businessAddress": "HM REVENUE AND CUSTOMS, RUBY HOUSE, 8 RUBY PLACE, ABERDEEN, AB10 1ZP, GB",
"proofReference": "EFR-XTU-JFD",
"checkedAt": "2024-01-15T10:30:00.000Z"
}

Example Output (Invalid VAT Number)

{
"vatNumber": "000000000",
"isValid": false,
"businessName": null,
"businessAddress": null,
"proofReference": null,
"checkedAt": "2024-01-15T10:30:00.000Z"
}

Project Structure

.actor/
├── actor.json # Actor config: name, version, runtime settings
├── dataset_schema.json # Dataset output structure definition
├── input_schema.json # Input validation & Console form definition
└── output_schema.json # Output template specification
src/
└── main.ts # Actor entry point and main logic
storage/ # Local storage (mirrors Cloud during development)
├── datasets/
├── key_value_stores/
└── request_queues/
Dockerfile # Container image definition

Technical Notes

  • The Actor uses got-scraping for HTTP requests with session/cookie management
  • CSRF tokens are automatically extracted and submitted with the form
  • The Actor handles the full redirect chain (GET → POST → 303 → GET)
  • All requests use the same session cookies to maintain state
  • When withProof is enabled, the Actor requests an official HMRC consultation number that can be used as proof of the VAT check

Disclaimer

This Actor uses the official HMRC public VAT check service, which is freely available for anyone to use without authentication or API keys. No special permissions or credentials are required.

Legal Notice: This tool is provided "as is" without warranty of any kind. The information returned is for reference purposes only and should not be used as the sole basis for business decisions. Always verify VAT registration status through official channels for legal or compliance purposes. The developers assume no liability for any errors, omissions, or consequences arising from the use of this Actor.

Resources