Open positions
GET
/api/trading/accounts/{account_id}/positions
const url = 'https://example.com/api/trading/accounts/1/positions';const options = { method: 'GET', headers: { 'INF-ACCESS-KEY': '<INF-ACCESS-KEY>', 'INF-ACCESS-TIMESTAMP': '<INF-ACCESS-TIMESTAMP>', 'INF-ACCESS-SIGNATURE': '<INF-ACCESS-SIGNATURE>' }};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/trading/accounts/1/positions \ --header 'INF-ACCESS-KEY: <INF-ACCESS-KEY>' \ --header 'INF-ACCESS-SIGNATURE: <INF-ACCESS-SIGNATURE>' \ --header 'INF-ACCESS-TIMESTAMP: <INF-ACCESS-TIMESTAMP>'One row per market and outcome.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”account_id
required
Account Id
integer
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
Positions
object
positions
required
Positions
Array<object>
Positionobject
market_id
required
Market Id
integer
outcome
required
Outcome
string
quantity
required
Quantity
Signed lots; negative is short.
integer
cost_basis
required
Cost Basis
Signed units paid for what is held.
integer
realized_pnl
required
Realized Pnl
integer
Example
{ "positions": [ { "outcome": "up" } ]}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}