Skip to main content
GET
Error

Authorizations

Authorization
string
header
required

A Lean API key, sent as Authorization: Bearer <key>. A test key (lean_sk_test_...) simulates orders and fills with no money; a live key (lean_sk_live_...) trades for real within the key's limits. Every successful response says which mode answered in data.livemode.

Path Parameters

id
string
required

A market id from GET /markets, or a venue symbol that names one market: a Polymarket token id, a Hyperliquid book coin (#…, written %23… in a path), or a leg ticker (pm:…, hl:…, pmus:… or a Kalshi market ticker) that lists only this outcome. A symbol that names more than one market, such as a Polymarket condition id, is refused with 400; use the token id or the market id instead.

Required string length: 1 - 512
Example:

"mkt_bmZsOjIwMjYtMTAtMTE6REVOLUxBQwpzcHJlYWQ6Z2FtZTpERU46LTMuNQpERU4"

Query Parameters

action
enum<string>
default:buy
Available options:
buy,
sell
quantity
string

Shares to buy or sell. Send exactly one of quantity or notional.

Pattern: ^\d+(?:\.\d+)?$
Example:

"10"

notional
string

Dollars to spend on a buy, in place of quantity, at most two decimals. The quote covers the shares that amount buys within limit_price and max_slippage_bps, when set. Dollars to spend on a buy, in place of quantity. The quote covers the shares that amount buys within limit_price and max_slippage_bps, when set.

Pattern: ^\d+(?:\.\d{1,2})?$
Example:

"25"

Response

Best executable route for buying a quantity, or for selling it from the shares held; places nothing

success
enum<boolean>
required
Available options:
true
data
object
required
meta
object
required