# FX Rates

Daily foreign exchange data, defaulting to USDCNH (US dollar against offshore renminbi), with open/high/low/close for both the bid and ask quotes. The offshore CNH rate is a key gauge of market expectations for the renminbi and of cross-border capital conditions, commonly used for cross-border portfolio valuation, FX hedging and reading foreign capital flows. Updated each trading day; quoted as USD per CNH, and other currency pairs can be specified.

`GET /v2/fx/daily`

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `symbol` | string | No | FX pair, default USDCNH.FXCM |
| `start_date` | string | No | Start date (YYYYMMDD) |
| `end_date` | string | No | End date (YYYYMMDD) |
| `trade_date` | string | No | Trading date YYYYMMDD (single day) |

## Response Fields

| Field | Type | Description |
| --- | --- | --- |
| `symbol` | string | Currency pair code |
| `trade_date` | string | Trading date |
| `bid_open` | number | Bid opening price |
| `bid_close` | number | Bid closing price |
| `bid_high` | number | Bid highest price |
| `bid_low` | number | Bid lowest price |
| `ask_open` | number | Ask opening price |
| `ask_close` | number | Ask closing price |

## API Example

cURL

```
curl -H "X-API-Key: YOUR_KEY" \
  "https://asharehub.com/v2/fx/daily?symbol=USDCNH.FXCM"
```

Python SDK

```
from asharehub import AShareHub

client = AShareHub(api_key="YOUR_KEY")
df = client.fx_daily(symbol="USDCNH.FXCM")
print(df.head())
```

## Sample Data

returns a pandas.DataFrame

| symbol | trade_date | bid_open | bid_close | bid_high | bid_low | ask_open | ask_close | ask_high | ask_low | … +1 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| USDCNH.FXCM | 20260625 | 6.8009 | 6.8023 | 6.8029 | 6.7981 | 6.8023 | 6.803 | 6.8036 | 6.8008 | … |
| USDCNH.FXCM | 20260624 | 6.8127 | 6.8009 | 6.8161 | 6.7966 | 6.8139 | 6.8023 | 6.8183 | 6.7972 | … |
| USDCNH.FXCM | 20260623 | 6.7944 | 6.8127 | 6.8192 | 6.7908 | 6.7955 | 6.8139 | 6.8198 | 6.7913 | … |
