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 freePublic on-chain account state: collateral, margin, open positions, and pool shares by index or L1 address.
Parameters
| name | in | type | description | |
|---|---|---|---|---|
by | query | strindex | l1_address | required | Lookup key ('index' or 'l1_address'). example: index |
value | query | str | required | Account index or 0x L1 Ethereum address. example: 281474976710654 |
active_only | query | bool | optional | Return 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"