Sales Tax API
The Sales Tax API provides accurate and detailed sales tax breakdowns for every ZIP code, city, and state in the United States.
To calculate sales tax for a given amount, please use the Sales Tax Calculator API.
For VAT rates of European Union countries, please use the VAT Rates API.
From 10,182 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 276ms | 297ms | 324ms | 701ms | 1082ms |
Didn't find what you were looking for? Suggest an improvement
/v1/salestax GET
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).
Parameters
Exactly one of the following must be set: zip_code or (city + state)
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.
Sample Request Live Demo!
Try our APIs in the API playground
Sign up for a free API key to get started — no credit card required.
https://api.api-ninjas.com/v1/salestax?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/salestax?zip_code=90210" \
-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 API for commercial purposes?
Yes, but you must have a premium subscription. Commercial use of the Sales Tax 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 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 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 look up sales tax for a specific location?
Send a GET request to the/v1/salestaxendpoint with exactly one of either azip_code(a valid US ZIP code) or acityplusstatecombination; you can optionally addstreet_addressalongsidecityandstatefor the most accurate lookup. To compute the actual tax on a purchase amount, pair it with the Sales Tax Calculator API.What does the Sales Tax API response include?
The API returns a JSON array of breakdown objects withzip_code,state_rate,city_rate,county_rate,additional_rate, andtotal_rate(andstreet_addresswhen you provide that parameter), with all values expressed as decimals (e.g.0.0975means 9.75%). Note thatcity_rate,county_rate,additional_rate, andtotal_rateare premium only fields.What coverage and data does the Sales Tax API provide?
It provides accurate, detailed sales tax breakdowns for every ZIP code, city, and state in the United States, separating state, county, city, and special district rates. For other tax types, see related APIs such as Income Tax, Property Tax, and the VAT Rates API for European Union rates.How is the additional_rate field calculated when a location has multiple special taxes?
Theadditional_ratefield reflects special district sales taxes, and when a local government has multiple additional rates it contains the sum of all of them, which is then folded into the combinedtotal_rate. Both fields are premium only.