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.

/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.

  • city  optional

    City name.

  • state  optional

    State name.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Sample Request Live Demo!

zip_code
https://api.api-ninjas.com/v1/salestax?zip_code=90210

Headers

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

Sample Response

JSON
1 2 3 4 5 6 7 8 9 10 [ { "zip_code": "90210", "total_rate": "0.102500", "state_rate": "0.060000", "city_rate": "0.007500", "county_rate": "0.002500", "additional_rate": "0.032500" } ]

Code Examples

1 2 3 4 5 6 7 8 9 import requests zip_code = '90210' api_url = 'https://api.api-ninjas.com/v1/salestax?zip_code={}'.format(zip_code) response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'}) if response.status_code == requests.codes.ok: print(response.text) else: print("Error:", response.status_code, response.text)

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.