Sales Tax Calculator API
The Sales Tax Calculator API provides accurate and detailed sales tax calculations for any purchase amount in the United States, including tax breakdowns and total amounts.
To only get sales tax rate information, please use the Sales Tax API.
/v1/salestaxcalculator GET
https://api.api-ninjas.com/v1/salestaxcalculator
Calculates sales tax for a given amount and location. Returns a detailed breakdown including state, county, city, and special district taxes, along with the calculated tax amount and total amount after tax.
Parameters
amount is required, and exactly one of the following must be set: zip_code or (city + state)
amountrequiredPurchase amount to calculate tax on.
zip_codeoptionalValid US ZIP code.
cityoptionalCity name.
stateoptionalState name.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Returns
zip_codeThe ZIP code for which tax information is returned.
state_rateState sales tax rate as a decimal.
city_ratepremium onlyCity sales tax rate as a decimal.
county_ratepremium onlyCounty sales tax rate as a decimal.
additional_ratepremium onlyAdditional special district sales tax rate as a decimal.
total_ratepremium onlyTotal combined sales tax rate of state, county, city, and additional rates as a decimal.
state_taxThe calculated state sales tax amount.
city_taxpremium onlyThe calculated city sales tax amount.
county_taxpremium onlyThe calculated county sales tax amount.
additional_taxpremium onlyThe calculated additional special district sales tax amount.
total_taxpremium onlyThe total calculated sales tax amount.
total_pricepremium onlyThe total amount including tax.
Sample Request Live Demo!
https://api.api-ninjas.com/v1/salestaxcalculator?zip_code=90210&amount=100Headers
X-Api-KeyLog in or sign up to get your API KeySample Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[
{
"zip_code": "90210",
"state_rate": 0.06,
"total_rate": 0.0975,
"city_rate": 0.01,
"county_rate": 0.0025,
"additional_rate": 0.025,
"state_tax": 6,
"city_tax": 1,
"county_tax": 0.25,
"additional_tax": 2.5,
"total_tax": 9.75,
"total_price": 109.75
}
]Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/salestaxcalculator?amount=100&state=CA" \
-H "X-Api-Key: YOUR_API_KEY"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.