# Get the equity history of the trader account

`GET /accounts/{accountId}/equity-history`

Equity of the account sampled once per minute, oldest first.

- The window is set by `timestamp` and `duration`; with neither given it covers the last 5 days and ends with the live balance appended as the final point.
- On a failed account the window is anchored to the moment the account failed, so the series never runs past it.

## Authorization

bearer: http · bearer (required). Personal API key, prefixed with `usk_`.

## Parameters

- path: accountId (string · uuid; required). Trader account identifier. Must belong to the caller.

Type: string · uuid

format: uuid

- query: timestamp (number; optional). Anchor of the window, unix timestamp in milliseconds. Omitted: the window ends at the current moment (or at the moment the account failed) and the live balance is appended as the last point.

Type: number

Example: 1767225599000

- query: duration (number; optional). Window length in milliseconds, 5 days by default. Positive: the window starts at `timestamp` and spans forward. Negative: the window ends at `timestamp` (or now) and spans backward. Zero is rejected.

Type: number

Example: -86400000

## Example · cURL

```bash
curl --request GET 'https://api.upscale.trade/accounts/{accountId}/equity-history' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY'
```

## Example · JavaScript

```javascript
const response = await fetch("https://api.upscale.trade/accounts/{accountId}/equity-history", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"
  },
});
console.log(response.status, await response.text());
```

## Example · Python

```python
import requests

response = requests.request(
    "GET",
    "https://api.upscale.trade/accounts/{accountId}/equity-history",
    headers={"Accept":"application/json","Authorization":"Bearer YOUR_API_KEY"},
    timeout=30,
)
print(response.status_code, response.text)
```

## Response 200 · AccountsEquityHistoryResponse

**200** application/json — Response

Type: object[]

[]Schema: AccountsEquityHistoryResponse

[]Type: object

[]Required fields: timestamp, volume, phaseIndex, phaseStartEquity

[]Required field types: timestamp (number; required), volume (string; required), phaseIndex (integer; required), phaseStartEquity (string; required)

- []timestamp (number; required)

[]timestamp example: 1767225599000

[]timestamp.Type: number

[]timestamp.Minute the sample belongs to, unix timestamp in milliseconds.

- []volume (string; required)

[]volume example: 10000000000000

[]volume.Type: string

[]volume.Account equity at that minute — balance plus unrealised pnl of open positions, fp9 raw.

- []phaseIndex (integer; required)

[]phaseIndex example: 1

[]phaseIndex.Type: integer

[]phaseIndex.Trading phase index the sample belongs to.

[]phaseIndex.minimum: 0

[]phaseIndex.maximum: 9007199254740991

- []phaseStartEquity (string; required)

[]phaseStartEquity example: 10000000000000

[]phaseStartEquity.Type: string

[]phaseStartEquity.Starting equity of the sample trading phase, fp9 raw.

Example



```json
[
  {
    "timestamp": 1767225599000,
    "volume": "10000000000000",
    "phaseIndex": 1,
    "phaseStartEquity": "10000000000000"
  }
]
```

## Response 401

**401**  — Unauthorized

## Response 403

**403**  — The account belongs to another user (`account_access_denied`), or the request is authenticated with an API key while `api_trading` is disabled on the account (`api_trading_not_enabled`).

## Response 404

**404**  — No account with this identifier.

## Response 429

**429**  — Rate limit of the API key exceeded (`api_key_rate_limit_exceeded`). `Retry-After` says when to come back; the body carries the bucket (`read` / `write`), the window that tripped, its limit and `retryAt`.