The Income Tax Calculator API calculates detailed tax information based on income, location, and filing status.
Currently this API supports United States (including state income tax and FICA) and Canada (including provincial income tax). If you would like to see other countries added, please let us know.
Only interested in getting current and historical income tax rates? Check out our Income Tax API.
https://api.api-ninjas.com/v1/incometaxcalculator
Returns comprehensive tax calculations including federal, state/provincial, and FICA taxes where applicable.
country
required2-letter country code (e.g., US, CA)
region
requiredState/province code (e.g., CA, NY, ON)
income
requiredAnnual income amount
filing_status
required for USTax filing status (e.g., single, married, head_of_household)
deductions
optionalTotal tax deductions amount
credits
optionalTotal tax credits amount
self_employed
optionalSet to true for self-employed tax calculations (US only)
X-Api-Key
requiredAPI Key associated with your account.
https://api.api-ninjas.com/v1/incometaxcalculator?country=US®ion=CA&income=100000&filing_status=single
Headers
X-Api-Key
Log in or sign up to get your API Key
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"country": "US",
"region": "CA",
"income": 100000,
"taxable_income": 100000,
"deductions": 0,
"credits": 0,
"federal_effective_rate": 0.17053,
"federal_taxes_owed": 17053,
"fica_social_security": 6200,
"fica_medicare": 1450,
"fica_total": 7650,
"region_effective_rate": 0.05952849999999999,
"region_taxes_owed": 5952.849999999999,
"total_taxes_owed": 30655.85,
"income_after_tax": 69344.15,
"total_effective_tax_rate": 0.3065585
}
1
2
3
4
5
6
7
8
9
10
11
12
13
import requests
country = 'US'
region = 'CA'
income = '100000'
filing_status = 'single'
api_url = 'https://api.api-ninjas.com/v1/incometaxcalculator?country={}®ion={}&income={}&filing_status={}'.format(country, region, income, filing_status)
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.