NAV
shell go javascript python php

Introduction

Welcome to the Sales Tax Rate API by SalesTaxIQ! You can use our API to calculate sales tax rates in real-time. Our tax rates are calculated with ROOFTOP accuracy, eliminating the risk of zip code rate mismatches by providing rates based on precise street address location.

Authentication

SalesTaxIQ uses API keys to allow access to the Tax Rates API. You can register a new API key at our developer portal.

The Tax Rates API expects for the API key to be included in all API requests to the server in a custom header that looks like the following:

X-BLOBR-KEY: API_KEY

Sales Tax Rates

Get a Rate

curl --request POST \
    --url [SUBSCRIPTION_URL]/rates \
    --header 'content-type: application/json' \
    --header 'X-BLOBR-KEY: API_KEY' \
    --data '{
    "street": "1 Hacker Way",
    "city": "Menlo Park",
    "state": "CA",
    "zip": "94025"
}'
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "[SUBSCRIPTION_URL]/rates"

  payload := strings.NewReader("{\"city\": \"Menlo Park\",\"state\": \"CA\",\"street\": \"1 Hacker Way\",\"zip\": \"94025\"}")

  req, _ := http.NewRequest("POST", url, payload)

  req.Header.Add("content-type", "application/json")
  req.Header.Add("X-BLOBR-KEY", "API_KEY")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(string(body))
}
import axios from "axios";

const options = {
  method: 'POST',
  url: '[SUBSCRIPTION_URL]/rates',
  headers: {
    'content-type': 'application/json',
    'X-BLOBR-KEY': 'API_KEY'
  },
  data: {city: 'Menlo Park', state: 'CA', street: '1 Hacker Way', zip: '94025'}
};

axios.request(options).then(function (response) {
  console.log(response.data);
}).catch(function (error) {
  console.error(error);
});
import http.client

conn = http.client.HTTPSConnection("[SUBSCRIPTION_URL]")

payload = "{\"city\": \"Menlo Park\",\"state\": \"CA\",\"street\": \"1 Hacker Way\",\"zip\": \"94025\"}"

headers = {
  'content-type': "application/json",
  'X-BLOBR-KEY': 'API_KEY'
}

conn.request("POST", "/rates", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "[SUBSCRIPTION_URL]/rates",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{
    \"city\": \"Menlo Park\",
    \"state\": \"CA\",
    \"street\": \"1 Hacker Way\",
    \"zip\": \"94025\"
  }",
  CURLOPT_HTTPHEADER => [
    "content-type: application/json",
    "X-BLOBR-KEY: API_KEY"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

The above command returns JSON structured like this:

{
  "tax_on_shipping": false,
  "tax_rate": 9.375
}

Retrieves a tax rate applicable to a specific address. This endpoint accepts address inputs to deliver up-to-date, relevant local tax rates instantly. Output includes shipping taxability.

HTTP Request

POST [SUBSCRIPTION_URL]/rates

Subscription URL can be found in the product details of your API subscription.

Body Example

{ "street": "1 Hacker Way", "city": "Menlo Park", "state": "CA", "zip": "94025" }

Request Body

Key Description
street Street address
city City name
state State code
zip Zip code

Errors

The SalesTaxIQ Tax Rates API uses the following error codes:

Error Code Meaning
400 Bad Request -- Request is invalid.
401 Unauthorized -- Wrong API key.
429 Too Many Requests -- Rate limit hit. Please try again later.
500 Internal Server Error -- We had a problem with our server.
503 Service Unavailable -- We're temporarily offline. Please try again later.