> ## Documentation Index
> Fetch the complete documentation index at: https://docs.davidhf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Financial metrics

> Valuation, margin, return, and leverage ratios, plus a market-wide snapshot.

Financial metrics are derived ratios computed from a company's statements and price: valuation multiples, margins, returns, and leverage.

## Metrics

```http theme={null}
GET /financial-metrics
```

Time series of metrics for a single ticker.

| Parameter     | Type    | Required | Default | Description                       |
| ------------- | ------- | -------- | ------- | --------------------------------- |
| `scenario_id` | string  | Yes      | -       | The world to read from.           |
| `ticker`      | string  | Yes      | -       | Ticker symbol to query.           |
| `period`      | string  | No       | `ttm`   | `ttm` \| `quarterly` \| `annual`. |
| `limit`       | integer | No       | 4       | Page size (max 500).              |
| `offset`      | integer | No       | 0       | Pagination offset.                |

<CodeGroup>
  ```bash cURL theme={null}
  curl -s "https://api.davidhf.com/financial-metrics?scenario_id=<id>&ticker=AAPL&period=ttm&limit=4" \
    -H "X-API-KEY: YOUR_API_KEY"
  ```

  ```python Python theme={null}
  dd.financials.metrics("AAPL", scenario_id="<id>", period="ttm", limit=4)
  ```
</CodeGroup>

```json theme={null}
{
  "financial_metrics": [
    {
      "ticker": "AAPL",
      "report_period": "2026-03-31",
      "period": "ttm",
      "currency": "USD",
      "price_to_earnings_ratio": 28.4,
      "price_to_sales_ratio": 7.1,
      "gross_margin": 0.452,
      "operating_margin": 0.312,
      "net_margin": 0.271,
      "return_on_equity": 0.51,
      "debt_to_equity": 1.4,
      "market_cap": 2950000000000
    }
  ]
}
```

## Metrics snapshot

```http theme={null}
GET /financial-metrics/snapshot
```

A point-in-time metrics snapshot across one or many tickers, joined with the price as of a date.

| Parameter     | Type    | Required | Default | Description             |
| ------------- | ------- | -------- | ------- | ----------------------- |
| `scenario_id` | string  | Yes      | -       | The world to read from. |
| `ticker`      | string  | No       | all     | Restrict to one ticker. |
| `as_of`       | date    | No       | latest  | Price-snapshot cutoff.  |
| `limit`       | integer | No       | 100     | Tickers (max 5000).     |
| `offset`      | integer | No       | 0       | Pagination offset.      |

<CodeGroup>
  ```bash cURL theme={null}
  curl -s "https://api.davidhf.com/financial-metrics/snapshot?scenario_id=<id>&as_of=2026-03-26&limit=50" \
    -H "X-API-KEY: YOUR_API_KEY"
  ```

  ```python Python theme={null}
  dd.financials.metrics_snapshot(scenario_id="<id>", as_of="2026-03-26", limit=50)
  ```
</CodeGroup>

```json theme={null}
{ "financial_metrics": [ { "ticker": "AAPL", "price_to_earnings_ratio": 28.4, "market_cap": 2950000000000, "...": "..." } ] }
```

## Discovery helper

```http theme={null}
GET /financial-metrics/snapshot/tickers
```

Takes only `scenario_id`; returns tickers with metrics.

```json theme={null}
{ "tickers": ["AAPL", "MSFT", "..."] }
```
