ForHosting KIT · Developer Utilities

APY calculator

The APY API converts a nominal, stated interest rate into the annual percentage yield — the effective annual rate you actually earn once compounding is taken into account.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

A savings account quoting 5% compounded monthly does not pay 5% over a year; it pays 5.116%. You send the nominal rate and the number of compounding periods per year, and the endpoint returns the effective yield, exactly, every time. The same calculation runs free in your browser on this page, so you can verify a number by hand and only pay when you automate it inside a product, a comparison tool, or a compliance check.

Why the nominal rate is not the rate you earn

Banks and lenders advertise a nominal annual rate, but interest is usually credited more than once a year. Each time it is credited, the new interest starts earning interest of its own, so the money grows faster than the headline figure suggests. The gap widens as compounding gets more frequent: 5% compounded yearly is simply 5%, but compounded monthly it becomes about 5.116%, and compounded daily about 5.127%. That effective figure is the APY — the annual percentage yield — and it is the only honest way to compare two products that compound differently. Comparing nominal rates across a daily-compounding savings account and a quarterly-compounding certificate silently favors whichever compounds less often. Regulations in many countries require institutions to disclose APY precisely because nominal rates are misleading, and this endpoint computes that required number from the two inputs every product sheet already contains.

How the calculation works

The formula is the textbook definition of compound interest condensed to one expression: APY equals (1 + r/n) raised to the n-th power, minus 1, where r is the nominal annual rate expressed as a decimal and n is the number of compounding periods per year. With a 5% rate compounded monthly, that is (1 + 0.05/12)^12 − 1 = 0.0511619. The endpoint accepts the rate as a decimal, so 0.05 means 5% — passing 5 would describe a 500% rate and produce an absurd result, which is why the documentation repeats the convention at every step. The periods value must be a positive integer: 1 for yearly, 2 for semiannual, 4 for quarterly, 12 for monthly, 365 for daily. Fractional or zero frequencies have no financial meaning and are rejected with a clear error rather than silently coerced. Results are rounded to ten decimal places so the same input returns byte-identical output on any machine.

Where it fits in a real product

Comparison sites recompute APY on every listed product so the sort order reflects what customers actually earn, not what the marketing page emphasizes. Neobank and fintech backends use it to display the regulator-mandated yield next to each account, derived from the same rate and frequency stored in the product catalog, so a rate change propagates without anyone editing copy. Finance teams validating a term sheet check that the effective rate they were quoted matches the nominal rate and compounding schedule written in the contract — a mismatch is a red flag worth catching before signature. Because the computation is deterministic and has no external dependencies, it runs identically on our edge, in your test suite, and in the free browser widget on this page; the same module serves all three. It costs $0.002 per call through the API, with no data retained after the response is sent.

Rank savings products by true yield

Recompute APY for every account in a comparison tool so the sort order reflects what customers actually earn across different compounding schedules.

Show the regulator-required yield

Derive the disclosed APY from the nominal rate and compounding frequency already stored in your product catalog, with no manual copy edits on rate changes.

Verify a quoted effective rate

Check that the effective annual rate in a term sheet matches the nominal rate and compounding schedule written into the contract before you sign.

What does it cost?

$0.002 per API call. The same calculator is also free to use in your browser on this page.

How do I pass the interest rate?

As a decimal: 0.05 means 5%. Passing 5 describes a 500% nominal rate.

What compounding frequencies are allowed?

Any positive integer: 1 for yearly, 2 for semiannual, 4 for quarterly, 12 for monthly, 365 for daily. Non-integers are rejected.

What is the difference between APR and APY?

APY includes the effect of compounding within the year; APR does not. This endpoint computes APY from a nominal rate and its compounding frequency.

Can the nominal rate be zero or negative?

Zero is allowed and yields an APY of zero. Negative rates are rejected as invalid input.

Is any of my data stored?

No. The calculation is pure arithmetic; nothing is persisted or logged beyond the request itself.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/fin/apy

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/fin/apy \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"nominal_rate":0.05,"periods_per_year":12}'
{
  "nominal_rate": 0.05,
  "periods_per_year": 12
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "fin.apy",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →