# StableFinance Financial Metrics API

> StableFinance Financial Metrics API is a paid API for AI agents from stablefinance.dev, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-14).

Retrieves key financial ratios and metrics for publicly traded companies by ticker or CIK, sourced from Financial Datasets AI, with pay-per-request billing via x402.

## Facts

- Endpoint: GET https://stablefinance.dev/api/financial-metrics
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/stablefinance-financial-metrics-api-28267b5e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_qo2vEZt0EHSCE-s2BZu9l

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability stablefinance-financial-metrics-api-28267b5e
```

Example prompt: Pull the annual financial metrics for Apple (ticker AAPL) — I want to see things like gross margin, debt-to-equity, P/E ratio, and revenue growth for the last 10 periods.

## When to prefer this

Use this endpoint when you need structured financial ratios and metrics for publicly traded US companies, especially when you want SEC-sourced data like margins, valuation ratios, leverage ratios, and growth rates across annual, quarterly, or TTM periods. Prefer this over raw SEC EDGAR queries when you need pre-computed ratios and metrics without parsing raw filings yourself.

## Known failure modes

- Missing required 'period' parameter returns a validation error
- Invalid ticker symbol returns empty financial_metrics array or 404
- CIK not found returns empty results
- Report period date range yields no matching filings
- Limit parameter out of range (must be 1-50) causes schema validation failure
- Payment not made or x402 handshake fails results in 402 Payment Required response
- Network timeout on Financial Datasets AI upstream

## How this service works

Valuation, profitability, liquidity, leverage, efficiency, growth, and per-share ratios over history.

## Output

Returns an array of financial metric objects for the requested company and period, each containing ratios and metrics such as gross margin, net margin, operating margin, debt-to-equity, return on equity, return on assets, revenue growth, earnings growth, P/E ratio, PEG ratio, market cap, enterprise value, EBITDA, current/quick/cash ratios, asset turnover, payout ratio, fiscal period label, report date, and SEC filing URL.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "limit": 10,
   "period": "annual",
   "ticker": "AAPL"
  }
 },
 "output": {
  "type": "json",
  "example": {
   "financial_metrics": []
  }
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "required": [
      "period"
     ],
     "properties": {
      "cik": {
       "type": "string",
       "minLength": 1
      },
      "limit": {
       "type": "integer",
       "maximum": 50,
       "minimum": 1
      },
      "period": {
       "enum": [
        "annual",
        "quarterly",
        "ttm"
       ],
       "type": "string"
      },
      "ticker": {
       "type": "string",
       "minLength": 1
      },
      "report_period": {
       "type": "string",
       "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "report_period_gt": {
       "type": "string",
       "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "report_period_lt": {
       "type": "string",
       "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "report_period_gte": {
       "type": "string",
       "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "report_period_lte": {
       "type": "string",
       "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "required": [
      "financial_metrics"
     ],
     "properties": {
      "financial_metrics": {
       "type": "array",
       "items": {}
      }
     },
     "additionalProperties": false
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "financial_metrics": [
   {
    "period": "ttm",
    "ticker": "AAPL",
    "currency": "USD",
    "gross_margin": 0.46,
    "fiscal_period": "FY2024",
    "report_period": "2024-09-28",
    "debt_to_equity": 2.07,
    "revenue_growth": 0.02,
    "return_on_equity": 1.66,
    "price_to_earnings_ratio": 38.58
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/stablefinance-financial-metrics-api-28267b5e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from stablefinance.dev](https://www.zero.xyz/host/stablefinance.dev/llms.txt)
