GET /api/v1/account

Auth X-Hub-Key from API_HUB_KEYExecute GET /run/lighter/api/v1/accountCache cached 1s, never served stale past that windowCost free · weight 0 · standard rate classSource billing free

Public on-chain account state: collateral, margin, open positions, and pool shares by index or L1 address.

Parameters

nameintypedescription
byquerystr
index | l1_address
requiredLookup key ('index' or 'l1_address').
example: index
valuequerystrrequiredAccount index or 0x L1 Ethereum address.
example: 281474976710654
active_onlyquerybooloptionalReturn only active subaccounts.

Response

type: object
data key: accounts
count key: total
pagination: offset
sample: {
  "code": "int",
  "total": "int",
  "accounts": "array[1]"
}

Safe request

Reads the credential from API_HUB_KEY; it never appears in the URL.

curl -sH "X-Hub-Key: $API_HUB_KEY" "https://openapihub.dev/run/lighter/api/v1/account?by=index&value=281474976710654"