# Hyperliquid — Query a user's portfolio

Get Hyperliquid Portfolio History data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Hyperliquid, pass parameters such as type, user, and retrieve structured data including period label, timestamp-value account-equity history, and timestamp-value profit-and-loss history for account charts, and period comparisons, ready for production pipelines and AI agent automation.

Documentation: https://openany.si/hyperliquid/hyperliquid-query-a-user-s-portfolio/f5c2de28-5e07-4779-9758-2cb8c2c1c6aa/
API ID: f5c2de28-5e07-4779-9758-2cb8c2c1c6aa
Provider: hyperliquid
Contract revision: 4
Method: POST
Endpoint: https://api.openany.si/v1/agent-apis/hyperliquid/info/portfolio
Page update time: 2026-12-03T02:49:34.351Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: application/json
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0 / call
The published contract currently has no usage charge. Authentication and service limits still apply.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:49:33.620Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "0",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Usage and limits
## Hyperliquid Portfolio History API

Use type="portfolio" and user. The response is an array of \[period, history\] pairs, not one flat object. Each history can contain accountValueHistory, pnlHistory and vlm; keep timestamp-value pairs and period labels attached when preparing charts.

## What You Can Build

- **Account charts**: Plot account value and PnL as separate series.
- **Period comparisons**: Compare returned histories using their own period labels.

## Documented Response Fields

| Field | Meaning |
| --- | --- |
| `[][0]` | Period label |
| `[][1].accountValueHistory` | Timestamp-value account-equity history |
| `[][1].pnlHistory` | Timestamp-value profit-and-loss history |
| `[][1].vlm` | Reported volume for the period |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Hyperliquid — Query a user's portfolio request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {}
    },
    "headers": {
      "type": "object",
      "properties": {}
    },
    "body": {
      "additionalProperties": false,
      "examples": [
        {
          "type": "portfolio",
          "user": "0x677d831aef5328190852e24f13c46cac05f984e7"
        }
      ],
      "properties": {
        "type": {
          "const": "portfolio",
          "description": "Fixed native Info query discriminator.",
          "enum": [
            "portfolio"
          ],
          "example": "portfolio",
          "type": "string"
        },
        "user": {
          "description": "hexadecimal format; e.g. 0x0000000000000000000000000000000000000000.",
          "example": "0x677d831aef5328190852e24f13c46cac05f984e7",
          "pattern": "^0x[0-9a-fA-F]{40}$",
          "type": "string"
        }
      },
      "required": [
        "type",
        "user"
      ],
      "type": "object",
      "description": "Query a user's portfolio Documentation prepared only; runtime not verified."
    }
  },
  "required": [
    "path",
    "query",
    "headers",
    "body"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "array",
  "items": {
    "type": "array",
    "items": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "object",
          "properties": {
            "accountValueHistory": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "string"
                    }
                  ]
                }
              }
            },
            "pnlHistory": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "string"
                    }
                  ]
                }
              }
            },
            "vlm": {
              "type": "string"
            }
          }
        }
      ]
    }
  }
}
```

## Request example
Scenario: Documentation example (source abbreviated)
```bash
curl \
  'https://api.openany.si/v1/agent-apis/hyperliquid/info/portfolio' \
  -X POST \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "type": "portfolio",
  "user": "0x677d831aef5328190852e24f13c46cac05f984e7"
}'
```

## Response example
Published documentation example. Verify the actual response after an approved call.
Sample response · Documented HTTP 200
```json
[
  [
    "day",
    {
      "accountValueHistory": [
        [
          1793171160048,
          "368446.671105"
        ],
        [
          1793178360106,
          "368454.062794"
        ],
        [
          1793186760050,
          "368459.367439"
        ]
      ],
      "pnlHistory": [
        [
          1793171160048,
          "0.0"
        ],
        [
          1793178360106,
          "7.391689"
        ],
        [
          1793186760050,
          "12.696334"
        ]
      ],
      "vlm": "0.0"
    }
  ],
  [
    "week",
    {
      "accountValueHistory": [
        [
          1792651560121,
          "368165.046742"
        ],
        [
          1792667160057,
          "368172.655828"
        ],
        [
          1792675560085,
          "368178.029991"
        ]
      ],
      "pnlHistory": [
        [
          1792651560121,
          "0.0"
        ],
        [
          1792667160057,
          "7.609086"
        ],
        [
          1792675560085,
          "12.983249"
        ]
      ],
      "vlm": "0.0"
    }
  ],
  [
    "month",
    {
      "accountValueHistory": [
        [
          1790635560066,
          "367346.882923"
        ],
        [
          1790720760058,
          "367384.882733"
        ],
        [
          1790808360045,
          "367450.977599"
        ]
      ],
      "pnlHistory": [
        [
          1790635560066,
          "0.0"
        ],
        [
          1790720760058,
          "37.99981"
        ],
        [
          1790808360045,
          "104.094676"
        ]
      ],
      "vlm": "0.0"
    }
  ]
]
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### Is the response a single portfolio object?
No. Read the outer array as period-and-history pairs, then read the history object in each pair.

### Can I choose arbitrary dates in this request?
This implementation accepts type and user only. It does not expose startTime, endTime or a period filter.

### Are account value and PnL interchangeable?
No. They are separate time series. Keep each timestamp-value pair attached to its series and period.

### Does the query return current open positions?
It returns period-based portfolio history. Use a separately scoped account-position query when your workflow requires position records.

### Which API key should I use?
Use your OpenAny API key as Bearer authentication on the documented OpenAny route.

### Where can I check the current request price?
Check the pricing area for the selected implementation. Follow its billing unit and any request-dependent rules before sending the request.

## Available implementations
- hyperliquid: https://openany.si/hyperliquid/hyperliquid-query-a-user-s-portfolio/f5c2de28-5e07-4779-9758-2cb8c2c1c6aa/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
