> For the complete documentation index, see [llms.txt](https://pacifica.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-equity-history.md).

# Get account equity history

```
GET /api/v1/portfolio
```

#### Query Parameters

<table><thead><tr><th width="176">Field</th><th width="98">Type</th><th width="95">Need</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>"account"</code></td><td>string</td><td>required</td><td>User's wallet address</td><td><code>42trU9A5...</code></td></tr><tr><td><code>"time_range"</code></td><td>string</td><td>required</td><td>Time range of history: <code>1d</code>, <code>7d</code>, <code>14d</code>, <code>30d</code>, <code>all</code></td><td><code>7d</code></td></tr><tr><td><code>"start_time"</code></td><td>integer</td><td>optional</td><td>Start time in milliseconds</td><td><code>1760271000000</code></td></tr><tr><td><code>"end_time"</code></td><td>integer</td><td>optional</td><td>End time in milliseconds</td><td><code>1761842220000</code></td></tr><tr><td><code>"limit"</code></td><td>integer</td><td>optional</td><td>Maximum number of records to return, defaults to 100</td><td><code>100</code></td></tr></tbody></table>

```
/api/v1/portfolio?account=42trU9A5...&time_range=7d
```

#### Response

* Status 200: Successfully retrieved portfolio history

```json
{
  "success": true,
  "data": [
    {
      "account_equity": "61046.308885",
      "pnl": "9297.553505",
      "timestamp": 1761177600000
    },
    ...
  ],
  "error": null,
  "code": null
}
```

| Field              | Type           | Description                                              |
| ------------------ | -------------- | -------------------------------------------------------- |
| `'account_equity'` | decimal string | Account equity (balance + unrealized PnL) at last update |
| `'PnL'`            | decimal string | PnL of account since creation                            |
| `'timestamp'`      | integer        | Timestamp in milliseconds of last account equity update  |

* Status 400: Invalid request parameters
* Status 401: Unauthorized access
* Status 500: Internal server error

#### Code Example (Python)

```python
import requests

response = requests.get(
    "/api/v1/portfolio?account=42trU9A5...&time_range=7d",
    headers={"Accept": "*/*"},
)

data = response.json()
```
