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.
From 6,867 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 278ms | 308ms | 369ms | 584ms | 1081ms |
Didn't find what you were looking for? Suggest an improvement
/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.
street_addressoptionalStreet address (e.g.
9641 Sunset Blvd). Used together withcityandstatefor the most accurate lookup.cityoptionalCity name.
stateoptionalState name.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.
street_addressThe street address from the request. Only returned when the
street_addressparameter is provided.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. Some local governments may have multiple additional rates, in which case this field will contain the sum of all additional rates.
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?amount=100&zip_code=90210&street_address=9641%20Sunset%20BlvdHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/salestaxcalculator?zip_code=90210&amount=100" \
-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.
Frequently Asked Questions
Can I use the Sales Tax Calculator API for commercial purposes?
Yes, but you must have a premium subscription. Commercial use of the Sales Tax Calculator API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.How do I get an API key and start using the Sales Tax Calculator API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.What happens if a request to the Sales Tax Calculator API fails?
The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.How do I calculate sales tax for a specific location?
Set the requiredamountparameter to the purchase price, then specify a location with eitherzip_codeor the combination ofcityandstate; you can also passstreet_addressalongsidecityandstatefor the most accurate lookup. If you only need rate information without a calculation, use the Sales Tax API instead.What does the response include?
Each result returns a full breakdown includingstate_rate,city_rate,county_rate, andadditional_rate, plus the calculatedstate_tax,city_tax,county_tax,additional_tax,total_tax, and thetotal_priceafter tax. Most detailed fields beyond the state-level data are premium only.What are some use cases for the Sales Tax Calculator API?
It is ideal for e-commerce checkout flows, point-of-sale systems, and invoicing tools that need accurate US sales tax on a purchaseamountfor any region, including state, county, city, and special district taxes. Pair it with the Income Tax Calculator or Mortgage Calculator to build a broader suite of financial tools.Does the calculator account for special district taxes?
Yes, theadditional_ratefield captures special district sales tax, and when a local government has multiple additional rates it returns the sum of all of them, which is also reflected inadditional_taxand the combinedtotal_rate. See our APIs for related financial endpoints.