> ## 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>`"account"`</td><td>string</td><td>required</td><td>User's wallet address</td><td>`42trU9A5...`</td></tr><tr><td>`"time_range"`</td><td>string</td><td>required</td><td>Time range of history: `1d`, `7d`, `14d`, `30d`, `all`</td><td>`7d`</td></tr><tr><td>`"start_time"`</td><td>integer</td><td>optional</td><td>Start time in milliseconds</td><td>`1760271000000`</td></tr><tr><td>`"end_time"`</td><td>integer</td><td>optional</td><td>End time in milliseconds</td><td>`1761842220000`</td></tr><tr><td>`"limit"`</td><td>integer</td><td>optional</td><td>Maximum number of records to return, defaults to 100</td><td>`100`</td></tr><tr><td>`"cursor"`</td><td>string</td><td>optional</td><td>Cursor pagination to access records. Default to none</td><td>`1115hVka`</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()
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.