On this page

# Get account equity history

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

    GET /api/v1/portfolio

####
Query Parameters

Field
Type
Need
Description
Example

`"account"`

string

required

User's wallet address

`42trU9A5...`

`"start_time"`

integer

optional

Start time in milliseconds

`1625097600000`

`"end_time"`

integer

optional

End time in milliseconds

`1625184000000`

`"granularity_in_minutes"`

integer

optional

Time granularity in minutes

`60`

`"limit"`

integer

optional

Maximum number of records to return, defaults to system defined limit

`100`

`"offset"`

integer

optional

Number of records to skip

`0`

    /api/v1/portfolio?account=42trU9A5...&start_time=1625097600000&end_time=1625184000000&granularity_in_minutes=60&limit=100"

####
Response

- Status 200: Successfully retrieved portfolio history

      [
        {
          "account_equity": "997.88760080",
          "timestamp": 1748956140000
        },
        {
          "account_equity": "997.98277520",
          "timestamp": 1748956080000
        }
      ]

Field
Type
Description

`'account_equity'`

decimal string

Account equity (balance + unrealized PnL) at last update

`'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)

    import requests

    response = requests.get(
        "/api/v1/portfolio?account=42trU9A5...&start_time=1625097600000&end_time=1625184000000&granularity_in_minutes=60&limit=100",
        headers={"Accept": "*/*"},
    )

    data = response.json()

PreviousGet funding history
NextGet account balance history

Last updated 3 months ago