> For the complete documentation index, see [llms.txt](https://docs.anchored.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.anchored.finance/trading-api/market-data/quotes-and-history.md).

# Quotes & History

## Real-time quote

```
GET /api/v1/prices/{symbol}
```

| Parameter | Type   | Description                                                         |
| --------- | ------ | ------------------------------------------------------------------- |
| `symbol`  | string | Stock symbol, token symbol, or token address. Uppercased by server. |

Response `data`:

| Field       | Type          | Description                                              |
| ----------- | ------------- | -------------------------------------------------------- |
| `basicInfo` | object        | Underlying quote (chain-agnostic).                       |
| `onChain`   | object / null | On-chain token info for current `chainId + productType`. |

For direct on-chain reference-price reads, see [Stock Oracle](/trading-api/market-data/stock-oracle.md).

## Historical K-line

```
GET /api/v1/prices/{symbol}/history
```

| Parameter    | Type   | Required | Default | Description                                    |
| ------------ | ------ | -------- | ------- | ---------------------------------------------- |
| `startTime`  | number | No       | —       | Start (Unix seconds).                          |
| `endTime`    | number | Yes      | —       | End (Unix seconds).                            |
| `interval`   | string | Yes      | —       | `1m`, `3m`, `5m`, `15m`, `1h`, `1d`, `1w`.     |
| `adjustment` | string | No       | `all`   | `raw`, `split`, `dividend`, `spin-off`, `all`. |
| `limit`      | number | No       | `100`   | Max bars. Server max `5000`.                   |

Bar fields:

| Field       | Type   | Description              |
| ----------- | ------ | ------------------------ |
| `open`      | number | Open.                    |
| `high`      | number | High.                    |
| `low`       | number | Low.                     |
| `close`     | number | Close.                   |
| `volume`    | number | Volume.                  |
| `timestamp` | number | Bar time (Unix seconds). |

## Corporate actions

```
GET /api/v1/corporate-action
```

Query stock corporate actions (splits, dividends, etc.) for planning and display.

| Parameter   | Type   | Required | Description                                                                  |
| ----------- | ------ | -------- | ---------------------------------------------------------------------------- |
| `symbol`    | string | Yes      | Stock symbol without `a` prefix, e.g. `AAPL`.                                |
| `startTime` | number | No       | Start filter (Unix seconds). Filters on action `time`.                       |
| `endTime`   | number | No       | End filter (Unix seconds). Filters on action `time`.                         |
| `types`     | array  | No       | Filter by corporate action type. Repeat param or comma-separated per client. |

Allowed `types`:

| Value             | Description     |
| ----------------- | --------------- |
| `reverse_splits`  | Reverse split.  |
| `forward_splits`  | Forward split.  |
| `unit_splits`     | Unit split.     |
| `stock_dividends` | Stock dividend. |
| `cash_dividends`  | Cash dividend.  |

Example:

```
GET /api/v1/corporate-action?symbol=AAPL&types=cash_dividends&startTime=1704067200
```

### Response

Standard envelope. `data` is an array of `BrokerCorporateAction` objects, newest first when filtered by time.

| Field         | Type   | Description                                            |
| ------------- | ------ | ------------------------------------------------------ |
| `symbol`      | string | Stock symbol.                                          |
| `type`        | string | One of the `types` values above.                       |
| `time`        | string | Action timestamp (ISO-8601 date-time).                 |
| `exDate`      | string | Ex-dividend or ex-split date.                          |
| `recordDate`  | string | Record date.                                           |
| `payableDate` | string | Payable date.                                          |
| `processDate` | string | Processing date.                                       |
| `info`        | object | Type-specific broker metadata. Shape varies by `type`. |

### `info` object (varies by type)

| Field                 | Typical for | Description              |
| --------------------- | ----------- | ------------------------ |
| `rate`                | dividends   | Dividend rate per share. |
| `special`             | dividends   | Special dividend flag.   |
| `cusip`               | dividends   | CUSIP identifier.        |
| `oldRate` / `newRate` | splits      | Split ratio components.  |

Example response:

```json
{
  "code": 200,
  "errMsg": "",
  "data": [
    {
      "symbol": "AAPL",
      "type": "cash_dividends",
      "time": "2024-05-10T00:00:00Z",
      "exDate": "2024-05-10",
      "recordDate": "2024-05-13",
      "payableDate": "2024-05-16",
      "processDate": "2024-05-16",
      "info": {
        "rate": 0.25,
        "special": false,
        "cusip": "037833100"
      }
    }
  ],
  "uuid": null,
  "t": null
}
```

> Schema: `BrokerCorporateAction` in [openapi.snapshot.json](https://github.com/AnchoredLabs/anchored-knowledge/tree/api-doc/anchored/02-products/rwa/api/reference/openapi.snapshot.json).
