> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pacifica.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Account Equity History

> This endpoint allows users to get account equity and PnL history (over time).

```http theme={null}
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><tr><td><code>"cursor"</code></td><td>string</td><td>optional</td><td>Cursor pagination to access records. Default to none</td><td><code>1115hVka</code></td></tr></tbody></table>

```http theme={null}
/api/v1/portfolio?account=42trU9A5...&time_range=7d
```

#### Response

* Status 200: Successfully retrieved portfolio history

```json theme={null}
{
  "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 theme={null}
import requests

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

data = response.json()
```
