# 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()
```


---

# Agent Instructions: 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:

```
GET https://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-equity-history.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
