Skip to Content
API ReferenceREST APIGET /user/[pubkey]

GET /user/{pubkey}

Returns the account IDs and active sessions associated with a Solana public key.

Request

Path Parameters:

NameTypeRequiredDescription
pubkeystringYesBase58-encoded Solana public key
curl https://zo-mainnet.n1.xyz/user/YourBase58PubkeyHere

Response

{ "accountIds": [ 1 ], "sessions": { "pubkey": "…", "expiry": "…" } }

Response Fields

FieldTypeDescription
accountIdsnumber[]List of Nord account IDs owned by this user
sessionsobjectMap of active session public keys to session info

Session Object

FieldTypeDescription
pubkeystringSession public key (Base58)
expirystringSession expiration time (RFC3339/ISO 8601)

Example: Python

import requests from base58 import b58encode API_URL = "https://zo-mainnet.n1.xyz" def get_user_account_ids(user_pubkey: bytes) -> list[int]: """Get account IDs for a user public key.""" pubkey_b58 = b58encode(user_pubkey).decode() resp = requests.get(f"{API_URL}/user/{pubkey_b58}") if resp.status_code == 404: return [] # User not found data = resp.json() return data["accountIds"] # Get account IDs account_ids = get_user_account_ids(user_pubkey) print(f"Found {len(account_ids)} accounts: {account_ids}") # Use the first account ID to fetch account details if account_ids: account_id = account_ids[0] # See GET /account/{account_id} for fetching balances, positions, orders

Error Responses

StatusDescription
404User not found (no accounts for this pubkey)

[!TIP] To get account balances, positions, and orders, use the account ID from this endpoint with:

Last updated on