Skip to main content

Signature

client.get_orders() -> Dict

Parameters

This method takes no parameters.

Returns

FieldTypeDescription
orderslistArray of open order objects
countintNumber of open orders

Order Object Fields

FieldTypeDescription
idstringUnique order ID
token_idstringOutcome token identifier
market_idstringMarket/condition ID
sidestring"BUY" or "SELL"
pricefloatLimit price per share
sizefloatTotal order size in shares
filled_sizefloatShares already filled
remaining_sizefloatShares still on the book
statusstring"PLACED" or "PARTIALLY_FILLED"
created_atstringISO timestamp of order creation
updated_atstringISO timestamp of last update
market_questionstringThe market question text
outcome_namestringName of the outcome (e.g., “Yes”, “No”)

Example

from polyhush import PolyhushClient

client = PolyhushClient(api_key="your-api-key")

# Get all open orders
result = client.get_orders()
print(f"You have {result['count']} open orders")

for order in result['orders']:
    remaining = order['remaining_size']
    filled = order['filled_size']
    total = order['size']
    
    print(f"\n{order['side']} {remaining:.2f}/{total:.2f} @ ${order['price']:.2f}")
    print(f"  Market: {order['market_question']}")
    print(f"  Outcome: {order['outcome_name']}")
    print(f"  Status: {order['status']}")
    
    if filled > 0:
        print(f"  Filled: {filled:.2f} shares ({filled/total*100:.1f}%)")
This only returns GTC (Good Till Cancelled) limit orders that are waiting on the order book. Market orders (FOK/FAK) execute immediately and won’t appear here.

Use Cases

  • Monitor pending orders - Check which orders are waiting to be filled
  • Track partial fills - See how much of each order has been filled
  • Build order management UI - Display user’s active orders
  • Cancel stale orders - Identify and cancel old unfilled orders
# Find orders that are more than 50% filled
result = client.get_orders()
nearly_filled = [
    order for order in result['orders']
    if order['filled_size'] / order['size'] > 0.5
]

# Cancel all sell orders
for order in result['orders']:
    if order['side'] == 'SELL':
        client.cancel_orders(order_id=order['id'])