API reference · Monitoring

List positions

GET/v1/bots/{bot_id}/positions

A bot's open positions computed from its fills, marked, beside what the bot itself last reported holding.

On this page

Auth. An account token (Authorization: Bearer lb_…) or a signed-in web session. A report-only token (lbr_…) is refused here with 403 scope_denied.

Limits. Counts against your plan's API requests (60, 600 or 3,000 a minute on Free, Builder and Standard).

Parameters

Path parameters

NameTypeRequiredDescription
bot_idstringyesThe bot id (bot_…).

Query parameters

NameTypeRequiredDescription
include_closedbooleannoAlso list markets the bot is now flat in. Default false.

Request

Terminal
curl "https://api.langbot.ai/v1/bots/bot_01M6G72RFQRQ8JGNG8T1447GGP/positions" \
  -H "Authorization: Bearer $LANGBOT_API_TOKEN"

Response

200 OK

JSON
{
  "positions": [
    {
      "venue": "kalshi",
      "ticker": "KXMENTION-26NOV03-TARIFF",
      "side": "yes",
      "count": 10.0,
      "avg_price": 0.41,
      "net_yes": 10.0,
      "realized": 0.7,
      "fees": 0.15,
      "fills": 2,
      "mark": 0.55,
      "mark_source": "last_fill",
      "unrealized": 1.4,
      "reported": null,
      "mismatch": false
    }
  ],
  "truncated": false,
  "pending_fills": 0
}

reported is the bot's newest position event for the market; mismatch is true when its count differs from the count Langbot computes from the fills, which usually means a fill was not reported.

Errors

StatuscodeWhen
404not_foundNo bot with that id on your account (or it was deleted).
401auth_requiredNo token was sent.
401token_invalidThe token was not recognised (mistyped, revoked or expired).
422validation_errorA parameter failed validation; detail[].loc names it.
429rate_limitedOver your request budget; wait Retry-After seconds.

Every error body is {"detail": …, "code": "…"}; branch on code. All codes: Errors.