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, spanning over 12,100 tax jurisdictions.
It also answers the question that comes before the rate lookup: whether you are required to register in a state at all. Economic nexus thresholds are covered for all 50 states and DC.
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.
Available endpoints:
- /v1/salestax - Look up sales tax rates by ZIP code, city, or state
- /v1/salestaxnexus - Check economic nexus thresholds and whether a seller has crossed them
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
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.
Premium only
https://api.api-ninjas.com/v1/salestaxnexus
Returns US sales tax economic nexus thresholds, and optionally determines whether a seller has crossed them. Call it with no sales figures to use it as a reference lookup of each state's rules, or supply your sales figures to get a determination. Omit state to evaluate all 50 states and DC in a single request.
Every nexus or no_nexus answer is provable from the figures you supply. Where your inputs cannot settle the question, the endpoint returns indeterminate together with a required_input array naming exactly which parameter would resolve it, rather than guessing. This matters because states measure different quantities: taxable sales are a subset of retail sales, which are a subset of gross sales, so Florida (which measures taxable sales) and Michigan (which measures gross sales including exempt ones) can reach opposite conclusions on the same seller.
This endpoint evaluates economic nexus only. Physical presence — inventory, employees, offices, contractors, trade shows — can create nexus at any sales volume and is not considered. It is reference data, not tax advice.
This endpoint is available to premium subscribers only. Requests on the free tier return an error.
Parameters
All parameters are optional. With none set, the endpoint returns the threshold rules for every jurisdiction.
stateoptionalTwo-letter US state code or full state name (e.g.
CAorCalifornia). Omit to evaluate all 50 states and DC in one call.gross_salesoptionalAll sales delivered into the state, including taxable, exempt and resale sales.
retail_salesoptionalSales delivered into the state, excluding sales for resale.
taxable_salesoptionalSales delivered into the state, excluding both resale and exempt sales.
revenueoptionalGeneric revenue figure. Use this only when your number is already stated on that state's own measure; otherwise prefer the three specific parameters above, which let the endpoint reason about what it can and cannot prove.
transactionsoptionalNumber of separate sales transactions delivered into the state. Required for a definitive answer in the 18 jurisdictions that still apply a transaction-count test.
marketplace_salesoptionalThe portion of the above sales that was facilitated by a marketplace such as Amazon or Etsy. Required for a definitive answer in states that exclude marketplace sales from the seller's own threshold, such as Arizona, Alabama, Massachusetts and New Jersey.
marketplace_transactionsoptionalThe portion of
transactionsfacilitated by a marketplace.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON object containing a results array with one entry per jurisdiction, or an error if the request is unsuccessful. When sales figures are supplied, a summary object groups the jurisdictions by determination.
stateTwo-letter state code, or
DC.revenue_thresholdRevenue threshold in US dollars, or
nullwhere none applies. 42 jurisdictions use $100,000; California, New York and Texas use $500,000; Alabama and Mississippi use $250,000.transaction_thresholdSeparate-transaction threshold, or
null. Only 18 jurisdictions still apply one. Note that New York's test is more than 100 sales, not 200.threshold_logicHow the two tests combine:
or,and, orrevenue_only. Only Connecticut and New York require both tests to be met.determinationPresent when sales figures are supplied. One of
nexus,no_nexusorindeterminate.has_nexustrue,false, ornullwhen the determination is indeterminate.measureWhich quantity the state measures, such as
taxable_sales,retail_salesorgross_sales, with a plain-languagemeasure_description.evaluation_periodThe lookback window. These are not uniform: most states use a calendar year, but Texas uses the preceding 12 calendar months, New York the preceding four sales tax quarters, and Connecticut the twelve months ending September 30. Florida, Michigan, New Mexico and Rhode Island look only at the previous calendar year.
includes_marketplace_salesWhether marketplace-facilitated sales count toward the seller's own threshold in this state.
collection_start_ruleWhen registration and collection must begin after the threshold is crossed.
reasonandrequired_inputWhy this determination was reached, and — when indeterminate — the exact parameters that would settle it.
statute_cite,source_urlandlast_verifiedThe statutory citation, the primary Department of Revenue source, and the date the rule was last checked against it.
caveatsLimits that apply regardless of your inputs, always including that physical presence is not evaluated, plus any home-rule local complications such as Colorado's self-collecting cities or Louisiana's parishes.
Sample Nexus 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/salestaxnexus?state=TX&gross_sales=750000&transactions=1200Headers
X-Api-KeyLog in or sign up to get your API KeySample Nexus Response
Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/salestaxnexus?state=TX&gross_sales=750000&transactions=1200" \
-H "X-Api-Key: YOUR_API_KEY"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.How do I check whether I have economic sales tax nexus in a state?
The/v1/salestaxnexusendpoint is available to premium subscribers only; requests on the free tier return an error. Send a GET request to it with your sales figures, for example?state=CA&gross_sales=750000&transactions=1200. Omitstateto evaluate all 50 states and DC in a single call, which returns asummaryobject grouping the jurisdictions intonexus,no_nexusandindeterminate. You can also call it with no sales figures at all to use it as a plain reference lookup of each state's thresholds.Why does the nexus endpoint sometimes return indeterminate instead of true or false?
Because states measure different things. Florida measures taxable sales, Michigan measures gross sales including exempt ones, and Minnesota measures retail sales excluding resale. If you send a figure that cannot prove the answer either way, the endpoint returnsdetermination: "indeterminate"along with arequired_inputarray naming exactly which field would settle it, rather than guessing. Anynexusorno_nexusanswer it does return is provable from the figures you supplied.Which sales figures should I send to the nexus endpoint?
Send whichever you have:gross_sales,retail_sales,taxable_sales, andtransactions. Because taxable sales are a subset of retail sales, which are a subset of gross sales, a single figure is often enough to answer definitively even for a state that measures something else. Supplying all three plusmarketplace_salesandmarketplace_transactionsmakes every jurisdiction answerable. Use the genericrevenueparameter only if your figure is already stated on that state's own measure.Do sales made through Amazon or another marketplace count toward my own nexus threshold?
It depends on the state, which is why the endpoint takesmarketplace_salesseparately. Arizona, Alabama, Massachusetts and New Jersey exclude marketplace-facilitated sales from the seller's own threshold, while Alaska, California, DC, Idaho, North Carolina, Nevada, Ohio and South Carolina include them. Each state's treatment is returned in theincludes_marketplace_salesfield.Does the nexus endpoint account for physical presence?
No. It evaluates economic nexus thresholds only. Inventory in a warehouse, a remote employee, an office, contractors or trade-show activity can create nexus at any sales volume, and every response carries this limit in itscaveatsarray. The endpoint is reference data rather than tax advice, and every jurisdiction returns astatute_cite, asource_urland alast_verifieddate so you can check the underlying rule.