> 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`. |

## 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/blob/main/02-products/rwa/api/reference/openapi.snapshot.json).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.anchored.finance/trading-api/market-data/quotes-and-history.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
