The Sales Tax API provides accurate and detailed sales tax breakdowns for every ZIP code, city, and state in the United States.
For VAT rates of European Union countries, please use the VAT API.
https://api.api-ninjas.com/v1/salestax
Returns one or more sales tax breakdowns by ZIP code according to the specified parameters. Each breakdown includes the state sales tax (if any), county sales tax (if any), city sales tax (if any), and any additional special sales taxes. All tax values are presented in decimals (e.g. 0.1
means 10% tax).
Exactly one of the following must be set: zip_code
or (city
+ state
)
zip_code
optionalValid US ZIP code.
city
optionalCity name.
state
optionalState name.
X-Api-Key
requiredAPI Key associated with your account.
zip_code
The ZIP code for which tax information is returned.
state_rate
State sales tax rate as a decimal.
city_rate
premium onlyCity sales tax rate as a decimal.
county_rate
premium onlyCounty sales tax rate as a decimal.
additional_rate
premium onlyAdditional special district sales tax rate as a decimal.
total_rate
premium onlyTotal combined sales tax rate of state, county, city, and additional rates as a decimal.
https://api.api-ninjas.com/v1/salestax?zip_code=90210
Headers
X-Api-Key
Log in or sign up to get your API Key
1
2
3
4
5
6
7
8
9
10
[
{
"zip_code": "90210",
"total_rate": "0.102500",
"state_rate": "0.060000",
"city_rate": "0.007500",
"county_rate": "0.002500",
"additional_rate": "0.032500"
}
]
1
2
3
4
5
6
7
8
9
import requests
zip_code = '90210'
api_url = 'https://api.api-ninjas.com/v1/salestax?zip_code={}'.format(zip_code)
response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'})
if response.status_code == requests.codes.ok:
print(response.text)
else:
print("Error:", response.status_code, response.text)
If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.