NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server

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.

(4.7)

From 10,182 users

2,700+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
276ms297ms324ms701ms1082ms

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_code  optional

    Valid US ZIP code.

  • street_address  optional

    Street address (e.g. 9641 Sunset Blvd). Used together with city and state for the most accurate lookup.

  • city  optional

    City name.

  • state  optional

    State name.

Headers

  • X-Api-Key  required

    API 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_address

    The street address from the request. Only returned when the street_address parameter is provided.

  • zip_code

    The ZIP code for which tax information is returned.

  • state_rate

    State sales tax rate as a decimal.

  • city_rate premium only

    City sales tax rate as a decimal.

  • county_rate premium only

    County sales tax rate as a decimal.

  • additional_rate premium only

    Additional 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_rate premium only

    Total combined sales tax rate of state, county, city, and additional rates as a decimal.

Sample Request Live Demo!

street_address
zip_code
city
state

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%20Blvd

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
[
    {
      street_address:"9641 Sunset Blvd",
      zip_code:"90210",
      state_rate:"0.06",
      city_rate:"0.01",
      county_rate:"0.0025",
      additional_rate:"0.025",
      total_rate:"0.0975"
    }
]

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

  • 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.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • 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.
  • 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.
  • Send a GET request to the /v1/salestax endpoint with exactly one of either a zip_code (a valid US ZIP code) or a city plus state combination; you can optionally add street_address alongside city and state for the most accurate lookup. To compute the actual tax on a purchase amount, pair it with the Sales Tax Calculator API.
  • The API returns a JSON array of breakdown objects with zip_code, state_rate, city_rate, county_rate, additional_rate, and total_rate (and street_address when you provide that parameter), with all values expressed as decimals (e.g. 0.0975 means 9.75%). Note that city_rate, county_rate, additional_rate, and total_rate are premium only fields.
  • 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.
  • The additional_rate field 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 combined total_rate. Both fields are premium only.