> ## Documentation Index
> Fetch the complete documentation index at: https://platform.trendlinelabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List your orders on one venue

> Your orders on one venue, paged with `next_cursor`. `state` is open (Kalshi resting, Polymarket LIVE) or recent; `created_ts_ms` is null when the venue sends no creation time.

**Good to know**

- One read per venue at a time per user: a second concurrent read of the same venue answers `venue_busy`.
- `side` is the action (buy or sell) on `outcome` at `price`; `outcome` is the venue's own label (Kalshi yes/no, Polymarket the token's outcome name).
- Kalshi nets every order into a buy of its outcome (yes or no) and reads the primary account (subaccount 0).
- A venue that cannot be read is never an empty 200.

**Errors**

| Status | Code | When |
|---|---|---|
| 404 | `venue_not_connected` | No credential, wallet, CLOB credentials or profile on that venue; a Limitless profile held by another account; or an empty Limitless positions answer for a profile not verified as your sub-account (found only through its public profile), reason empty_answer_unverified. The message says which. |
| 409 | `venue_auth_failed` | The venue refused your own stored credential. |
| 422 | `venue_unsupported` | A venue this route does not serve yet. |
| 422 | `invalid_request` | An unknown parameter, `limit` outside 1-100, or a cursor that is malformed or replayed under another route, venue, filter set or key's user. |
| 503 | `venue_unavailable` | The venue could not be read, with `Retry-After`. The reason is one of timeout, venue_error, venue_rate_limited, bad_response, credential_store, too_many_rows. |
| 503 | `venue_busy` | Another read of this venue is running, with `Retry-After`. |
| 503 | `dependency_unavailable` | Our store is unavailable. |

Any route can also answer 401, 403, 429, 500 or 503 `dependency_unavailable`, described on the Errors page.



## OpenAPI

````yaml /openapi.json get /public/v1/account/orders
openapi: 3.1.0
info:
  description: >-
    Prediction-market data across Polymarket, Kalshi, Limitless and predict.fun
    over REST, plus order placement and account reads on your own venue
    accounts. Every request sends three headers, `X-Client-Id`, `X-Api-Key` and
    `X-Api-Secret`; try any endpoint from its page.
  title: TrendlineLabs Public API
  version: '1'
servers:
  - description: Production
    url: https://systems.trendlinelabs.ai
security: []
tags:
  - description: 'Read back the key you are calling with: its scopes, tier and rate limit.'
    name: Your key
  - description: Events group markets across venues; each carries a `universal_id`.
    name: Events
  - description: One market's order book, price history and trades on one venue.
    name: Markets
  - description: Current prices for a set of markets in one call.
    name: Prices
  - description: Live cross-venue price gaps on the same market.
    name: Opportunities
  - description: Place, read and cancel orders on your own venue accounts.
    name: Trading
  - description: Your own balances, positions, orders and fills on each connected venue.
    name: Account
paths:
  /public/v1/account/orders:
    get:
      tags:
        - Account
      summary: List your orders on one venue
      description: >-
        Your orders on one venue, paged with `next_cursor`. `state` is open
        (Kalshi resting, Polymarket LIVE) or recent; `created_ts_ms` is null
        when the venue sends no creation time.


        **Good to know**


        - One read per venue at a time per user: a second concurrent read of the
        same venue answers `venue_busy`.

        - `side` is the action (buy or sell) on `outcome` at `price`; `outcome`
        is the venue's own label (Kalshi yes/no, Polymarket the token's outcome
        name).

        - Kalshi nets every order into a buy of its outcome (yes or no) and
        reads the primary account (subaccount 0).

        - A venue that cannot be read is never an empty 200.


        **Errors**


        | Status | Code | When |

        |---|---|---|

        | 404 | `venue_not_connected` | No credential, wallet, CLOB credentials
        or profile on that venue; a Limitless profile held by another account;
        or an empty Limitless positions answer for a profile not verified as
        your sub-account (found only through its public profile), reason
        empty_answer_unverified. The message says which. |

        | 409 | `venue_auth_failed` | The venue refused your own stored
        credential. |

        | 422 | `venue_unsupported` | A venue this route does not serve yet. |

        | 422 | `invalid_request` | An unknown parameter, `limit` outside 1-100,
        or a cursor that is malformed or replayed under another route, venue,
        filter set or key's user. |

        | 503 | `venue_unavailable` | The venue could not be read, with
        `Retry-After`. The reason is one of timeout, venue_error,
        venue_rate_limited, bad_response, credential_store, too_many_rows. |

        | 503 | `venue_busy` | Another read of this venue is running, with
        `Retry-After`. |

        | 503 | `dependency_unavailable` | Our store is unavailable. |


        Any route can also answer 401, 403, 429, 500 or 503
        `dependency_unavailable`, described on the Errors page.
      operationId: listAccountOrders
      parameters:
        - description: the venue to read
          in: query
          name: venue
          required: true
          schema:
            description: the venue to read
            enum:
              - kalshi
              - polymarket
              - limitless
              - predictfun
            title: Venue
            type: string
        - description: rows per page
          in: query
          name: limit
          required: false
          schema:
            default: 50
            description: rows per page
            maximum: 100
            minimum: 1
            title: Limit
            type: integer
        - description: >-
            `next_cursor` from the previous page; it binds route, venue, filters
            and user
          in: query
          name: cursor
          required: false
          schema:
            anyOf:
              - maxLength: 1024
                type: string
              - type: 'null'
            description: >-
              `next_cursor` from the previous page; it binds route, venue,
              filters and user
            title: Cursor
        - description: open for resting orders, recent for recently closed ones
          in: query
          name: state
          required: false
          schema:
            default: open
            description: open for resting orders, recent for recently closed ones
            enum:
              - open
              - recent
            title: State
            type: string
      responses:
        '200':
          content:
            application/json:
              example:
                as_of_ms: 1791266400000
                next_cursor: null
                orders:
                  - created_ts_ms: 1791266340000
                    filled: '0'
                    market_id: KXBTC-26DEC31-B100000
                    order_id: o-7f3a
                    outcome: 'yes'
                    price: '0.41'
                    side: buy
                    size: '10'
                    venue_status: resting
                venue: kalshi
                wallet: null
              schema:
                $ref: '#/components/schemas/PublicAccountOrders'
          description: Successful Response
          headers:
            Cache-Control:
              description: no-store on every answer
              schema:
                type: string
            Server-Timing:
              description: >-
                app;dur=<milliseconds, one decimal>: the time from the API
                receiving the request to starting this answer
              schema:
                type: string
            X-RateLimit-Limit:
              description: >-
                requests allowed per window for this key; present once the key
                passed the limiter
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: >-
                requests left in this window; present once the key passed the
                limiter
              schema:
                type: integer
            X-RateLimit-Reset:
              description: >-
                seconds until the window resets; present once the key passed the
                limiter
              schema:
                type: integer
            X-Request-Id:
              description: >-
                this request's id (yours, when you sent X-Request-Id); equals
                the envelope's request_id
              schema:
                type: string
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
          description: >-
            unauthorized: missing or partial credential headers, parts that do
            not belong together, or a key that is unknown, revoked or expired.
          headers:
            Cache-Control:
              description: no-store on every answer
              schema:
                type: string
            Server-Timing:
              description: >-
                app;dur=<milliseconds, one decimal>: the time from the API
                receiving the request to starting this answer
              schema:
                type: string
            WWW-Authenticate:
              description: ApiKey realm="public-api"
              schema:
                type: string
            X-Request-Id:
              description: >-
                this request's id (yours, when you sent X-Request-Id); equals
                the envelope's request_id
              schema:
                type: string
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
          description: >-
            insufficient_scope: the key lacks the scope this route needs;
            ip_not_allowed: the request came from an address outside the key's
            allowlist; tier_required: the key owner's plan does not include API
            access; access_not_granted: API access is free but granted on
            request; request it on https://trendlinelabs.ai/developer.
          headers:
            Cache-Control:
              description: no-store on every answer
              schema:
                type: string
            Server-Timing:
              description: >-
                app;dur=<milliseconds, one decimal>: the time from the API
                receiving the request to starting this answer
              schema:
                type: string
            X-Request-Id:
              description: >-
                this request's id (yours, when you sent X-Request-Id); equals
                the envelope's request_id
              schema:
                type: string
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
          description: >-
            venue_not_connected: we hold no usable account of yours for that
            venue: not connected, held by another account, or (Limitless
            positions) an empty answer for a profile not verified as your
            sub-account (found only through its public profile); the message
            names the reason.
          headers:
            Cache-Control:
              description: no-store on every answer
              schema:
                type: string
            Server-Timing:
              description: >-
                app;dur=<milliseconds, one decimal>: the time from the API
                receiving the request to starting this answer
              schema:
                type: string
            X-RateLimit-Limit:
              description: >-
                requests allowed per window for this key; present once the key
                passed the limiter
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: >-
                requests left in this window; present once the key passed the
                limiter
              schema:
                type: integer
            X-RateLimit-Reset:
              description: >-
                seconds until the window resets; present once the key passed the
                limiter
              schema:
                type: integer
            X-Request-Id:
              description: >-
                this request's id (yours, when you sent X-Request-Id); equals
                the envelope's request_id
              schema:
                type: string
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
          description: >-
            venue_auth_failed: the venue refused your own stored credential;
            reconnect it.
          headers:
            Cache-Control:
              description: no-store on every answer
              schema:
                type: string
            Server-Timing:
              description: >-
                app;dur=<milliseconds, one decimal>: the time from the API
                receiving the request to starting this answer
              schema:
                type: string
            X-RateLimit-Limit:
              description: >-
                requests allowed per window for this key; present once the key
                passed the limiter
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: >-
                requests left in this window; present once the key passed the
                limiter
              schema:
                type: integer
            X-RateLimit-Reset:
              description: >-
                seconds until the window resets; present once the key passed the
                limiter
              schema:
                type: integer
            X-Request-Id:
              description: >-
                this request's id (yours, when you sent X-Request-Id); equals
                the envelope's request_id
              schema:
                type: string
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
          description: >-
            invalid_request: a parameter is missing, unknown, malformed or out
            of bounds, or a cursor does not match; venue_unsupported: the route
            does not serve that venue.
          headers:
            Cache-Control:
              description: no-store on every answer
              schema:
                type: string
            Server-Timing:
              description: >-
                app;dur=<milliseconds, one decimal>: the time from the API
                receiving the request to starting this answer
              schema:
                type: string
            X-RateLimit-Limit:
              description: >-
                requests allowed per window for this key; present once the key
                passed the limiter
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: >-
                requests left in this window; present once the key passed the
                limiter
              schema:
                type: integer
            X-RateLimit-Reset:
              description: >-
                seconds until the window resets; present once the key passed the
                limiter
              schema:
                type: integer
            X-Request-Id:
              description: >-
                this request's id (yours, when you sent X-Request-Id); equals
                the envelope's request_id
              schema:
                type: string
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
          description: >-
            rate_limited: too many requests, or too many failed authentications;
            wait Retry-After seconds.
          headers:
            Cache-Control:
              description: no-store on every answer
              schema:
                type: string
            Retry-After:
              description: seconds to wait before retrying
              schema:
                type: integer
            Server-Timing:
              description: >-
                app;dur=<milliseconds, one decimal>: the time from the API
                receiving the request to starting this answer
              schema:
                type: string
            X-RateLimit-Limit:
              description: >-
                requests allowed per window for this key; present once the key
                passed the limiter
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: >-
                requests left in this window; present once the key passed the
                limiter
              schema:
                type: integer
            X-RateLimit-Reset:
              description: >-
                seconds until the window resets; present once the key passed the
                limiter
              schema:
                type: integer
            X-Request-Id:
              description: >-
                this request's id (yours, when you sent X-Request-Id); equals
                the envelope's request_id
              schema:
                type: string
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
          description: >-
            internal_error: an unexpected failure on our side; quote the request
            id. The body may instead be text/plain with no envelope and no
            X-RateLimit-* headers when a failure escapes the route's own
            handling.
          headers:
            Cache-Control:
              description: no-store on every answer
              schema:
                type: string
            Server-Timing:
              description: >-
                app;dur=<milliseconds, one decimal>: the time from the API
                receiving the request to starting this answer
              schema:
                type: string
            X-RateLimit-Limit:
              description: >-
                requests allowed per window for this key; present once the key
                passed the limiter
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: >-
                requests left in this window; present once the key passed the
                limiter
              schema:
                type: integer
            X-RateLimit-Reset:
              description: >-
                seconds until the window resets; present once the key passed the
                limiter
              schema:
                type: integer
            X-Request-Id:
              description: >-
                this request's id (yours, when you sent X-Request-Id); equals
                the envelope's request_id
              schema:
                type: string
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
          description: >-
            dependency_unavailable: one of our own stores could not be read;
            retry later; venue_busy: another read of the same venue for your
            account is running, or the venue budget is spent; retry after
            Retry-After; venue_unavailable: the venue could not be read; the
            message names why; retry after Retry-After.
          headers:
            Cache-Control:
              description: no-store on every answer
              schema:
                type: string
            Retry-After:
              description: seconds to wait before retrying
              schema:
                type: integer
            Server-Timing:
              description: >-
                app;dur=<milliseconds, one decimal>: the time from the API
                receiving the request to starting this answer
              schema:
                type: string
            X-RateLimit-Limit:
              description: >-
                requests allowed per window for this key; present once the key
                passed the limiter
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: >-
                requests left in this window; present once the key passed the
                limiter
              schema:
                type: integer
            X-RateLimit-Reset:
              description: >-
                seconds until the window resets; present once the key passed the
                limiter
              schema:
                type: integer
            X-Request-Id:
              description: >-
                this request's id (yours, when you sent X-Request-Id); equals
                the envelope's request_id
              schema:
                type: string
      security:
        - ApiKey: []
          ApiSecret: []
          ClientId: []
      x-codeSamples:
        - label: cURL
          lang: bash
          source: >
            #!/bin/sh

            # listAccountOrders: List your orders on one venue. Needs
            TRENDLINE_CLIENT_ID, TRENDLINE_API_KEY and TRENDLINE_API_SECRET;
            TRENDLINE_API_BASE overrides the base.

            curl -sS
            "${TRENDLINE_API_BASE:-https://systems.trendlinelabs.ai}/public/v1/account/orders?venue=kalshi&state=open"
            \
              -H "X-Client-Id: $TRENDLINE_CLIENT_ID" \
              -H "X-Api-Key: $TRENDLINE_API_KEY" \
              -H "X-Api-Secret: $TRENDLINE_API_SECRET"
        - label: Python
          lang: python
          source: >
            """listAccountOrders: List your orders on one venue. Needs
            TRENDLINE_CLIENT_ID, TRENDLINE_API_KEY and TRENDLINE_API_SECRET;
            TRENDLINE_API_BASE overrides the base."""

            import os


            import requests


            BASE = os.environ.get("TRENDLINE_API_BASE",
            "https://systems.trendlinelabs.ai")

            HEADERS = {"X-Client-Id": os.environ["TRENDLINE_CLIENT_ID"],
            "X-Api-Key": os.environ["TRENDLINE_API_KEY"],
                       "X-Api-Secret": os.environ["TRENDLINE_API_SECRET"]}

            r = requests.get(f"{BASE}/public/v1/account/orders",
            params={"venue": "kalshi", "state": "open"}, headers=HEADERS,
            timeout=10)

            r.raise_for_status()

            print(r.json())
        - label: JavaScript
          lang: javascript
          source: >
            // listAccountOrders: List your orders on one venue. Needs
            TRENDLINE_CLIENT_ID, TRENDLINE_API_KEY and TRENDLINE_API_SECRET;
            TRENDLINE_API_BASE overrides the base.

            const BASE = process.env.TRENDLINE_API_BASE ??
            "https://systems.trendlinelabs.ai";

            const HEADERS = { "X-Client-Id": process.env.TRENDLINE_CLIENT_ID,
            "X-Api-Key": process.env.TRENDLINE_API_KEY,
              "X-Api-Secret": process.env.TRENDLINE_API_SECRET };
            const r = await
            fetch(`${BASE}/public/v1/account/orders?venue=kalshi&state=open`, {
            headers: HEADERS });

            console.log(r.status, await r.json());
components:
  schemas:
    PublicAccountOrders:
      properties:
        as_of_ms:
          description: when the page was read, unix milliseconds
          title: As Of Ms
          type: integer
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: pass as `cursor` for the next page; null on the last page
          title: Next Cursor
        orders:
          description: this page's orders
          items:
            $ref: '#/components/schemas/PublicAccountOrder'
          title: Orders
          type: array
        venue:
          description: the venue read
          enum:
            - kalshi
            - polymarket
            - limitless
            - predictfun
          title: Venue
          type: string
        wallet:
          anyOf:
            - type: string
            - type: 'null'
          description: the wallet read, on an on-chain venue
          title: Wallet
      required:
        - venue
        - as_of_ms
        - orders
      title: PublicAccountOrders
      type: object
    PublicError:
      properties:
        error:
          $ref: '#/components/schemas/PublicErrorBody'
          description: the refusal
      required:
        - error
      title: PublicError
      type: object
    PublicAccountOrder:
      properties:
        created_ts_ms:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            null when the venue sends none (Kalshi documents created_time
            nullable)
          title: Created Ts Ms
        filled:
          description: contracts filled, a decimal string
          title: Filled
          type: string
        market_id:
          description: the venue's own market id
          title: Market Id
          type: string
        order_id:
          description: the venue's order id
          title: Order Id
          type: string
        outcome:
          description: the venue's own outcome label
          title: Outcome
          type: string
        price:
          description: the limit price, a decimal string
          title: Price
          type: string
        side:
          description: buy or sell, the action on `outcome` at `price`
          enum:
            - buy
            - sell
          title: Side
          type: string
        size:
          description: contracts ordered, a decimal string
          title: Size
          type: string
        venue_status:
          description: the order's status as the venue reports it
          title: Venue Status
          type: string
      required:
        - order_id
        - market_id
        - side
        - outcome
        - price
        - size
        - filled
        - venue_status
      title: PublicAccountOrder
      type: object
    PublicErrorBody:
      properties:
        code:
          description: >-
            a machine-readable code from x-known-codes; a new code may be added,
            so handle an unknown one by its status
          title: Code
          type: string
          x-known-codes:
            - access_not_granted
            - dependency_unavailable
            - geo_blocked
            - idempotency_conflict
            - insufficient_scope
            - internal_error
            - invalid_request
            - ip_not_allowed
            - jurisdiction_refused
            - limit_exceeded
            - market_closed
            - not_found
            - order_not_cancellable
            - order_not_found
            - price_off_tick
            - rate_limited
            - request_in_progress
            - tier_required
            - trade_not_granted
            - trading_halted
            - trading_tier_required
            - unauthorized
            - upstream_unavailable
            - venue_auth_failed
            - venue_busy
            - venue_leg_unverified
            - venue_not_connected
            - venue_not_listed
            - venue_rejected
            - venue_unavailable
            - venue_unsupported
        message:
          description: a human-readable explanation; never parse it
          title: Message
          type: string
        request_id:
          description: >-
            this request's id, also sent as the X-Request-Id header; quote it
            when asking for help
          title: Request Id
          type: string
      required:
        - code
        - message
        - request_id
      title: PublicErrorBody
      type: object
  securitySchemes:
    ApiKey:
      description: the key's id; public
      in: header
      name: X-Api-Key
      type: apiKey
    ApiSecret:
      description: >-
        the key's secret (tl_live_…), shown once at creation; never log or share
        it
      in: header
      name: X-Api-Secret
      type: apiKey
    ClientId:
      description: the key's own client id (cli_…), different for every key; public
      in: header
      name: X-Client-Id
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.