모의투자 Key는 넥스트증권 API에서 로그인 후 모의투자탭에서 확인할 수 있어요.
여기까지는 개념 설명이었습니다. 아래 카드를 펼치면 실제 요청·응답 예시를 이 화면에서 바로 볼 수 있고, 직접 실행은 로그인 후 플레이그라운드에서 이어갈 수 있습니다.
넥스트증권 API에서 발급받은 모의투자 키를 적용하여 이 흐름을 그대로 실행할 수 있어요.
토큰발급 → 계좌조회 → 현재가조회 → 주문생성 → 체결확인 — 아래 단계를 눌러 각각의 예시를 확인하세요.
curl -X POST \
"https://api.nextsecurities.dev/v1/oauth/token" \
-d "grant_type=client_credentials" \
-d "client_id={pk_test_...}" \
-d "client_secret={sk_test_...}"{
"access_token": "eyJhbGciOi...",
"token_type": "Bearer",
"expires_in": 900
}curl -X GET \
"https://api.nextsecurities.dev/v1/account" \
-H "Authorization: Bearer {access_token}" \
-H "X-Next-Account-Id: {account_id}"{
"accountId": "acc_3f1c9a",
"currency": "USD",
"cashAmount": "6,204.10",
"requestedAt": "2026-06-27T10:15:00+09:00"
}curl -X GET \
"https://api.nextsecurities.dev/v1/market/quotes?symbols=AAPL" \
-H "Authorization: Bearer {access_token}"{
"quotes": [{
"symbol": "AAPL",
"outcome": "OK",
"session": "REGULAR",
"price": "213.42"
}]
}curl -X POST \
"https://api.nextsecurities.dev/v1/orders" \
-H "Authorization: Bearer {access_token}" \
-H "X-Next-Account-Id: {account_id}" \
-H "Content-Type: application/json" \
-d '{"symbol":"AAPL","side":"BUY","orderType":"LIMIT","quantity":10,"limitPrice":225,"timeInForce":"DAY","clientOrderId":"0c1a4e9e-6c2f","market":"US"}'{
"orderId": "ord_7e1b42",
"market": "US",
"status": "SUBMITTED",
"requestedAt": "2026-06-27T10:15:24+09:00"
}curl -X GET \
"https://api.nextsecurities.dev/v1/orders/fills?orderId=ord_7e1b42" \
-H "Authorization: Bearer {access_token}" \
-H "X-Next-Account-Id: {account_id}"{
"fills": [{
"fillId": "fill_91ac2f",
"orderId": "ord_7e1b42",
"symbol": "AAPL",
"side": "BUY",
"quantity": 10,
"price": 224.8
}]
}아래 항목을 눌러 각각의 예시를 확인하세요
curl -X GET \
"https://api.nextsecurities.dev/v1/account" \
-H "Authorization: Bearer {access_token}" \
-H "X-Next-Account-Id: {account_id}"{
"accountId": "acc_3f1c9a",
"currency": "USD",
"totalAssetAmount": "12,480.55",
"buyingPower": "6,204.10"
}curl -X GET \
"https://api.nextsecurities.dev/v1/account/holdings" \
-H "Authorization: Bearer {access_token}" \
-H "X-Next-Account-Id: {account_id}"{
"currency": "USD",
"holdings": [{
"symbol": "AAPL",
"quantity": 12,
"currentPrice": 213.42,
"evaluationAmount": 2561.04
}]
}curl -X GET \
"https://api.nextsecurities.dev/v1/account/buying-power" \
-H "Authorization: Bearer {access_token}" \
-H "X-Next-Account-Id: {account_id}"{
"accountId": "acc_3f1c9a",
"currency": "USD",
"buyingPower": 6204.1,
"requestedAt": "2026-06-27T10:20:00+09:00"
}아래 항목을 눌러 각각의 예시를 확인하세요
curl -X GET \
"https://api.nextsecurities.dev/v1/market/quotes?
symbols=AAPL" \
-H "Authorization: Bearer {access_token}"{
"quotes": [{
"symbol": "AAPL",
"outcome": "OK",
"session": "REGULAR",
"price": "213.42"
}]
}curl -X GET \
"https://api.nextsecurities.dev/v1/market/candles?symbol=AAPL&interval=1d&limit=1" \
-H "Authorization: Bearer {access_token}"{
"symbol": "AAPL",
"interval": "1d",
"candles": [{
"time": "2026-06-26T09:30:00-04:00",
"open": 211.6,
"high": 214.1,
"low": 210.8,
"close": 213.42
}]
}curl -X GET \
"https://api.nextsecurities.dev/v1/instruments?search=AAPL&limit=1" \
-H "Authorization: Bearer {access_token}"{
"instruments": [{
"symbol": "AAPL",
"name": "Apple Inc.",
"type": "COMMON_STOCK",
"exchange": "NASDAQ",
"currency": "USD",
"tradable": "TRADABLE"
}]
}curl -X GET \
"https://api.nextsecurities.dev/v1/instruments/AAPL" \
-H "Authorization: Bearer {access_token}"{
"symbol": "AAPL",
"name": "Apple Inc.",
"type": "COMMON_STOCK",
"exchange": "NASDAQ",
"currency": "USD",
"tradable": "TRADABLE",
"dayMarketTradable": true
}curl -X GET \
"https://api.nextsecurities.dev/v1/market/exchange-rate?base=USD"e=KRW" \
-H "Authorization: Bearer {access_token}"{
"baseCurrency": "USD",
"quoteCurrency": "KRW",
"askRate": 1388.4,
"bidRate": 1374.6,
"requestedAt": "2026-06-27T10:20:00+09:00"
}curl -X GET \
"https://api.nextsecurities.dev/v1/market/calendar?from=2026-06-25&to=2026-06-30&market=US" \
-H "Authorization: Bearer {access_token}"{
"calendar": [{
"date": "2026-06-27",
"status": "OPEN",
"sessions": [{
"type": "REGULAR",
"open": "09:30",
"close": "16:00"
}]
}]
}