{
  "openapi": "3.1.0",
  "info": {
    "title": "NeatAnswer AI API",
    "version": "1.0.0",
    "description": "Current official U.S. figures with sources, and exact calculators. Free, no key."
  },
  "servers": [
    {
      "url": "https://neatanswer.com"
    }
  ],
  "paths": {
    "/api/facts": {
      "get": {
        "operationId": "facts",
        "summary": "List, search or get official figures",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Fact id"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Search words"
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "retirement",
                "tax",
                "social-security",
                "health",
                "everyday"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Facts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/calc": {
      "get": {
        "operationId": "listTools",
        "summary": "List calculators",
        "responses": {
          "200": {
            "description": "Tools"
          }
        }
      }
    },
    "/api/calc/loan_payment": {
      "get": {
        "operationId": "loan_payment",
        "summary": "Monthly payment, total paid and total interest for a fixed-rate loan or mortgage (standard amortization).",
        "description": "Monthly payment, total paid and total interest for a fixed-rate loan or mortgage (standard amortization).",
        "parameters": [
          {
            "name": "principal",
            "in": "query",
            "required": true,
            "description": "Loan amount",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "annual_rate_percent",
            "in": "query",
            "required": true,
            "description": "Yearly interest rate in percent, e.g. 6.5",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "years",
            "in": "query",
            "required": true,
            "description": "Loan term in years",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          }
        }
      }
    },
    "/api/calc/compound_interest": {
      "get": {
        "operationId": "compound_interest",
        "summary": "Future value of savings with compound interest and optional monthly contributions (added at month end).",
        "description": "Future value of savings with compound interest and optional monthly contributions (added at month end).",
        "parameters": [
          {
            "name": "principal",
            "in": "query",
            "required": true,
            "description": "Starting amount",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "annual_rate_percent",
            "in": "query",
            "required": true,
            "description": "Yearly rate in percent",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "years",
            "in": "query",
            "required": true,
            "description": "Number of years",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "compounds_per_year",
            "in": "query",
            "required": false,
            "description": "Default 12",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "monthly_contribution",
            "in": "query",
            "required": false,
            "description": "Default 0",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          }
        }
      }
    },
    "/api/calc/percent_change": {
      "get": {
        "operationId": "percent_change",
        "summary": "Percent change from one value to another.",
        "description": "Percent change from one value to another.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "Old value",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "New value",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          }
        }
      }
    },
    "/api/calc/percent_of": {
      "get": {
        "operationId": "percent_of",
        "summary": "What is X percent of Y.",
        "description": "What is X percent of Y.",
        "parameters": [
          {
            "name": "percent",
            "in": "query",
            "required": true,
            "description": "Percent, e.g. 15",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "of",
            "in": "query",
            "required": true,
            "description": "Base value",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          }
        }
      }
    },
    "/api/calc/unit_convert": {
      "get": {
        "operationId": "unit_convert",
        "summary": "Convert length, mass, volume (US units), area, speed, data size or temperature (c, f, k).",
        "description": "Convert length, mass, volume (US units), area, speed, data size or temperature (c, f, k).",
        "parameters": [
          {
            "name": "value",
            "in": "query",
            "required": true,
            "description": "Number to convert",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "Unit, e.g. mi, kg, gal, f",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "Unit, e.g. km, lb, l, c",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          }
        }
      }
    },
    "/api/calc/date_difference": {
      "get": {
        "operationId": "date_difference",
        "summary": "Days between two dates (YYYY-MM-DD), plus weeks and calendar months.",
        "description": "Days between two dates (YYYY-MM-DD), plus weeks and calendar months.",
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": true,
            "description": "YYYY-MM-DD",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": true,
            "description": "YYYY-MM-DD",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          }
        }
      }
    },
    "/api/calc/add_days": {
      "get": {
        "operationId": "add_days",
        "summary": "Add (or subtract) days to a date. Returns the date and weekday.",
        "description": "Add (or subtract) days to a date. Returns the date and weekday.",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": true,
            "description": "YYYY-MM-DD",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": true,
            "description": "Number of days, negative to subtract",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          }
        }
      }
    },
    "/api/calc/poverty_level_percent": {
      "get": {
        "operationId": "poverty_level_percent",
        "summary": "Household income as a percent of the 2026 HHS federal poverty guideline.",
        "description": "Household income as a percent of the 2026 HHS federal poverty guideline.",
        "parameters": [
          {
            "name": "income",
            "in": "query",
            "required": true,
            "description": "Yearly household income in USD",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "household_size",
            "in": "query",
            "required": true,
            "description": "Number of people",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "contiguous (default), alaska or hawaii",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          }
        }
      }
    },
    "/api/calc/payroll_tax_2027": {
      "get": {
        "operationId": "payroll_tax_2027",
        "summary": "Employee Social Security (6.2% up to $192,300) and Medicare (1.45%) tax on 2027 wages. Excludes the 0.9% Additional Medi",
        "description": "Employee Social Security (6.2% up to $192,300) and Medicare (1.45%) tax on 2027 wages. Excludes the 0.9% Additional Medicare Tax.",
        "parameters": [
          {
            "name": "wages",
            "in": "query",
            "required": true,
            "description": "Yearly wages in USD",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          }
        }
      }
    },
    "/api/calc/retirement_max_2027": {
      "get": {
        "operationId": "retirement_max_2027",
        "summary": "Maximum 2027 employee 401(k)/403(b)/457 deferral and IRA contribution for a given age.",
        "description": "Maximum 2027 employee 401(k)/403(b)/457 deferral and IRA contribution for a given age.",
        "parameters": [
          {
            "name": "age",
            "in": "query",
            "required": true,
            "description": "Age at end of 2027",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          }
        }
      }
    }
  }
}