Get your API keys
NAV Logo
Curl PHP Python Ruby Java JavaScript NodeJS Go C#

Introduction

API Endpoint

https://api.taxrates.io

Terms of Service: https://taxrates.io/terms-of-service

Version: 3.0.3

Taxrates.io is a global tax rate service that automates the management of monitoring tax rates changes in 181 countries. We monitor over 14,000 US sales tax, VAT, GST rates for you and make updates via our API so you always have the most update tax rates.

You can use Taxrates.io as a virtual sandbox where we provide you with 30 days free trial.

Countries

We currently support the following countries around the world. If you would like to request the addition of a new country, please email us at support@taxrates.io

Please note that for countries outside of the United States the standard VAT/GST rate is applied except for ebooks where the reduced VAT/GST rate is supported.

AfghanistanGambiaNiger
AlbaniaGeorgiaNigeria
AndorraGermanyNorth Korea
AngolaGhanaNorway
Antigua and BarbudaGreecePakistan
ArgentinaGrenadaPalestine
ArmeniaGuamPanama
ArubaGuatemalaPapua New Guinea
AustraliaGuineaParaguay
AustriaGuyanaPeru
AzerbaijanHaitiPhilippines
BahamasHondurasPoland
BahrainHungaryPortugal
BangladeshIcelandPuerto Rico
BarbadosIndiaRepublic of the Congo
BelarusIndonesiaRomania
BelgiumIranRussian Federation
BelizeIrelandRwanda
BeninIsle of ManSamoa
BhutanIsraelSenegal
BoliviaItalySerbia
BonaireJapanSeychelles
Bosnia and HerzegovinaJerseySierra Leone
BotswanaJordanSingapore
BrazilJordanSlovakia
BulgariaKazakhstanSlovenia
Burkina FasoKenyaSolomon Islands
BurundiKiribatiSomalia
CambodiaKosovoSouth Africa
CameroonKyrgyzstanSouth Korea
Cape VerdeLaosSouth Sudan
Central African RepublicLatviaSpain
ChadLebanonSri Lanka
ChileLesothoSt Lucia
ChinaLiberiaSudan
ColumbiaLiechtensteinSuriname
ComorosLithuaniaSwaziland
Cook IslandsLuxembourgSweden
Costa RicaMacedoniaSwitzerland
Cote d'IvoireMadagascarTahiti
CroatiaMalawiTaiwan
CubaMalaysiaTajikistan
CuracaoMaldivesTanzania
CyprusMaliThailand
Czech RepublicMaltaTogo
Democratic Republic of the CongoMauritaniaTonga
DenmarkMauritiusTrinidad and Tobago
DjboutiMexicoTunisia
DominicaMicronesiaTurkmenistan
Dominican RepublicMoldovaTuvalu
EcuadorMonacoUganda
EgyptMongoliaUkraine
El SalvadorMontenegroUnited Arab Emirates
Equatorial GuineaMoroccoUnited Kingdom
EritreaMozambiqueUnited States
EstoniaMyanmarUruguay
EthiopiaNamibiaVanuatu
FijiNepalVenezuela
FinlandNetherlandsVietnam
FranceNew ZealandYemen
GabonNicaragua

Products codes

The Taxrates.io API’s provides product-level tax rates for a subset of product codes. These codes are to be used for products that are either exempt from tax in some jurisdictions or are taxed at reduced rates.

We will be expanding support for additional, less common categories over time. If you would like to request the addition of a new product category, please email us at support@taxrates.io

Please select a product code/s when making a request to the Taxrates.io API

Product codeProduct Description
C010General Services/Products which are not subject to a service/product-specific tax
C012eBooks - Downloaded
C011Music - Downloaded
C011Movies/Digital Video - Downloaded
C011Streaming Music/Audio Services new
C011Streaming Video Services new
C018Software as a Services, Generally (Remote Access to Hosted Software)
C021Remote Access to Hosted Business Custom Applications
C021Business Data Warehouses
C022Infrastructure as Service, Generally
C022Ecommerce Site/Webserver Hosting
C022Information services
C022Data processing services
C030General Clothing (under $110)
C031Clothing Protective
C032Footwear
C033Clothing Night Wear / Formal Wear / Swim Wear )
C034Shoes (Men / Women / Children / Infant)
C035Vitamins (Nutritional Supplements /Nutritional Mineral Supplements)
C036Personal Care -( Products / Bath & Body / Hair Care Supplies / Skin Care Products / Foot Care)
C037Personal Care (Eye Care)
C038General Foods
C039Foods (Health or Breakfast Bars)
C040Medication (non-prescription) OTC
C041Medication (prescription) OTC
C088Shipping with Handling
C089Shipping

Filtering

When calling the API endpoints you can use 'filter' parameters to get tax rate for the selected type. You can get the following tax types (Each tax rate will always have one of following types)

US Sales tax Rates

  1. CombinedRate
  2. StateRate
  3. CountyRate
  4. CityRate
  5. SPDRate
  6. MTARate

We recommend using Postman when discovering our API. Happy using!

Rate Limiting

We limit API requests.

If you’re exceeding this rate and encountering 429 errors, review the following:

Errors

The Taxrates.io API uses the following error codes:

CodeError Message
400Bad Request – Your request format is bad.
401Unauthorized – Your API key is wrong.
404Not Found – The specified resource could not be found.
405Method Not Allowed – You tried to access a resource with an invalid method.
429Too Many Requests – You’re requesting too many resources! Slow down!
500Internal Server Error – We had a problem with our server. Try again later.
503Service Unavailable – We’re temporarily offline for maintenance. Try again later.

Verify your API token is correct and make sure you’re correctly setting the Authorization header.

If you’re still not sure what’s wrong, contact us and we’ll investigate.

Changelog

Stay on top of new developer-facing features, accuracy improvements, and bug fixes for our API. Have a request? Encounter an issue? We’d love to hear your feedback.

Authentication

ApiKey

Taxrates uses API keys to allow access to the API. If you’re new to Taxrates.io, you’ll need to sign up for an account to get your API key. Otherwise, log in and go to API Access tab to generate a new API token.

Taxrates.io expects the API key to be included in all API requests to the server using a header like the following:

type
apiKey
name
Authorization
in
header

Testing via Postman

Authorization of the API

The following outlines to test each of the endpoints via Postman, if you have any questions please don’t hesitate to contact us support@taxrates.io

Steps

  1. Tab - "Authorization".
  2. Type - "API Key".
  3. Key - "Authorization".
  4. Value - "Apikey your_key".
  5. Add to - "Header".

See screenshot below: Authorization of the API

Tax rates by IP address

Steps to test on Postman

  1. Make sure you are on Params tab
  2. Input an IP address you can use the following:
    US (New York) 72.229.28.185
    Ireland 54.72.254.118
  3. For US sales tax you can add a filter for one of the following tax rates:
    1. CombinedRate
    2. StateRate
    3. CountyRate
    4. CityRate
    5. SpecialRate
  4. Input a product code, see the list “Product codes”
  5. Click “Send”

See the below screenshots: Authorization of the API

Authorization of the API

Tax rates by Country Code

  1. Make sure you are on Params tab
  2. Input a Country 2 digit ISO code
    1. Samples below - see the following link here for a full list
      1. IE = Ireland
      2. IN = India
      3. GB = United Kindgom
  3. For US sales tax you can filter for any of the following sales tax rates
    1. CombinedRate
    2. StateRate
    3. CountyRate
    4. CityRate
    5. SPDRate
    6. MTARate
  4. To get a tax rate for US sales tax you Need a zipcode, for testing use 10001 (New York) Make sure you have New York enabled on your dashboard
  5. Input a product code, see the list “Product codes”
  6. Click “Send”

See the below screenshot: Authorization of the API

Get All tax rates

Steps to Test on Postman

  1. Select a product code in your Taxrates.io dashboard
  2. Select the countries/ states that you want the Tax rates for in your Taxrates dashboard
    1. Note: for US sales tax the reponse will return all the Zipcode’s along the sales tax rates for each State. If all US states are selected than you are dealing with a lot of data (around 39,185 rows).
  3. Make sure you are on Params in Postman
  4. You can filter the type of tax for any of the following types of sales tax rates, note: they are case sensitive
    • CombinedRate
    • StateRate
    • CountyRate
    • CityRate
    • SPDRate
    • MTARate
  5. Taxrates.io will only return 500 rates at a time,(It's a large amount of data so we will send more with one response) to leave the cursor empty for the first page and use value form “X-Cursor-Next” header for the next one. See below to get all the tax rates in the responses:
    1. Send the first request
    2. Check the tab with response headers
    3. If there is a X-Next-Cursor - use it for the "cursor" parameter to get the next page
    4. If there is no header/ X-Next-Cursor - this is the last page

Endpoints

All tax rates

                                curl "https://api.taxrates.io/api/v3/tax/rates?filter=CityRate&cursor=103862" \
  -H "Authorization: Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R"

                            
                                $ch = curl_init('https://api.taxrates.io/api/v3/tax/rates?filter=CityRate&cursor=103862');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R',
]);
$result = curl_exec($ch);

                            
                                import requests

response = requests.get(
    'https://api.taxrates.io/api/v3/tax/rates',
    params={'filter': 'CityRate', 'cursor': 103862},
    headers={'Authorization': 'Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R'}
)

                            
                                require 'faraday'

Faraday.new('https://api.taxrates.io/api/v3/tax/rates?filter=CityRate&cursor=103862', headers: { 'Authorization' => 'Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R' }).get

                            
                                URL url = new URL("https://api.taxrates.io/api/v3/tax/rates?filter=CityRate&cursor=103862");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestProperty("Authorization", "Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R");
InputStream responseStream = connection.getInputStream();

                            
                                fetch(url + 'https://api.taxrates.io/api/v3/tax/rates?filter=CityRate&cursor=103862', {
    method: 'GET',
    headers: {
        'Authorization': 'Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R'
    }
}).then(res => res.json());

                            
                                const axios = require("axios");

const baseUrl = "https://api.taxrates.io/api/v3/tax/rates";

axios.get(baseUrl, {
  params: {
    filter: 'CityRate',
    cursor: 103862
  },
  headers: {
    Authorization: 'Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R',
  }
}).then(res => console.log(res.data));

                            
                                import "net/http"

req, err := http.NewRequest("GET", "https://api.taxrates.io/api/v3/tax/rates?filter=CityRate&cursor=103862", nil)
req.Header.Add("Authorization", "Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R")
client := &http.Client{}
resp, err := client.Do(req)

                            
                                using System.Net.Http;
using System.Net.Http.Headers;

var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R");
HttpResponseMessage response = await client.GetAsync("https://api.taxrates.io/api/v3/tax/rates?filter=CityRate&cursor=103862");

                            

US Sales tax sample response:

                [
    {
        "id": "34314",
        "name": "United States",
        "code": "US",
        "state": "Texas",
        "zip": "75070",
        "metadata": {
            "city": "MCKINNEY",
            "city_number": "2043045",
            "county": "COLLIN",
            "county_number": "n\/a",
            "spd": "n\/a",
            "spd_number": "n\/a",
            "mta": "n\/a",
            "mta_number": ""
        },
        "rates": [
            {
                "type": "CombinedRate",
                "data_name": "Rate",
                "data_value": "8.250",
                "product_code": "C010",
                "product_code_description": "General Services"
            },
            {
                "type": "StateRate",
                "data_name": "Rate",
                "data_value": "6.250",
                "product_code": "C010",
                "product_code_description": "General Services"
            },
            {
                "type": "CountyRate",
                "data_name": "Rate",
                "data_value": "0.000",
                "product_code": "C010",
                "product_code_description": "General Services"
            },
            {
                "type": "CityRate",
                "data_name": "Rate",
                "data_value": "2.000",
                "product_code": "C010",
                "product_code_description": "General Services"
            },
            {
                "type": "SPDRate",
                "data_name": "Rate",
                "data_value": "0.000",
                "product_code": "C010",
                "product_code_description": "General Services"
            },
            {
                "type": "MTARate",
                "data_name": "Rate",
                "data_value": "0.000",
                "product_code": "C010",
                "product_code_description": "General Services"
            }
        ]
    }
]
            

For countries outside of the US:

                [
    {
        "id": "144",
        "name": "United Kingdom",
        "code": "GB",
        "state": null,
        "zip": null,
        "metadata": [],
        "rates": [
            {
                "type": "standard",
                "data_name": "Rate",
                "data_value": "20.000",
                "product_code": "C010",
                "product_code_description": "General Services"
            }
        ]
    }
]
            

Get request. This method returns all tax rates configured on your account. Based on your country selection the endpoint will return all taxes for all countries. You can use the 'filter' parameter to narrow results to selected type of tax. Use 'zip' parameter when you have selected the United States.

We have development an easy to use scheduler so you can call the API to get the rates every hour or day. Please click on the following link to see the code on Github.

Please note in cases when a US state doesn't have sales tax and when a product is tax exempt for a zip code or for a state the API response will be "null"

To get a response you need to have selected a product code in your Taxrates.io dashboard, please see the Introduction section above for description of the different types of product codes.

For US sales tax you can filter the tax rate you want for each state or zip code with one of the following: (they are case sensitive)

HTTP Request

GET /v3/tax/rates

Request Parameters

filter: string

in query
You can filter your taxes by one of following types: 'standard', 'CombinedRate', 'CountyRate', 'CityRate', 'SPDRate' and 'MTARate'.

cursor: string

in query
Cursor shows from which record you want to get information. Default value is 0, next value can be retrieved from X-Cursor-Next header.

Responses

200 OK

An array of locations with tax rates

404 Not Found

No configured tax rates found. Have you added any country to your account?

500 Internal Server Error

Unexpected error

Tax rates by IP address

                                curl "https://api.taxrates.io/api/v1/tax/ip?ip=208.80.152.201&product_codes[]=C010&filter=CountyRate&date=2020-10-01" \
  -H "Authorization: Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R"

                            
                                $ch = curl_init('https://api.taxrates.io/api/v1/tax/ip?ip=208.80.152.201&product_codes[]=C010&filter=CountyRate&date=2020-10-01');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R',
]);
$result = curl_exec($ch);

                            
                                import requests

response = requests.get(
    'https://api.taxrates.io/api/v1/tax/ip',
    params={'ip': '208.80.152.201', 'product_codes[]': ['C010'], 'filter': 'CountyRate', 'date': '2020-10-01'},
    headers={'Authorization': 'Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R'}
)

                            
                                require 'faraday'

Faraday.new('https://api.taxrates.io/api/v1/tax/ip?ip=208.80.152.201&product_codes[]=C010&filter=CountyRate&date=2020-10-01', headers: { 'Authorization' => 'Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R' }).get

                            
                                URL url = new URL("https://api.taxrates.io/api/v1/tax/ip?ip=208.80.152.201&product_codes[]=C010&filter=CountyRate&date=2020-10-01");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestProperty("Authorization", "Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R");
InputStream responseStream = connection.getInputStream();

                            
                                fetch('https://api.taxrates.io/api/v1/tax/ip?ip=208.80.152.201&product_codes[]=C010&filter=CountyRate&date=2020-10-01', {
    method: 'GET',
    headers: {
        'Authorization': 'Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R'
    }
}).then(res => res.json());

                            
                                const axios = require("axios");

const baseUrl = "https://api.taxrates.io/api/v1/tax/ip";

axios.get(baseUrl, {
  params: {
    ip: '208.80.152.201',
    product_codes: ['C010'],
    filter: 'CountyRate',
    date: '2020-10-01'
  },
  headers: {
    Authorization: 'Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R',
  }
}).then(res => console.log(res.data));

                            
                                import "net/http"

req, err := http.NewRequest("GET", "https://api.taxrates.io/api/v1/tax/ip?ip=208.80.152.201&product_codes[]=C010&filter=CountyRate&date=2020-10-01", nil)
req.Header.Add("Authorization", "Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R")
client := &http.Client{}
resp, err := client.Do(req)

                            
                                using System.Net.Http;
using System.Net.Http.Headers;

var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R");
HttpResponseMessage response = await client.GetAsync("https://api.taxrates.io/api/v1/tax/ip?ip=208.80.152.201&product_codes[]=C010&filter=CountyRate&date=2020-10-01");

                            

US Sales Tax sample response:

                [
    {
        "country_name": "United States",
        "country_code": "US",
        "taxes": [
            {
                "Country": "United States",
                "CountryCode": "US",
                "Type": "CityRate",
                "ProductCode": "C010",
                "ProductCodeDescription": "General Services",
                "data_name": "Rate",
                "data_value": "4.500",
                "metadata": {
                    "City": "MANHATTAN",
                    "CityNumber": "8081"
                },
                "State": "New York"
            },
            {
                "Country": "United States",
                "CountryCode": "US",
                "Type": "CombinedRate",
                "ProductCode": "C010",
                "ProductCodeDescription": "General Services",
                "data_name": "Rate",
                "data_value": "8.875",
                "metadata": {
                    "Zip": "10004"
                },
                "State": "New York"
            },
            {
                "Country": "United States",
                "CountryCode": "US",
                "Type": "CountyRate",
                "ProductCode": "C010",
                "ProductCodeDescription": "General Services",
                "data_name": "Rate",
                "data_value": "0.000",
                "metadata": {
                    "County": "NEW YORK",
                    "CountyNumber": "8051"
                },
                "State": "New York"
            },
            {
                "Country": "United States",
                "CountryCode": "US",
                "Type": "MTARate",
                "ProductCode": "C010",
                "ProductCodeDescription": "General Services",
                "data_name": "Rate",
                "data_value": "0.375",
                "metadata": {
                    "MTA": "n\/a",
                    "MTANumber": ""
                },
                "State": "New York"
            },
            {
                "Country": "United States",
                "CountryCode": "US",
                "Type": "SPDRate",
                "ProductCode": "C010",
                "ProductCodeDescription": "General Services",
                "data_name": "Rate",
                "data_value": "0.000",
                "metadata": {
                    "SPD": "n\/a",
                    "SPDNumber": "n\/a"
                },
                "State": "New York"
            },
            {
                "Country": "United States",
                "CountryCode": "US",
                "Type": "StateRate",
                "ProductCode": "C010",
                "ProductCodeDescription": "General Services",
                "data_name": "Rate",
                "data_value": "4.000",
                "metadata": [],
                "State": "New York"
            }
        ]
    }
]
            

For countries outside of the US:

                [
    {
        "country_name": "Ireland",
        "country_code": "IE",
        "taxes": [
            {
                "Country": "Ireland",
                "CountryCode": "IE",
                "Type": "standard",
                "ProductCode": "C010",
                "ProductCodeDescription": "General Services",
                "data_name": "Rate",
                "data_value": "21.000",
                "metadata": []
            }
        ]
    }
]
            

Get request. This method returns all tax rates for country discovered on either your IP address or IP address param. The IP param is not required. When empty, the taxrates.io will try to discover your IP address and based on this will retrieve the tax rates. You can use 'filter' parameter to narrow results to selected type of tax

For US sales tax you can filter the tax rate you want for each state or zip code with one of the following: (they are case sensitive)

HTTP Request

GET /v1/tax/ip

Request Parameters

ip: string

required

in query
Customer's IP address

filter: string

in query
You can filter your taxes by one of following types: 'standard', 'CombinedRate', 'CountyRate', 'CityRate', 'SPDRate' and 'MTARate'.

product_codes: string[]

required

in query
You can filter your taxes by product codes.

date: string (yyyy-mm-dd)

in query
You can filter your taxes by date in the past.

Responses

200 OK

An array of tax rates for VAT, GST & TAX

404 Not Found

Geolocation can not be processed/No matching country found

500 Internal Server Error

Unexpected error

Tax rates by Country Code

                                // United States
curl "https://api.taxrates.io/api/v1/tax/countrycode?country_code=US&product_codes[]=C010&filter=StateRate&zip=10001" \
  -H "Authorization: Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R"
// Canada
curl "https://api.taxrates.io/api/v1/tax/countrycode?country_code=CA&product_codes[]=C010&filter=GST&province=Quebec" \
  -H "Authorization: Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R"
// Others
curl "https://api.taxrates.io/api/v1/tax/countrycode?country_code=IE&product_codes[]=C010&date=2020-10-01" \
  -H "Authorization: Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R"

                            
                                $url = 'https://api.taxrates.io/api/v1/tax/countrycode?product_codes[]=C010'; if ($country === 'United States') {
  $url .= '&country_code=US&filter=StateRate&zip=10001';
} elseif ($country === 'Canada') {
  $url .= '&country_code=CA&filter=GST&province=Quebec';
} else {
  $url .= '&country_code=IE&date=2020-10-01';
} $ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R',
]);
$result = curl_exec($ch);

                            
                                import requests

payload = {'product_codes[]': ['C010']}
if country == 'United States':
  payload.update({'country_code': 'US', 'filter': 'StateRate', 'zip': 10001})
elif country === 'Canada':
  payload.update({'country_code': 'CA', 'filter': 'GST', 'province': 'Quebec'})
else:
  payload.update({'country_code': 'IE', 'date': '2020-10-01'})
response = requests.get(
    'https://api.taxrates.io/api/v1/tax/countrycode',
    params=payload,
    headers={'Authorization': 'Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R'}
)

                            
                                require 'faraday'

url = "https://api.taxrates.io/api/v1/tax/countrycode?product_codes[]=C010"
if country == 'United States':
  url += "country_code=US&filter=StateRate&zip=10001"
elsif country == 'Canada':
  url += "country_code=CA&filter=GST&province=Quebec"
else:
  url += "country_code=IE&date=2020-10-01"
Faraday.new(url, headers: { 'Authorization' => 'Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R' }).get

                            
                                String spec = "https://api.taxrates.io/api/v1/tax/countrycode?product_codes[]=C010";
if (country == "United States") {
  spec += "&country_code=US&filter=StateRate&zip=10001";
} else if (country == "Canada") {
  spec += "&country_code=CA&filter=GST&province=Quebec";
} else {
  spec += "&country_code=IE&date=2020-10-01";
}
URL url = new URL(spec);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestProperty("Authorization", "Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R");
InputStream responseStream = connection.getInputStream();

                            
                                let url = 'https://api.taxrates.io/api/v1/tax/countrycode?product_codes[]=C010';
if (country === 'United States') {
    url += '&country_code=US&filter=StateRate&zip=10001'
} else if (country === 'Canada') {
    url += '&country_code=CA&filter=GST&province=Quebec';
} else {
    url += '&country_code=IE&date=2020-10-01';
}
fetch(url, {
    method: 'GET',
    headers: {
        'Authorization': 'Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R'
    }
}).then(res => res.json());

                            
                                const axios = require("axios");

const baseUrl = "https://api.taxrates.io/api/v1/tax/countrycode";

let params = {
  product_codes: ['C010']
}

if (country === 'United States') {
  params = Object.assign(params, {
    country_code: 'US',
    filter: 'StateRate',
    zip: 10001
  })
} else if (country === 'Canada') {
  params = Object.assign(params, {
    country_code: 'CA',
    filter: 'GST',
    province: 'Quebec'
  })
} else {
  params = Object.assign(params, {
    country_code: 'IE',
    date: '2020-10-01'
  })
}
axios.get(baseUrl, {
  params,
  headers: {
    Authorization: 'Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R',
  }
}).then(res => console.log(res.data));

                            
                                import {
  "net/http"
  "bytes"
}

var url bytes.Buffer
if country == 'United States' {
  url.WriteString("&country_code=US&filter=StateRate&zip=10001")
} else if country == 'Canada' {
  url.WriteString("&country_code=CA&filter=GST&province=Quebec")
} else {
  url.WriteString("&country_code=IE&date=2020-10-01")
}
req, err := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R")
client := &http.Client{}
resp, err := client.Do(req)

                            
                                using System.Net.Http;
using System.Net.Http.Headers;

string url = "https://api.taxrates.io/api/v1/tax/countrycode?product_codes[]=C010";
if (country == "United States") {
  url += "&country_code=US&filter=StateRate&zip=10001";
} else if (country == "Canada") {
  url += "&country_code=CA&filter=GST&province=Quebec";
} else {
  url += "&country_code=IE&date=2020-10-01";
}
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Apikey PylBOdnULv0EGLCSm1FHhGrpiYh3o9cBdb4R");
HttpResponseMessage response = await client.GetAsync(url);

                            

US Sales tax sample response:

                [
    {
        "country_name": "United States",
        "country_code": "US",
        "taxes": [
            {
                "Country": "United States",
                "CountryCode": "US",
                "Type": "CityRate",
                "ProductCode": "C010",
                "ProductCodeDescription": "C010",
                "data_name": "Rate",
                "data_value": "1.250",
                "metadata": {
                    "City": "CROSSEST",
                    "CityNumber": "43863"
                },
                "State": "Arkansas"
            },
            {
                "Country": "United States",
                "CountryCode": "US",
                "Type": "CombinedRate",
                "ProductCode": "C010",
                "ProductCodeDescription": "C010",
                "data_name": "Rate",
                "data_value": "9.250",
                "metadata": {
                    "Zip": "71642"
                },
                "State": "Arkansas"
            },
            {
                "Country": "United States",
                "CountryCode": "US",
                "Type": "CountyRate",
                "ProductCode": "C010",
                "ProductCodeDescription": "C010",
                "data_name": "Rate",
                "data_value": "1.500",
                "metadata": {
                    "County": "ASHLEY",
                    "CountyNumber": "02-00"
                },
                "State": "Arkansas"
            },
            {
                "Country": "United States",
                "CountryCode": "US",
                "Type": "MTARate",
                "ProductCode": "C010",
                "ProductCodeDescription": "C010",
                "data_name": "Rate",
                "data_value": "0.000",
                "metadata": {
                    "MTA": "n\/a",
                    "MTANumber": ""
                },
                "State": "Arkansas"
            },
            {
                "Country": "United States",
                "CountryCode": "US",
                "Type": "SPDRate",
                "ProductCode": "C010",
                "ProductCodeDescription": "C010",
                "data_name": "Rate",
                "data_value": "0.000",
                "metadata": {
                    "SPD": "n\/a",
                    "SPDNumber": "n\/a"
                },
                "State": "Arkansas"
            },
            {
                "Country": "United States",
                "CountryCode": "US",
                "Type": "StateRate",
                "ProductCode": "C010",
                "ProductCodeDescription": "C010",
                "data_name": "Rate",
                "data_value": "6.500",
                "metadata": [],
                "State": "Arkansas"
            }
        ]
    }
]
            

For countries outside of the US:

                [
    {
        "country_name": "United Kingdom",
        "country_code": "GB",
        "taxes": [
            {
                "Country": "United Kingdom",
                "CountryCode": "GB",
                "Type": "standard",
                "ProductCode": "C010",
                "ProductCodeDescription": "C010",
                "data_name": "Rate",
                "data_value": "20.000",
                "metadata": []
            }
        ]
    }
]
            

Get request. This method returns all tax rates for country discovered based on country code. The country code must be 2 letters ISO 3166-1 alfa-2 country code (see here for more information). You can use 'filter' parameter to narrow results to selected type of tax

For US sales tax you can filter the tax rate you want for each state or zip code with one of the following: (they are case sensitive)

HTTP Request

GET /v1/tax/countrycode

Request Parameters

country_code: string

required

in query
Country code alpha 2

filter: string

in query
You can filter your taxes by one of following types: 'standard', 'CombinedRate', 'CountyRate', 'CityRate', 'SPDRate' and 'MTARate'.

zip: string

in query
You must provide a zip code if one of your selected countries is United States and you've had selected a state on your Taxrates.io member's dashboard.

province: string

in query
Must be used if country is Canada; it can be a 2 digit or the full name of the province, see link for provinces https://www.ncbi.nlm.nih.gov/books/NBK7254/

product_codes: string[]

required

in query
You can filter your taxes by product codes.

date: string (yyyy-mm-dd)

in query
You can filter your taxes by date in the past.

Responses

200 OK

Success

404 Not Found

Country not found. Have you provided correct alpha-2 country code?

500 Internal Server Error

Unexpected error

Schema Definitions

Rates: object

                        {
    "country_name": "string",
    "country_code": "string",
    "taxes": [
        {
            "Country": "string",
            "CountryCode": "string",
            "Type": "string",
            "ProductCode": "string",
            "ProductCodeDescription": "string",
            "data_name": "string",
            "data_value": "string",
            "metadata": "object"
        }
    ]
}
                    
country_name: string
The country name
country_code: string
The country code
taxes: array
Tax

Tax: object

                        {
    "Country": "string",
    "CountryCode": "string",
    "Type": "string",
    "ProductCode": "string",
    "ProductCodeDescription": "string",
    "data_name": "string",
    "data_value": "string",
    "metadata": "object"
}
                    
Country: string
The country name
CountryCode: string
The country code
Type: string
The tax type
ProductCode: string
The product code
ProductCodeDescription: string
The product code description
data_name: string
The tax name and description (VAT, GST, PIT, CIT etc)
data_value: string
The tax value in percents
metadata: object
Map, values are strings and possible keys are City, CityNumber, County, CountyNumber, SPD, SPDNumber, MTA, MTANumber, Zip

Error: object

                        {
    "code": "integer (int32)",
    "message": "string",
    "fields": "string"
}
                    
code: integer (int32)
message: string
fields: string

TaxRate: object

                        {
    "type": "string",
    "data_name": "string",
    "data_value": "string",
    "product_code": "string",
    "product_code_description": "string"
}
                    
type: string
The tax type
data_name: string
The tax name and description (VAT, GST, PIT, CIT etc)
data_value: string
The tax value in percents
product_code: string
Product code
product_code_description: string
Product code description

Location: object

                        {
    "id": "integer",
    "name": "string",
    "code": "string",
    "state": "string",
    "zip": "string",
    "metadata": "object",
    "rates": [
        {
            "type": "string",
            "data_name": "string",
            "data_value": "string",
            "product_code": "string",
            "product_code_description": "string"
        }
    ]
}
                    
id: integer
name: string
Country name
code: string
Country code
state: string
State/province name if exists
zip: string
Zipcode
metadata: object
Map, values are strings and possible keys are city, city_number, county, county_number, spd, spd_number, mta, mta_number
rates: array
TaxRate