---
title: VAT Rates by IP API Reference
version: 1.0.0
description: Get VAT rates for a country resolved from an IP address. Returns standard and reduced VAT rates based on the geographic location of the IP.
openapi: 3.1.1
servers:
  - https://api.apifreaks.com/v1.0
paths: 1
operations: 1
schemas: 5
---

## Table of Contents

- [VAT Rates by IP API Reference v1.0.0](#vat-rates-by-ip-api-reference-v100)
  - [Authentication](#authentication)
  - [Financial APIs](#financial-apis)
    - [getVatRatesByIp](#getvatratesbyip)
      - [Parameters](#parameters)
      - [Responses](#responses)
  - [Schemas](#schemas)
    - [VatIpItemArray](#vatipitemarray)
    - [VatIpItem](#vatipitem)
    - [VatRateDecimal](#vatratedecimal)
    - [VatCategories](#vatcategories)
    - [ErrorResponse](#errorresponse)



# VAT Rates by IP API Reference v1.0.0

Get VAT rates for a country resolved from an IP address. Returns standard and reduced VAT rates based on the geographic location of the IP.

Base URLs:

* [https://api.apifreaks.com/v1.0](https://api.apifreaks.com/v1.0)

## Authentication

* API Key (ApiKeyAuthHeader)
    - Parameter Name: **X-apiKey**, in: header. Pass your API key via the X-apiKey request header.

* API Key (ApiKeyAuthQuery)
    - Parameter Name: **apiKey**, in: query. Pass your API key via the apiKey query parameter.

## Financial APIs

### getVatRatesByIp

`GET /vat/rates/ip-address`

*Get VAT rate by IP address*

Fetches VAT rate based on the specified or originating IP address.

#### Parameters

|Name|In|Type|Required|Description|
|---|---|---|---|---|
|format|query|string|false|Specify the desired response format. Options: 'json' (default) or 'xml'.|
|ipAddress|query|string|false|IPv4 or IPv6 address to look up VAT rate for. If omitted, the originating IP address will be used.|

##### Enumerated Values

|Parameter|Value|
|---|---|
|format|json|
|format|xml|

> Example responses

> Successful response

```json
[
  {
    "country": "GB",
    "type": "vat",
    "currency": "GBP",
    "standard_rate": 0.2,
    "reduced_rate": [
      0,
      0.05
    ],
    "categories": {
      "books": 0.2,
      "newspapers": 0.2,
      "periodicals": 0.2,
      "broadcasting": 0.2
    }
  }
]
```

```json
[
  {
    "country": "US",
    "state": "CA",
    "type": "vat",
    "currency": "",
    "standard_rate": 0.0825
  }
]
```

> Bad Request

```json
{
  "message": "Invalid IP address format. Please provide a valid IPv4 or IPv6 address."
}
```

> Not Found

```json
{
  "message": "No VAT data found. Please provide a valid ipAddress."
}
```

#### Responses

|Status|Meaning|Description|Schema|
|---|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful response|[VatIpItemArray](#vatipitemarray)|
|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad Request|[ErrorResponse](#errorresponse)|
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not Found|[ErrorResponse](#errorresponse)|

#### Response Headers

|Status|Header|Type|Format|Description|
|---|---|---|---|---|
|200|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|
|400|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|
|404|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|

To perform this operation, you must be authenticated by means of one of the following methods:
ApiKeyAuthHeader, ApiKeyAuthQuery

## Schemas

### VatIpItemArray

Array of VAT rate objects for the country resolved from the IP address.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|[[VatIpItem](#vatipitem)]|false|none|Array of VAT rate objects for the country resolved from the IP address.|

### VatIpItem

Each item in the array represents a VAT rate object for the country resolved from the IP.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|country|string|true|none|Country resolved from the IP address.|
|state|string|false|none|State or region resolved from the IP address, for countries with sub-national tax rates (e.g. US). Only present when applicable.|
|type|string|true|none|Tax type for the resolved country (e.g., vat).|
|currency|string|true|none|ISO 4217 currency code for the resolved country.|
|standard_rate|number(float)|true|none|Standard VAT rate as a decimal.|
|reduced_rate|[[VatRateDecimal](#vatratedecimal)]|false|none|Reduced VAT rates (EU/UK only).|
|super_reduced_rate|[[VatRateDecimal](#vatratedecimal)]|false|none|Super-reduced VAT rates (EU/UK only).|
|parking_rate|number(float)|false|none|Parking rate (EU/UK only).|
|categories|[VatCategories](#vatcategories)|false|none|Category-specific VAT rates, where defined (EU/UK only). Keys vary by country.|

### VatRateDecimal

A VAT rate expressed as a decimal (e.g., 0.19 = 19%).

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|*anonymous*|number(float)|false|none|A VAT rate expressed as a decimal (e.g., 0.19 = 19%).|

### VatCategories

Category-specific VAT rates, where defined (EU/UK only). Keys vary by country.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|books|number(float)|false|none|VAT rate for books, as a decimal (e.g., 0.07 = 7%).|
|newspapers|number(float)|false|none|VAT rate for newspapers, as a decimal (e.g., 0.07 = 7%).|
|periodicals|number(float)|false|none|VAT rate for periodicals, as a decimal (e.g., 0.07 = 7%).|
|broadcasting|number(float)|false|none|VAT rate for broadcasting services, as a decimal (e.g., 0.19 = 19%).|

### ErrorResponse

Standard error envelope returned by the API on failed requests.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|error|string|false|none|Short error category or exception type.|
|message|string|true|none|Human-readable error message describing the failure.|
|path|string|false|none|API endpoint path that produced the error.|
|status|integer|false|none|HTTP status code returned with the error.|
|timestamp|string(date-time)|false|none|Timestamp when the error occurred (ISO 8601).|
