Skip to Content
API ReferenceOverview

API Reference

Use this section to integrate with Loaf Backend HTTP endpoints. Base URL: https://api.loafmarkets.com. Authenticated routes use Authorization: Bearer <API_KEY> from the Loaf web app API settings.

For a batteries-included Python SDK and bot template, see loaf-python-api-bot-template .

Money & units

Prices and cash amounts are plain dollars; quantities are plain tokens:

  • Prices: up to 2 decimal places (cents).
  • Quantities: up to 1 decimal place.
  • Fields ending in Bps are raw basis points (30 = 0.30%).
  • Fields ending in Percent / Percentage are already percentages (5.2 = 5.2%).

Rate limits

The backend allows about 100 requests per 15 minutes per IP by default and returns standard RateLimit-* headers (RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset). Sensitive endpoints (orders, offering subscriptions, competition queue/payout) are additionally rate limited per account, so rotating IPs does not raise that ceiling.

StatusMeaning
429Rate limited — wait until RateLimit-Reset or honour Retry-After
503Transient overload / matching engine unavailable on some routes

Retry guidance:

  • Idempotent reads (GET, and nonce-free reads): safe to retry with backoff that respects RateLimit-Reset / Retry-After.
  • Order placement and other non-idempotent writes: do not blindly retry — a rate-limited POST /api/orders/ should be re-issued only with a fresh nonce, or you risk reusing a stale one.

The Python SDK  auto-retries transient failures on read requests and raises on rate-limited order calls so you can refresh the nonce.

Need live books and fills? Start with WebSocket. Need a list of what is tradeable? Start with Trade.

Last updated on