Does Legend Have a Trading API?

Use the Legend Trading API for account balances, positions, orders, and mainnet execution with account-scoped permissions.

Legend has a public Trading API for reading your account and placing or managing supported trades. It uses the same account and execution infrastructure as Legend, with account-scoped API keys.

Getting started

Sign in to Legend, open Settings → Trading, and create an API key. Turn off Allow trading if you only need account data. Store the key securely and follow the Trading API quickstart.

The API supports account balances, positions, orders, fills, and execution status. Trading-enabled keys can also place, modify, and cancel orders and use the supported leverage, margin, and TWAP actions. Keys cannot withdraw or transfer funds.

Balances and prices

Available to trade, account equity, and withdrawable funds describe different things. Use the API's unified account fields and display values instead of treating a raw perpetual balance as your entire account. The account reference explains the response, and the orders reference covers market precision.

Real accounts and retries

API keys are for your main account on Hyperliquid mainnet. Execution uses real funds. Each trading action requires an idempotency key; follow the retry and reconciliation rules when the outcome is unknown.

For assistant integrations, see Can I connect Legend to an AI assistant?.

Copy individual trades in one tap or Autocopy a trader on Legend.

Start trading on Legend