본문으로 건너뛰기
HTTP API계정

열린 포지션

요청 만들기

값을 바꾸면 명령이 함께 바뀝니다. 토큰은 여기에 입력하지 않습니다. 명령은 SPECTRE_LOCAL_API_TOKEN 환경 변수에서 토큰을 읽습니다. 자신의 터미널에서 실행하세요.

명령
curl 'http://127.0.0.1:48180/v1/account/positions?connection_id=12' \
  -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
GET
/account/positions

연결의 열린 포지션입니다. unrealized_pnl과 mark_price는 터미널이 계산합니다. mark_price는 롱이면 최우선 매수 호가, 숏이면 최우선 매도 호가입니다.

인증

bearerToken account:read
header인증Bearer <token>

Local API 토큰입니다: spt_와 16진수 문자 64개. Settings App → 일반 → Local API에서 복사합니다. Authorization 헤더로만 받습니다. 작업에 나열된 이름은 그 작업에 필요한 권한입니다. 터미널의 토큰에는 모든 권한이 있습니다.

권한: account:read

쿼리 매개변수

connection_id*integer

계정을 읽을 연결입니다.

형식int64

응답 본문

연결의 포지션입니다.

application/json
  1. response
connection_id*integer
형식int64
data*array<>
요청 예제
curl 'http://127.0.0.1:48180/v1/account/positions?connection_id=12' \  -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
응답 예제
{  "connection_id": 12,  "data": [    {      "instrument": "binance:futures:BTCUSDT",      "side": "long",      "size": "0.5",      "lot_size": "1",      "entry_price": "66500",      "notional": "33250",      "unrealized_pnl": "250",      "mark_price": "67000"    }  ]}