# Fundamentals

Daily valuation and liquidity metrics, one row per stock per trading day, covering PE (trailing and TTM), PB, PS, dividend yield, turnover rate, volume ratio, share counts (total, float, free-float), and market caps (total and float). It updates alongside each day's close and suits valuation screening, cross-sectional ranking, size bucketing, and factor construction. Note that valuation ratios may be null or negative for loss-making firms, market caps are denominated in 10k CNY, and you should be explicit about which basis (TTM vs. static, float vs. total) you use.

`GET /v2/market/fundamentals`

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `symbol` | string | No | Stock code, e.g. 000001.SZ |
| `start_date` | string | No | Start date (YYYYMMDD) |
| `end_date` | string | No | End date (YYYYMMDD) |
| `trade_date` | string | No | Trading date YYYYMMDD (single day) |

## Key Response Fields

| Field | Description |
| --- | --- |
| `pe / pe_ttm` | Price-to-Earnings ratio (static / trailing 12m) |
| `pb` | Price-to-Book ratio |
| `ps / ps_ttm` | Price-to-Sales ratio |
| `turnover_rate / turnover_rate_f` | Turnover rate (total / free float) |
| `total_mv / circ_mv` | Total / circulating market cap (CNY 10k) |
| `volume_ratio` | Volume ratio |

## API Example

cURL

```
curl -H "X-API-Key: YOUR_KEY" \
  "https://asharehub.com/v2/market/fundamentals?symbol=000001.SZ"
```

Python SDK

```
from asharehub import AShareHub

client = AShareHub(api_key="YOUR_KEY")
df = client.fundamentals(symbol="000001.SZ")
print(df.head())
```

## Sample Data

returns a pandas.DataFrame

| symbol | trade_date | close | turnover_rate | turnover_rate_f | volume_ratio | pe | pe_ttm | pb | ps | … +8 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 000001.SZ | 20260626 | 10.23 | 0.6372 | 1.5152 | 1.01 | 4.6565 | 4.6104 | 0.4278 | 1.5103 | … |
| 000001.SZ | 20260625 | 10.42 | 0.5586 | 1.3284 | 0.91 | 4.743 | 4.696 | 0.4357 | 1.5384 | … |
| 000001.SZ | 20260624 | 10.51 | 0.5802 | 1.3796 | 0.97 | 4.784 | 4.7366 | 0.4395 | 1.5517 | … |

## Query historical PE and PE TTM by date range

To retrieve historical price-to-earnings ratios for a Chinese A-share stock, pass `symbol`, `start_date`, and `end_date` to the fundamentals API. This example requests available records for June 2026 and sorts them by trading date. Use `YYYYMMDD` dates.

Python SDK

```
from asharehub import AShareHub

with AShareHub(api_key="YOUR_KEY") as client:
    history = client.fundamentals(
        symbol="000001.SZ",
        start_date="20260601",
        end_date="20260630",
    )

if history.empty:
    print("No valuation records for this symbol and date range.")
else:
    history = history.sort_values("trade_date")
    columns = ["symbol", "trade_date", "pe", "pe_ttm", "pb"]
    print(history[columns].to_string(index=False))
```

`pe` is the static PE ratio; `pe_ttm` uses trailing 12-month earnings. Keep these as separate series. Valuation ratios have no currency unit. Preserve missing values instead of filling them with zero, and do not automatically discard negative values. Responses contain available trading-day records, not a row for every calendar day.

Historical dates do not establish a point-in-time snapshot of what was known when financial statements were released. Check disclosure timing and revisions before using the series in a backtest. See [Python SDK installation](https://asharehub.com/en/docs/sdk-install) for setup and [daily prices](https://asharehub.com/en/docs/market-daily) for the corresponding price series.
