NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server →
Benchmark Interest Rates

SOFR API

The Secured Overnight Financing Rate (SOFR) is a broad measure of the cost of borrowing cash overnight with US Treasury securities as collateral. It is the main US dollar benchmark rate, used in loans, mortgages, bonds and derivatives in place of USD LIBOR.

With the Interest Rate API you can:

  • Get the latest SOFR value and the date it applies to
  • Download daily SOFR history since April 2018
  • Get the 30-, 90- and 180-day SOFR averages from the same endpoints
  • Use the same two endpoints for central bank rates and other benchmarks
Online
(4.4)

From 3,856 users

1,000+

Application used this API in the last 28 days.

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
328ms370ms381ms718ms999ms

Didn't find what you were looking for? Suggest an improvement

SOFR at a glance

Full nameSecured Overnight Financing Rate
CurrencyUS dollar (USD)
AdministratorFederal Reserve Bank of New York
PublishedEach US business day, for the previous business day
Daily historySince April 2018
Rate codessofr
sofr_30d_avg
sofr_90d_avg
sofr_180d_avg

/v2/interestrate GET Premium only

https://api.api-ninjas.com/v2/interestrate

Returns the latest SOFR value and the date it applies to.


Parameters

  • rate  required

    Use one of: sofr (SOFR (overnight)), sofr_30d_avg (SOFR 30-day average), sofr_90d_avg (SOFR 90-day average), sofr_180d_avg (SOFR 180-day average). See the full list of supported rates.

Headers

  • X-Api-Key

    API Key associated with your account.

Response

A JSON object with the following fields or an error if the request is unsuccessful.

  • rate_name

    The name of the rate (e.g. SOFR).

  • rate_pct

    The rate as a percentage.

  • last_updated

    The date the rate applies to.

Live Demo

Live demo
Query parameters
rate

Get a free API key to get started — no credit card required.

Headers
X-Api-KeyLog in or sign up to get your API key
GET
https://api.api-ninjas.com/v2/interestrate?rate=sofr
Sample response
{
"rate_name": "SOFR",
"rate_pct": 3.91,
"last_updated": "11-19-2026"
}

Code Examples

curl -X GET "https://api.api-ninjas.com/v2/interestrate?rate=sofr" \ -H "X-Api-Key: YOUR_API_KEY"

/v2/interestratehistorical GET Premium only

https://api.api-ninjas.com/v2/interestratehistorical

Returns daily SOFR values, oldest first, up to 100 per call. When there is more data in the range, the response includes a next cursor: pass it back as the page parameter to get the following page.

Parameters

  • rate  required

    Use one of: sofr (SOFR (overnight)), sofr_30d_avg (SOFR 30-day average), sofr_90d_avg (SOFR 90-day average), sofr_180d_avg (SOFR 180-day average).

  • start_date  optional

    Start date for the data range (inclusive) in YYYY-MM-DD format, e.g. 2026-11-10. Dates are in UTC.

  • end_date  optional

    End date for the data range (inclusive) in YYYY-MM-DD format. Dates are in UTC.

  • start_time  optional

    Start of the data range as a UNIX timestamp in seconds. Alternative to start_date; do not set both.

  • end_time  optional

    End of the data range as a UNIX timestamp in seconds. Alternative to end_date; do not set both.

  • page  optional

    Pagination cursor. Pass the next value from a previous response to get the following page.

Headers

  • X-Api-Key

    API Key associated with your account.

Response

A JSON object with the following fields or an error if the request is unsuccessful.

  • name

    The name of the rate (e.g. SOFR).

  • data

    Array of daily data points, oldest first, each with timestamp (UNIX timestamp in seconds), date (the date the rate applies to, YYYY-MM-DD) and rate_pct (the rate as a percentage).

  • next

    Cursor for the next page of data points, or null when there are no more.

Live Demo

Live demo
Query parameters
rate
start_date
end_date

Get a free API key to get started — no credit card required.

Headers
X-Api-KeyLog in or sign up to get your API key
GET
https://api.api-ninjas.com/v2/interestratehistorical?rate=sofr&start_date=2026-11-10
Sample response
{
"name": "SOFR",
"data": [
{
"timestamp": 1794268800,
"date": "2026-11-10",
"rate_pct": 3.89
},
{
"timestamp": 1794441600,
"date": "2026-11-12",
"rate_pct": 3.9
},
{
"timestamp": 1794528000,
"date": "2026-11-13",
"rate_pct": 3.9
},
{
"timestamp": 1794787200,
"date": "2026-11-16",
"rate_pct": 3.93
},
{
"timestamp": 1794873600,
"date": "2026-11-17",
"rate_pct": 3.92
},
{
"timestamp": 1794960000,
"date": "2026-11-18",
"rate_pct": 3.9
},
{
"timestamp": 1795046400,
"date": "2026-11-19",
"rate_pct": 3.91
}
],
"next": null
}

Code Examples

curl -X GET "https://api.api-ninjas.com/v2/interestratehistorical?rate=sofr&start_date=2026-11-10" \ -H "X-Api-Key: YOUR_API_KEY"

About SOFR

SOFR is calculated by the Federal Reserve Bank of New York as a volume-weighted median of overnight Treasury repurchase (repo) transactions, and it is published each US business day for the previous business day.

The Alternative Reference Rates Committee chose SOFR as the replacement for USD LIBOR, whose panel-based settings ended in June 2023. Most new US dollar floating-rate loans, adjustable-rate mortgages and interest rate swaps now reference SOFR.

Many contracts use an average rather than a single day's rate. The 30-, 90- and 180-day SOFR averages compound daily SOFR over the period, which smooths out day-to-day moves. They are available in the API from March 2020.

Common uses

  • Price floating-rate loans as SOFR plus a spread
  • Reset adjustable-rate mortgages that follow the 30-day SOFR average
  • Value SOFR swaps, futures and floating-rate notes
  • Show daily funding rates in treasury and cash management dashboards

Related

Frequently Asked Questions

  • Yes, but you must have a premium subscription. Commercial use of the Interest Rate API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.
  • The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.
  • The API covers current central bank policy rates for 22 countries plus major benchmark and prime rates, including SOFR, EURIBOR, ESTER, SONIA, SARON, TONAR, CORRA, EFFR, and Livret A, all queried via the rate parameter on the /v2/interestrate endpoint. For LIBOR-specific tooling see the LIBOR API, and explore the full API catalog for related finance data.
  • A request to /v2/interestrate returns a JSON object with rate_name (the name of the rate), rate_pct (the rate value as a percentage), and last_updated (the date the rate was last refreshed in MM-DD-YYYY format). See error codes for the response when a request is unsuccessful.
  • Use the /v2/interestratehistorical endpoint with the same rate parameter plus an optional date range, either start_date and end_date in YYYY-MM-DD format or start_time and end_time UNIX timestamps (in seconds); it returns up to 100 data points per call as a data array of objects with timestamp, date (YYYY-MM-DD) and rate_pct. Both endpoints are Premium only, so check our pricing page for access details.
  • Rates are refreshed every 4 hours, making the API suitable for finance dashboards, mortgage and loan calculators, and macroeconomic monitoring tools. Pair it with the Mortgage Rate API, Inflation API, or Exchange Rate API for richer financial applications.