Home / Developers / Financial Ratios API
API reference

Financial Ratios API

Financial ratios and standardised line items computed on request from a company's XBRL filings (10-K, 10-Q, 20-F, 40-F). Every value carries its formula, XBRL tag and source accession. No price-based ratios. Product overview →

Endpoints

/v1/financial-ratios

GEThttps://secfeedapi.com/v1/financial-ratios

About 30 financial ratios per period computed from the company's XBRL filings: margins, ROA, ROE, liquidity, leverage, turnover, free cash flow and growth. Each ratio carries its formula, inputs, XBRL tags and source accession; a ratio with a missing input is null with a reason. No price-based ratios.

ParameterTypeDescriptionExample
tickerstringTicker or CIK.AAPL
cikintegerCompany CIK, instead of ticker.320193
periodstringannual, quarterly or ttm (trailing twelve months). Default annual.annual
limitintegerNumber of periods, newest first, max 20. Default 4.2
  • Send ticker or cik.
  • A ratio whose inputs are not reported is null with a reason, for example no gross margin for a bank.

/v1/key-metrics

GEThttps://secfeedapi.com/v1/key-metrics

Standardised line items per period from XBRL (revenue, net income, assets, debt, operating cash flow, capex, shares and more) with tag and source accession.

ParameterTypeDescriptionExample
tickerstringTicker or CIK.MSFT
cikintegerCompany CIK, instead of ticker.789019
periodstringannual, quarterly or ttm. Default annual.annual
limitintegerNumber of periods, max 20. Default 4.2
  • Fiscal periods come from the period dates, so a June fiscal year is reported as June.

Request examples

Every response below is real output from the API, trimmed to the first records.

Annual ratios of one company

Margins, returns, liquidity, leverage, turnover, cash flow and growth, each with formula and inputs.

curl -H "Authorization: Bearer $SECFEED_KEY" \
  "https://secfeedapi.com/v1/financial-ratios?ticker=AAPL&limit=1"
import os, requests

r = requests.get(
    "https://secfeedapi.com/v1/financial-ratios",
    params={'ticker': 'AAPL', 'limit': '1'},
    headers={"Authorization": f"Bearer {os.environ['SECFEED_KEY']}"},
    timeout=60,
)
r.raise_for_status()
print(r.json())
{
  "cik": 320193,
  "period": "annual",
  "periods": [
    {
      "end": "2026-09-26",
      "ratios": {
        "grossMargin": {
          "value": 0.487856,
          "formula": "grossProfit / revenue",
          "inputs": {
            "grossProfit": {
              "value": 233602000000,
              "accn": "0000320193-26-000026",
              "tag": "GrossProfit"
            },
            "revenue": {
              "value": 478834000000,
              "accn": "0000320193-26-000026",
              "tag": "RevenueFromContractWithCustomerExcludingAssessedTax"
            }
          }
        },
        "operatingMargin": {
          "value": 0.3301,
          "formula": "operatingIncome / revenue",
          "inputs": {
            "operatingIncome": {
              "value": 158063000000,
              "accn": "0000320193-26-000026",
              "tag": "OperatingIncomeLoss"
            },
            "revenue": {
              "value": 478834000000,
              "accn": "0000320193-26-000026",
              "tag": "RevenueFromContractWithCustomerExcludingAssessedTax"
            }
          }
        },
        "netMargin": {
          "value": 0.276035,
          "formula": "netIncome / revenue",
          "inputs": {
            "netIncome": {
              "value": 132175000000,
              "accn": "0000320193-26-000026",
              "tag": "NetIncomeLoss"
            },
            "revenue": {
              "value": 478834000000,
              "accn": "0000320193-26-000026",
              "tag": "RevenueFromContractWithCustomerExcludingAssessedTax"
            }
          }
        },
        "returnOnAssets": {
          "value": 0.346103,
          "formula": "netIncome / average total assets",
          "inputs": {
            "netIncome": {
  ...

A bank: nulls with reasons

Gross margin and similar ratios are null with a reason, because a bank reports no cost of revenue.

curl -H "Authorization: Bearer $SECFEED_KEY" \
  "https://secfeedapi.com/v1/financial-ratios?ticker=JPM&limit=1"
import os, requests

r = requests.get(
    "https://secfeedapi.com/v1/financial-ratios",
    params={'ticker': 'JPM', 'limit': '1'},
    headers={"Authorization": f"Bearer {os.environ['SECFEED_KEY']}"},
    timeout=60,
)
r.raise_for_status()
print(r.json())
{
  "cik": 19617,
  "period": "annual",
  "periods": [
    {
      "end": "2025-12-31",
      "ratios": {
        "grossMargin": {
          "value": null,
          "reason": "no gross profit or cost of revenue reported (banks, insurers, some utilities)",
          "formula": "grossProfit / revenue"
        },
        "operatingMargin": {
          "value": null,
          "reason": "operating income or revenue not reported",
          "formula": "operatingIncome / revenue"
        },
        "netMargin": {
          "value": 0.312683,
          "formula": "netIncome / revenue",
          "inputs": {
            "netIncome": {
              "value": 57048000000,
              "accn": "0001628280-26-008131",
              "tag": "NetIncomeLoss"
            },
            "revenue": {
              "value": 182447000000,
              "accn": "0001628280-26-008131",
              "tag": "Revenues"
            }
          }
        },
        "returnOnAssets": {
          "value": 0.013538,
          "formula": "netIncome / average total assets",
          "inputs": {
            "netIncome": {
              "value": 57048000000,
              "accn": "0001628280-26-008131",
              "tag": "NetIncomeLoss"
            },
            "assets": {
              "value": 4424900000000,
              "accn": "0001628280-26-069523",
              "tag": "Assets"
            }
          }
        },
        "returnOnEquity": {
          "value": 0.161336,
          "formula": "netIncome / average equity",
          "inputs": {
            "netIncome": {
              "value": 57048000000,
              "accn": "0001628280-26-008131",
              "tag": "NetIncomeLoss"
            },
            "equity": {
              "value": 362438000000,
  ...

Line items

The standardised line items behind the ratios, each with its XBRL tag and accession.

curl -H "Authorization: Bearer $SECFEED_KEY" \
  "https://secfeedapi.com/v1/key-metrics?ticker=MSFT&limit=1"
import os, requests

r = requests.get(
    "https://secfeedapi.com/v1/key-metrics",
    params={'ticker': 'MSFT', 'limit': '1'},
    headers={"Authorization": f"Bearer {os.environ['SECFEED_KEY']}"},
    timeout=60,
)
r.raise_for_status()
print(r.json())
{
  "cik": 789019,
  "period": "annual",
  "periods": [
    {
      "end": "2026-06-30",
      "items": {
        "revenue": {
          "end": "2026-06-30",
          "value": 331839000000,
          "tag": "RevenueFromContractWithCustomerExcludingAssessedTax",
          "accn": "0001193125-26-323660",
          "form": "10-K",
          "filed": "2026-07-29",
          "derived": false,
          "from": null
        },
        "costOfRevenue": {
          "end": "2026-06-30",
          "value": 106374000000,
          "tag": "CostOfGoodsAndServicesSold",
          "accn": "0001193125-26-323660",
          "form": "10-K",
          "filed": "2026-07-29",
          "derived": false,
          "from": null
        },
        "grossProfit": {
          "end": "2026-06-30",
          "value": 225465000000,
          "tag": "GrossProfit",
          "accn": "0001193125-26-323660",
          "form": "10-K",
          "filed": "2026-07-29",
          "derived": false,
          "from": null
        },
        "operatingIncome": {
          "end": "2026-06-30",
          "value": 155237000000,
          "tag": "OperatingIncomeLoss",
          "accn": "0001193125-26-323660",
          "form": "10-K",
          "filed": "2026-07-29",
          "derived": false,
          "from": null
        },
        "netIncome": {
          "end": "2026-06-30",
          "value": 133749000000,
          "tag": "NetIncomeLoss",
          "accn": "0001193125-26-323660",
          "form": "10-K",
          "filed": "2026-07-29",
          "derived": false,
          "from": null
        },
        "epsDiluted": {
          "end": "2026-06-30",
          "value": 17.95,
  ...

Response fields

FieldTypeMeaning
periods[].endstringPeriod end date.
periods[].ratios.<name>.valuenumberThe ratio, or null.
periods[].ratios.<name>.formulastringHow it was computed.
periods[].ratios.<name>.inputsobjectEach input with value, XBRL tag and source accession.
periods[].ratios.<name>.reasonstringWhy the value is null.
periods[].items.<item>objectkey-metrics: value, tag, accession, form and filed date of each line item.
notestringMethod and coverage.

How to

How do I get trailing twelve month margins?

Use period=ttm. It sums four contiguous quarters, with the fourth quarter derived from the annual report.

curl -H "Authorization: Bearer $SECFEED_KEY" \
  "https://secfeedapi.com/v1/financial-ratios?ticker=AAPL&period=ttm&limit=1"

Try it with your own key

Free key, no card needed.

Get free API key →