HTTP API시장 데이터
호가창 상단
요청 만들기
값을 바꾸면 명령이 함께 바뀝니다. 토큰은 여기에 입력하지 않습니다. 명령은 SPECTRE_LOCAL_API_TOKEN 환경 변수에서 토큰을 읽습니다. 자신의 터미널에서 실행하세요.
명령
curl 'http://127.0.0.1:48180/v1/market/orderbook?instrument=binance:futures:BTCUSDT&depth=20' \ -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
GET
호가창의 상단 레벨입니다. 레벨은 [price, size]입니다. 전체 호가창이 3초 안에 도착하지 않으면 응답은 503 unavailable입니다. 빈 호가창은 빈 시장처럼 보이기 때문입니다.
bearerToken market:readheader
인증Bearer <token>Local API 토큰입니다: spt_와 16진수 문자 64개. Settings App → 일반 → Local API에서 복사합니다. Authorization 헤더로만 받습니다. 작업에 나열된 이름은 그 작업에 필요한 권한입니다. 터미널의 토큰에는 모든 권한이 있습니다.
권한: market:read
instrument*string종목 주소, exchange:market:symbol.
connection_id?integer데이터를 읽을 때 거칠 연결입니다. 지정하지 않으면 터미널은 해당 거래소와 마켓의 활성화된 거래 연결을 사용하고, 없으면 읽기 전용 연결을 사용합니다.
형식
int64depth?integer각 방향의 레벨 수입니다.
범위
1 <= value <= 200기본값
50호가창 상단입니다.
application/json- response
instrument*stringconnection_id*integer형식
int64ts*integer형식
int64depth*integer요청한 깊이입니다.
bids*array<array<string>>최우선 가격부터 아래로 나열됩니다.
asks*array<array<string>>최우선 가격부터 위로 나열됩니다.
curl 'http://127.0.0.1:48180/v1/market/orderbook?instrument=binance:futures:BTCUSDT&depth=20' \ -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"응답 예제
{ "instrument": "binance:futures:BTCUSDT", "connection_id": 12, "ts": 1730294400123, "depth": 20, "bids": [ [ "67000.1", "1.25" ] ], "asks": [ [ "67000.2", "0.40" ] ]}