API Documentation

Welcome to the SalesTaxIQ API documentation. Our API provides accurate, rooftop-level sales tax rates for any address in the United States.

Getting Started

To use the SalesTaxIQ API, you'll need to:

  1. Sign up for an account
  2. Choose a pricing plan
  3. Get your API key

Authentication

All API requests require authentication using your API key. Include your key in the request headers:

Authorization: Bearer sk_YOUR_API_KEY

Rate Lookup API

Endpoint

POST /api/v1/rates

Request Format

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

Response Format

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

Authentication

Include your API key in the Authorization header:

Authorization: Bearer sk_your_api_key

Error Responses

Status Code Description
400 Missing or invalid required fields
401 Invalid or missing API key
405 Method not allowed (only POST is supported)

Example Request (cURL)

curl -X POST \
  /api/v1/rates \
  -H 'Authorization: Bearer sk_your_api_key' \
  -H 'Content-Type: application/json' \
  -d '{
    "city": "Menlo Park",
    "state": "CA",
    "street": "1 Hacker Way",
    "zip": "94025"
  }'

Code Examples

import requests

api_key = 'sk_your_api_key'
url = '/api/v1/rates'

headers = {
    'Authorization': f'Bearer {api_key}',
    'Content-Type': 'application/json'
}

data = {
    'city': 'Menlo Park',
    'state': 'CA',
    'street': '1 Hacker Way',
    'zip': '94025'
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const axios = require('axios');

const apiKey = 'sk_your_api_key';
const url = '/api/v1/rates';

const data = {
  city: 'Menlo Park',
  state: 'CA',
  street: '1 Hacker Way',
  zip: '94025'
};

axios.post(url, data, {
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json'
  }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    apiKey := "sk_your_api_key"
    url := "/api/v1/rates"

    data := map[string]string{
        "city":   "Menlo Park",
        "state":  "CA",
        "street": "1 Hacker Way",
        "zip":    "94025",
    }

    jsonData, _ := json.Marshal(data)

    req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
    req.Header.Set("Authorization", "Bearer "+apiKey)
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    var result map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&result)
    fmt.Println(result)
}

Try It Out

Response:


                    

Error Handling

The API uses conventional HTTP response codes to indicate success or failure of requests:

Code Description
200 Success
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid API key
429 Too Many Requests - Rate limit exceeded
500 Server Error - Please contact support

Rate Limits

API rate limits vary by plan:

  • Standard: 5,000 requests/month
  • Premium: 50,000 requests/month
  • Enterprise: Custom limits