{"files":{"SKILL.md":"---\nname: ibkr-3rd-party-web-api\ndescription: \"IBKR 3rd Party Web API skill. Use when working with IBKR 3rd Party Web for oauth, accounts, secdef. Covers 16 endpoints.\"\nversion: 1.0.0\ngenerator: lapsh\n---\n\n# IBKR 3rd Party Web API\nAPI version: 1.0.0\n\n## Auth\nApiKey portal in header\n\n## Base URL\nhttps://www.interactivebrokers.com/tradingapi/v1\n\n## Setup\n1. Set your API key in the appropriate header\n2. GET /accounts -- brokerage accounts\n3. POST /oauth/request_token -- create first request_token\n\n## Endpoints\n16 endpoints across 4 groups. See references/api-spec.lap for full details.\n\n### Oauth\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | /oauth/request_token | Obtain a request token |\n| POST | /oauth/access_token | Obtain a access token |\n| POST | /oauth/live_session_token | Obtain a live session token |\n\n### Accounts\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /accounts | Brokerage Accounts |\n| GET | /accounts/{account}/positions | Account Positions |\n| GET | /accounts/{account}/summary | Account Values Summary |\n| GET | /accounts/{account}/orders | Open Orders |\n| POST | /accounts/{account}/orders | Place Order |\n| GET | /accounts/{account}/orders/{CustomerOrderId} | Return specific order info |\n| DELETE | /accounts/{account}/orders/{CustomerOrderId} | Cancel Order |\n| PUT | /accounts/{account}/orders/{CustomerOrderId} | Modify Order |\n| POST | /accounts/{account}/order_impact | Return margin impact info |\n| GET | /accounts/{account}/trades | Returns trades in account |\n\n### Secdef\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /secdef | Get security definition |\n\n### Marketdata\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /marketdata/snapshot | Market Data Snapshot |\n| GET | /marketdata/exchange_components | Exchange Components |\n\n## Common Questions\nMatch user requests to endpoints in references/api-spec.lap. Key patterns:\n- \"Create a request_token?\" -> POST /oauth/request_token\n- \"Create a access_token?\" -> POST /oauth/access_token\n- \"Create a live_session_token?\" -> POST /oauth/live_session_token\n- \"List all accounts?\" -> GET /accounts\n- \"List all positions?\" -> GET /accounts/{account}/positions\n- \"List all summary?\" -> GET /accounts/{account}/summary\n- \"List all orders?\" -> GET /accounts/{account}/orders\n- \"Create a order?\" -> POST /accounts/{account}/orders\n- \"Get order details?\" -> GET /accounts/{account}/orders/{CustomerOrderId}\n- \"Delete a order?\" -> DELETE /accounts/{account}/orders/{CustomerOrderId}\n- \"Update a order?\" -> PUT /accounts/{account}/orders/{CustomerOrderId}\n- \"Create a order_impact?\" -> POST /accounts/{account}/order_impact\n- \"List all trades?\" -> GET /accounts/{account}/trades\n- \"List all secdef?\" -> GET /secdef\n- \"List all snapshot?\" -> GET /marketdata/snapshot\n- \"List all exchange_components?\" -> GET /marketdata/exchange_components\n- \"How to authenticate?\" -> See Auth section above\n\n## Response Tips\n- Check response schemas in references/api-spec.lap for field details\n- Create/update endpoints return the modified resource on success\n- Error responses include status codes and descriptions in the spec\n\n## References\n- Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas\n\n> Generated from the official API spec by [LAP](https://lap.sh)\n","references/api-spec.lap":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api IBKR 3rd Party Web API\n@base https://www.interactivebrokers.com/tradingapi/v1\n@version 1.0.0\n@auth ApiKey portal in header\n@endpoints 16\n@toc oauth(3), accounts(10), secdef(1), marketdata(2)\n\n@group oauth\n@endpoint POST /oauth/request_token\n@desc Obtain a request token\n@required {body: map # OAuth Parameters}\n@returns(200) OAuth token\n@errors {400: Unsuccessfull response, 401: Unsuccessfull response, 403: Unsuccessfull response, 408: Unsuccessfull response}\n\n@endpoint POST /oauth/access_token\n@desc Obtain a access token\n@required {body: map # OAuth Parameters}\n@returns(200) Access token and token secret\n@errors {400: Unsuccessfull response, 401: Unsuccessfull response, 403: Unsuccessfull response, 408: Unsuccessfull response}\n\n@endpoint POST /oauth/live_session_token\n@desc Obtain a live session token\n@required {body: map # OAuth Parameters}\n@returns(200) DH response\n@errors {400: Unsuccessfull response, 401: Unsuccessfull response, 403: Unsuccessfull response, 408: Unsuccessfull response}\n\n@endgroup\n\n@group accounts\n@endpoint GET /accounts\n@desc Brokerage Accounts\n@required {account: any # Account Number}\n@returns(200) An array of accounts\n@returns(202) Unsuccessfull response\n@returns(204) Unsuccessfull response\n@errors {401: Unsuccessfull response, 403: Unsuccessfull response, 408: Unsuccessfull response}\n\n@endpoint GET /accounts/{account}/positions\n@desc Account Positions\n@required {account: any # Account Number}\n@returns(200) Returns a list of positions for the indicated account\n@returns(202) Unsuccessfull response\n@returns(204) Unsuccessfull response\n@errors {400: Unsuccessfull response, 401: Unsuccessfull response, 403: Unsuccessfull response, 408: Unsuccessfull response}\n\n@endpoint GET /accounts/{account}/summary\n@desc Account Values Summary\n@required {account: any # Account Number}\n@returns(200) Returns object for account summary with multiple properties.  A property is sufficed with -c if it provides commodity value, -s if it provides security value, and -c if its UKL segment value.  \"These values correspond to the TWS Account Window: https://www.interactivebrokers.com/en/software/tws/usersguidebook/realtimeactivitymonitoring/account_window.htm\"\n@returns(202) Unsuccessfull response\n@returns(204) Unsuccessfull response\n@errors {400: Unsuccessfull response, 401: Unsuccessfull response, 403: Unsuccessfull response, 408: Unsuccessfull response}\n\n@endpoint GET /accounts/{account}/orders\n@desc Open Orders\n@returns(200) Returns a list of orders for the indicated account\n@returns(202) Unsuccessfull response\n@returns(204) Unsuccessfull response\n@errors {400: Unsuccessfull response, 401: Unsuccessfull response, 403: Unsuccessfull response, 408: Unsuccessfull response}\n\n@endpoint POST /accounts/{account}/orders\n@desc Place Order\n@required {body: map # Order Parameters}\n@returns(200) Returns order status information\n@returns(202) Unsuccessfull response\n@returns(204) Unsuccessfull response\n@errors {400: Unsuccessfull response, 401: Unsuccessfull response, 403: Unsuccessfull response, 408: Unsuccessfull response}\n\n@endpoint GET /accounts/{account}/orders/{CustomerOrderId}\n@desc Return specific order info\n@returns(200) Returns order status information\n@returns(202) Unsuccessfull response\n@returns(204) Unsuccessfull response\n@errors {400: Unsuccessfull response, 401: Unsuccessfull response, 403: Unsuccessfull response, 408: Unsuccessfull response}\n\n@endpoint DELETE /accounts/{account}/orders/{CustomerOrderId}\n@desc Cancel Order\n@returns(200) Returns result of cancellation attempt\n@returns(202) Unsuccessfull response\n@returns(204) Unsuccessfull response\n@errors {400: Unsuccessfull response, 401: Unsuccessfull response, 403: Unsuccessfull response, 408: Unsuccessfull response}\n\n@endpoint PUT /accounts/{account}/orders/{CustomerOrderId}\n@desc Modify Order\n@required {body: map # Order Parameters}\n@returns(200) Result of order modification attempt\n@returns(202) Unsuccessfull response\n@returns(204) Unsuccessfull response\n@errors {400: Unsuccessfull response, 401: Unsuccessfull response, 403: Unsuccessfull response, 408: Unsuccessfull response}\n\n@endpoint POST /accounts/{account}/order_impact\n@desc Return margin impact info\n@required {body: map # Order Parameters}\n@returns(200) Order impact info\n@returns(202) Unsuccessfull response\n@returns(204) Unsuccessfull response\n@errors {400: Unsuccessfull response, 401: Unsuccessfull response, 403: Unsuccessfull response, 408: Unsuccessfull response}\n\n@endpoint GET /accounts/{account}/trades\n@desc Returns trades in account\n@optional {since: str # Start time specified in UTC. Allowed formats are \"yyyy-MM-dd\" or \"yyyy-MM-dd'T'HH:mm:ss\". Time is optional and is set to midnight if omitted, e.g. \"00:00:00 hh:mm:ss\".}\n@returns(200) List of Trades\n@returns(202) Unsuccessfull response\n@returns(204) Unsuccessfull response\n@errors {400: Unsuccessfull response, 401: Unsuccessfull response, 403: Unsuccessfull response, 408: Unsuccessfull response}\n\n@endgroup\n\n@group secdef\n@endpoint GET /secdef\n@desc Get security definition\n@required {body: map # Order Parameters}\n@returns(200) Financial Instrument Definition\n@returns(202) Unsuccessfull response\n@returns(204) Unsuccessfull response\n@errors {400: Unsuccessfull response, 401: Unsuccessfull response, 403: Unsuccessfull response, 408: Unsuccessfull response}\n\n@endgroup\n\n@group marketdata\n@endpoint GET /marketdata/snapshot\n@desc Market Data Snapshot\n@required {body: [map] # Contract. Allowed combinations are [type and symbol and currency], or [type, symbol, exchange, and currency], or [conid].}\n@returns(200) Financial Instrument Definition\n@errors {400: Unsuccessfull response, 401: Unsuccessfull response, 403: Unsuccessfull response, 408: Unsuccessfull response}\n\n@endpoint GET /marketdata/exchange_components\n@desc Exchange Components\n@returns(200) Exchange Components\n@errors {400: Unsuccessfull response, 401: Unsuccessfull response, 403: Unsuccessfull response, 408: Unsuccessfull response}\n\n@endgroup\n\n@end\n"}}