euvatrates

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 3 Imported by: 0

README

eu-vat-rates-data-go

Go Reference Last updated

EU VAT rates for all 27 EU member states plus the United Kingdom, sourced from the European Commission TEDB. Checked daily, published automatically when rates change.

  • Standard, reduced, super-reduced, and parking rates
  • Zero dependencies — data embedded with //go:embed
  • Fully typed — works with Go 1.21+
  • Checked daily via GitHub Actions, new version tagged only when rates change

Also available in: JavaScript/TypeScript (npm) · Python (PyPI) · PHP (Packagist) · Ruby (RubyGems)


Installation

go get github.com/vatnode/eu-vat-rates-data-go

Usage

package main

import (
    "fmt"
    euvatrates "github.com/vatnode/eu-vat-rates-data-go"
)

func main() {
    // Full rate struct for a country
    fi, ok := euvatrates.GetRate("FI")
    if ok {
        fmt.Printf("%s: %.1f%%\n", fi.Country, fi.Standard)
        // Finland: 25.5%
    }

    // Just the standard rate
    standard, ok := euvatrates.GetStandardRate("DE")
    fmt.Println(standard) // 19

    // Type guard
    if euvatrates.IsEUMember(userInput) {
        rate, _ := euvatrates.GetRate(userInput)
        _ = rate // guaranteed to be valid
    }

    // All 28 countries
    all := euvatrates.GetAllRates()
    for code, rate := range all {
        fmt.Printf("%s: %.1f%%\n", code, rate.Standard)
    }

    // Data version date
    fmt.Println(euvatrates.DataVersion()) // "2026-02-25"
}

Types

type VatRate struct {
    Country      string    `json:"country"`
    Currency     string    `json:"currency"`
    Standard     float64   `json:"standard"`
    Reduced      []float64 `json:"reduced"`
    SuperReduced *float64  `json:"super_reduced"`
    Parking      *float64  `json:"parking"`
}

Data source & update frequency

Rates are fetched from the European Commission Taxes in Europe Database (TEDB):


Covered countries

EU-27 member states + United Kingdom (28 countries total):

AT BE BG CY CZ DE DK EE ES FI FR GB GR HR HU IE IT LT LU LV MT NL PL PT RO SE SI SK


License

MIT

Documentation

Overview

Package euvatrates provides EU VAT rates for all 27 member states + UK.

Data is sourced from the European Commission TEDB (Taxes in Europe Database) and embedded at compile time. Published automatically when rates change.

Usage:

import euvatrates "github.com/vatnode/eu-vat-rates-data-go"

rate, ok := euvatrates.GetRate("FI")
// rate.Standard == 25.5, rate.Country == "Finland"

standard, ok := euvatrates.GetStandardRate("DE")  // 19.0, true
euvatrates.IsEUMember("FR")                        // true
euvatrates.DataVersion()                           // "2026-02-25"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataVersion

func DataVersion() string

DataVersion returns the ISO 8601 date when the data was last fetched from EC TEDB.

func GetAllRates

func GetAllRates() map[string]VatRate

GetAllRates returns a copy of the full rates map (28 countries).

func GetStandardRate

func GetStandardRate(countryCode string) (float64, bool)

GetStandardRate returns the standard VAT rate for the given country code. The second return value is false if the country is not in the dataset.

func IsEUMember

func IsEUMember(countryCode string) bool

IsEUMember returns true if the country code is in the dataset (EU-27 + GB).

Types

type Dataset

type Dataset struct {
	Version string             `json:"version"`
	Source  string             `json:"source"`
	URL     string             `json:"url"`
	Rates   map[string]VatRate `json:"rates"`
}

Dataset is the top-level structure of the data file.

func RawDataset

func RawDataset() Dataset

RawDataset returns the full parsed Dataset struct.

type VatRate

type VatRate struct {
	Country      string    `json:"country"`
	Currency     string    `json:"currency"`
	Standard     float64   `json:"standard"`
	Reduced      []float64 `json:"reduced"`
	SuperReduced *float64  `json:"super_reduced"`
	Parking      *float64  `json:"parking"`
}

VatRate holds all VAT rates for a single country.

func GetRate

func GetRate(countryCode string) (VatRate, bool)

GetRate returns the full VatRate for the given ISO 3166-1 alpha-2 country code. The second return value is false if the country is not in the dataset.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL