OSI Finance REST API v1.0
Tax-Related Computations
Calculate federal adjusted gross income (AGI)
1 min
code examples curl location 'https //osifinance com/api/v1/federal adjusted gross income (agi)' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{"body" {"api key" "string","sources"\ false,"filing status" "single","income" 100000,"capital gains short" 0,"dependents" 0,"birth year" 1990,"filers over 65" 0,"traditional esp contributions" 0,"traditional ira contributions" 0,"pmi" 0}}'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "body" { "api key" "string", "sources" false, "filing status" "single", "income" 100000, "capital gains short" 0, "dependents" 0, "birth year" 1990, "filers over 65" 0, "traditional esp contributions" 0, "traditional ira contributions" 0, "pmi" 0 } }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //osifinance com/api/v1/federal adjusted gross income (agi)", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //osifinance com/api/v1/federal adjusted gross income (agi)") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "body" { "api key" "string", "sources" false, "filing status" "single", "income" 100000, "capital gains short" 0, "dependents" 0, "birth year" 1990, "filers over 65" 0, "traditional esp contributions" 0, "traditional ira contributions" 0, "pmi" 0 } }) response = https request(request) puts response read body import requests import json url = "https //osifinance com/api/v1/federal adjusted gross income (agi)" payload = json dumps({ "body" { "api key" "string", "sources" false, "filing status" "single", "income" 100000, "capital gains short" 0, "dependents" 0, "birth year" 1990, "filers over 65" 0, "traditional esp contributions" 0, "traditional ira contributions" 0, "pmi" 0 } }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // ok { "status" "", "data" { "tax type" {}, "marginal tax rate" {}, "effective tax rate" {}, "2023 taxes" {} }, "sources" {} }// bad request { "error" "" }// unauthorized { "error" "" }// not found { "error" "" }// too many requests { "error" "" }// internal server error { "error" "" }