-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.json
More file actions
6109 lines (6109 loc) · 330 KB
/
Copy pathopenapi.json
File metadata and controls
6109 lines (6109 loc) · 330 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"openapi": "3.1.0",
"info": {
"title": "토스증권 Open API",
"version": "1.0.3"
},
"servers": [
{
"url": "https://openapi.tossinvest.com"
}
],
"security": [
{
"oauth2ClientCredentials": []
}
],
"tags": [
{
"name": "Auth",
"description": "토스증권 Open API의 모든 요청에 필요한 액세스 토큰을 발급하는 그룹입니다. OAuth 2.0 Client Credentials Grant 방식으로 `client_id`·`client_secret`을 토큰으로 교환하며, 발급된 토큰은 이후 모든 API의 `Authorization: Bearer` 헤더에 사용됩니다. 이 그룹의 엔드포인트만 `Authorization` 헤더 없이 호출하며, 응답은 BFF 공통 envelope이 아닌 OAuth 2.0 표준 형식을 따릅니다."
},
{
"name": "Market Data",
"description": "종목의 실시간성 시세 정보를 조회하는 그룹입니다. 매수/매도 호가, 현재가, 최근 체결 내역, 상·하한가, 캔들 차트(1분봉·일봉)를 제공합니다. 계좌 정보 없이 액세스 토큰만으로 호출할 수 있습니다. 호가·현재가·체결·상하한가는 `MARKET_DATA` Rate Limits Group 에 속하고, 캔들 차트는 호출 부하 특성이 달라 별도의 `MARKET_DATA_CHART` Rate Limits Group 으로 관리되므로, 두 그룹의 한도 응답 헤더를 각각 확인하는 것을 권장합니다.\n\n**이용 안내** \n- 웹 소켓은 추후 지원 예정입니다"
},
{
"name": "Stock Info",
"description": "종목명·시장·통화·상장 상태·발행주식수 등 종목의 기본 참조 정보와 매수 유의사항을 제공하는 그룹입니다. 정리매매·단기과열·투자경고/위험·VI 발동·신주인수권 같은 매수 시 주의가 필요한 정보도 조회할 수 있습니다. 응답은 영업일 단위(또는 그 이상)로 갱신되는 데이터이므로 짧은 주기로 폴링하지 말고 화면·세션 진입 시점에 한 번 캐시해 사용하기를 권장합니다."
},
{
"name": "Market Info",
"description": "환율과 시장 운영 일정을 조회하는 그룹입니다. KRW↔USD 환율(1분 주기 갱신, 참고용 표시 환율)과 국내(KRX·NXT)·미국 시장의 장 운영 캘린더를 제공합니다. 장 캘린더는 영업일 여부와 데이마켓·프리·정규·애프터마켓 등 세션별 운영 시간을 포함하므로, 주문 가능 시간대 판단이나 휴장일 처리에 활용할 수 있습니다. 계좌와 무관한 정보로 토큰만으로 호출 가능합니다."
},
{
"name": "Account",
"description": "사용자 본인의 계좌 목록을 조회하는 그룹입니다. 해지·휴면 등을 제외한 정상 상태의 계좌만 반환하며, 계좌가 없으면 빈 배열을 응답합니다. 응답에 포함된 `accountSeq`는 보유 주식·주문·매수 가능 금액 등 계좌정보가 필요한 모든 API의 `X-Tossinvest-Account` 헤더 값으로 사용되므로, 다른 계좌 관련 API를 호출하기 전 가장 먼저 호출하는 진입점에 해당합니다."
},
{
"name": "Asset",
"description": "본인 계좌의 보유 자산 현황을 조회하는 그룹입니다. 종목별 보유 수량·매입가·평가금액·손익과 함께 계좌 전체의 합산 요약을 제공합니다. 국내(KR)·미국(US) 주식이 대상이며 해외 옵션·채권 등은 제외됩니다. 손익률은 원화(KRW) 환산 기준으로 계산됩니다. 호출 시 액세스 토큰과 `X-Tossinvest-Account` 헤더가 함께 필요합니다."
},
{
"name": "Order",
"description": "실제 매매 주문을 처리하는 그룹입니다. 지정가·시장가 주문 생성, 미체결 주문의 가격·수량 정정, 주문 취소를 지원합니다. 계좌에 직접 영향을 주는 API이므로 액세스 토큰과 `X-Tossinvest-Account` 헤더가 모두 필요합니다."
},
{
"name": "Order History",
"description": "제출한 주문의 처리 상태와 체결 내역을 조회하는 그룹입니다. `status` 파라미터로 라이프사이클 그룹(현재 진행 중 주문 `OPEN`)을 선택해 주문 목록을 조회하고, 개별 `orderId`로 모든 상태의 주문 상세를 조회할 수 있습니다. 상세 조회는 부분 체결 내역 등 주문 단위 정보를 포함합니다. 호출 시 `X-Tossinvest-Account` 헤더가 필요합니다."
},
{
"name": "Order Info",
"description": "주문을 내기 전 확인하는 거래 가능 정보를 제공하는 그룹입니다. 미수거래를 제외한 현금 기반 매수 가능 금액, 종목별 매도 가능 수량, 시장별 매매 수수료를 조회할 수 있습니다. 주문 화면에서 입력 가능한 최대 수량·금액을 안내하거나 예상 비용을 계산하는 용도로 활용하며, 정확한 주문 검증을 위해 주문 생성 직전에 호출하는 것을 권장합니다. 호출 시 `X-Tossinvest-Account` 헤더가 필요합니다."
}
],
"paths": {
"/oauth2/token": {
"post": {
"tags": ["Auth"],
"summary": "OAuth2 액세스 토큰 발급",
"description": "OAuth 2.0 Client Credentials Grant 로 access token 을 발급합니다.\n\n- 요청 본문은 `application/x-www-form-urlencoded` 으로 전송합니다.\n- 발급된 token 은 다른 모든 API 의 `Authorization: Bearer {access_token}` 헤더에 사용합니다.\n- 응답 형식은 BFF 공통 envelope 이 아닌 OAuth2 표준 형식을 따릅니다.\n- refresh token 은 제공되지 않습니다. 만료 시 동일 엔드포인트로 재발급합니다.\n- client 당 유효한 access token 은 1 개입니다. 재발급 시 이전에 발급된 token 은 즉시 무효화됩니다.\n\n**Rate Limits Group**: `AUTH`\n",
"operationId": "issueOAuth2Token",
"security": [],
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/OAuth2TokenRequest"
},
"example": {
"grant_type": "client_credentials",
"client_id": "c_01HXYZABCDEFG123456789",
"client_secret": "s_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
},
"responses": {
"200": {
"description": "토큰 발급 성공",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OAuth2TokenResponse"
},
"example": {
"access_token": "eyJraWQiOiIyMDI2LTA0LTAxLWtleSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiJjXzAxSFhZWiJ9...",
"token_type": "Bearer",
"expires_in": 86400
}
}
}
},
"400": {
"description": "잘못된 요청.\n필수 파라미터 누락, 지원하지 않는 grant_type 등.\n",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OAuth2ErrorResponse"
},
"examples": {
"invalidRequest": {
"summary": "필수 파라미터 누락 / 형식 오류",
"value": {
"error": "invalid_request",
"error_description": "Required parameter is missing."
}
},
"unsupportedGrantType": {
"summary": "지원하지 않는 grant_type",
"value": {
"error": "unsupported_grant_type",
"error_description": "Only client_credentials grant type is supported."
}
}
}
}
}
},
"401": {
"description": "클라이언트 인증 실패.\n`client_id` / `client_secret` 가 잘못되었거나 클라이언트가 비활성 상태인 경우.\n",
"headers": {
"WWW-Authenticate": {
"description": "Basic 인증 챌린지. 토큰 엔드포인트는 `Basic realm=\"openapi\"` 로 응답합니다.\n",
"schema": {
"type": "string"
},
"example": "Basic realm=\"openapi\""
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OAuth2ErrorResponse"
},
"example": {
"error": "invalid_client",
"error_description": "Client authentication failed."
}
}
}
},
"429": {
"$ref": "#/components/responses/RateLimitExceeded"
}
}
}
},
"/api/v1/orderbook": {
"get": {
"tags": ["Market Data"],
"summary": "호가 조회",
"description": "매수/매도 호가 및 잔량을 조회합니다.\n\n**Rate Limits Group**: `MARKET_DATA`\n",
"operationId": "getOrderbook",
"security": [
{
"oauth2ClientCredentials": []
}
],
"parameters": [
{
"$ref": "#/components/parameters/SymbolQuery"
}
],
"responses": {
"200": {
"description": "성공",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/ApiResponse"
},
{
"type": "object",
"properties": {
"result": {
"$ref": "#/components/schemas/OrderbookResponse"
}
}
}
]
},
"examples": {
"krStock": {
"summary": "국내 주식 (삼성전자)",
"value": {
"result": {
"timestamp": "2026-03-25T09:30:00.123+09:00",
"currency": "KRW",
"asks": [
{
"price": "72300",
"volume": "1200"
},
{
"price": "72200",
"volume": "3400"
},
{
"price": "72100",
"volume": "8500"
}
],
"bids": [
{
"price": "72000",
"volume": "5200"
},
{
"price": "71900",
"volume": "4100"
},
{
"price": "71800",
"volume": "2700"
}
]
}
}
},
"usStock": {
"summary": "해외 주식 (Apple)",
"value": {
"result": {
"timestamp": "2026-03-25T22:30:00.456+09:00",
"currency": "USD",
"asks": [
{
"price": "185.75",
"volume": "250"
},
{
"price": "185.70",
"volume": "410"
}
],
"bids": [
{
"price": "185.65",
"volume": "180"
},
{
"price": "185.60",
"volume": "320"
}
]
}
}
}
}
}
}
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"429": {
"$ref": "#/components/responses/RateLimitExceeded"
},
"500": {
"$ref": "#/components/responses/InternalErrorMarketData"
}
}
}
},
"/api/v1/prices": {
"get": {
"tags": ["Market Data"],
"summary": "현재가 조회",
"description": "종목의 현재가 정보를 조회합니다. 최대 200건 까지 다건 조회를 지원하며 콤마(`,`)로 구분합니다.\n\n**Rate Limits Group**: `MARKET_DATA`\n",
"operationId": "getPrices",
"security": [
{
"oauth2ClientCredentials": []
}
],
"parameters": [
{
"name": "symbols",
"in": "query",
"required": true,
"description": "종목 심볼. 최대 200 개를 콤마(`,`)로 구분. 예: `005930,000660` 또는 `AAPL,MSFT`. 영문 대/소문자, 숫자, '.', '-' 만 허용한다.",
"schema": {
"type": "string",
"pattern": "^[A-Za-z0-9.,\\-]+$"
},
"example": "005930,000660"
}
],
"responses": {
"200": {
"description": "성공",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/ApiResponse"
},
{
"type": "object",
"properties": {
"result": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PriceResponse"
}
}
}
}
]
},
"examples": {
"krStock": {
"summary": "국내 주식 (삼성전자)",
"value": {
"result": [
{
"symbol": "005930",
"timestamp": "2026-03-25T09:30:00.123+09:00",
"lastPrice": "72000",
"currency": "KRW"
}
]
}
},
"usStock": {
"summary": "해외 주식 (Apple)",
"value": {
"result": [
{
"symbol": "AAPL",
"timestamp": "2026-03-25T22:30:00.456+09:00",
"lastPrice": "185.70",
"currency": "USD"
}
]
}
}
}
}
}
},
"400": {
"description": "잘못된 요청",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"examples": {
"invalidBatchSize": {
"summary": "symbols 개수가 허용 범위(1~200) 를 벗어남",
"value": {
"error": {
"requestId": "01HXYZABCDEFG123456789",
"code": "invalid-request",
"message": "요청이 올바르지 않습니다.",
"data": {
"field": "symbols",
"constraint": {
"min": 1,
"max": 200
}
}
}
}
}
}
}
}
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"429": {
"$ref": "#/components/responses/RateLimitExceeded"
},
"500": {
"$ref": "#/components/responses/InternalErrorMarketData"
}
}
}
},
"/api/v1/trades": {
"get": {
"tags": ["Market Data"],
"summary": "최근 체결 내역 조회",
"description": "당일 최근 체결 내역을 조회합니다.\n\n**Rate Limits Group**: `MARKET_DATA`\n",
"operationId": "getTrades",
"security": [
{
"oauth2ClientCredentials": []
}
],
"parameters": [
{
"$ref": "#/components/parameters/SymbolQuery"
},
{
"name": "count",
"in": "query",
"required": false,
"description": "조회 건수 (최대 50)",
"schema": {
"type": "integer",
"default": 50,
"minimum": 1,
"maximum": 50
}
}
],
"responses": {
"200": {
"description": "성공",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/ApiResponse"
},
{
"type": "object",
"properties": {
"result": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Trade"
}
}
}
}
]
},
"examples": {
"krStock": {
"summary": "국내 주식 (삼성전자)",
"value": {
"result": [
{
"price": "72000",
"volume": "120",
"timestamp": "2026-03-25T09:30:42.000+09:00",
"currency": "KRW"
},
{
"price": "71900",
"volume": "50",
"timestamp": "2026-03-25T09:30:41.500+09:00",
"currency": "KRW"
},
{
"price": "72000",
"volume": "200",
"timestamp": "2026-03-25T09:30:40.800+09:00",
"currency": "KRW"
}
]
}
},
"usStock": {
"summary": "해외 주식 (Apple)",
"value": {
"result": [
{
"price": "185.70",
"volume": "15",
"timestamp": "2026-03-25T22:30:42.100+09:00",
"currency": "USD"
},
{
"price": "185.75",
"volume": "8",
"timestamp": "2026-03-25T22:30:41.700+09:00",
"currency": "USD"
}
]
}
}
}
}
}
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"429": {
"$ref": "#/components/responses/RateLimitExceeded"
},
"500": {
"$ref": "#/components/responses/InternalErrorMarketData"
}
}
}
},
"/api/v1/price-limits": {
"get": {
"tags": ["Market Data"],
"summary": "상/하한가 조회",
"description": "종목의 당일 상한가 및 하한가를 조회합니다.\n\n**Rate Limits Group**: `MARKET_DATA`\n",
"operationId": "getPriceLimit",
"security": [
{
"oauth2ClientCredentials": []
}
],
"parameters": [
{
"$ref": "#/components/parameters/SymbolQuery"
}
],
"responses": {
"200": {
"description": "성공",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/ApiResponse"
},
{
"type": "object",
"properties": {
"result": {
"$ref": "#/components/schemas/PriceLimitResponse"
}
}
}
]
},
"examples": {
"krStock": {
"summary": "국내 주식 (삼성전자)",
"value": {
"result": {
"timestamp": "2026-03-25T09:30:00.123+09:00",
"upperLimitPrice": "93000",
"lowerLimitPrice": "50400",
"currency": "KRW"
}
}
},
"usStock": {
"summary": "해외 주식 (Apple, 가격제한 없음)",
"value": {
"result": {
"timestamp": "2026-03-25T22:30:00.456+09:00",
"upperLimitPrice": null,
"lowerLimitPrice": null,
"currency": "USD"
}
}
}
}
}
}
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"429": {
"$ref": "#/components/responses/RateLimitExceeded"
},
"500": {
"$ref": "#/components/responses/InternalErrorMarketData"
}
}
}
},
"/api/v1/candles": {
"get": {
"tags": ["Market Data"],
"summary": "캔들 차트 조회",
"description": "종목의 캔들(OHLCV) 차트 데이터를 조회합니다. 최대 200개 봉을 반환합니다.\n\n**Rate Limits Group**: `MARKET_DATA_CHART`\n",
"operationId": "getCandles",
"security": [
{
"oauth2ClientCredentials": []
}
],
"parameters": [
{
"$ref": "#/components/parameters/SymbolQuery"
},
{
"name": "interval",
"in": "query",
"required": true,
"description": "봉 단위",
"schema": {
"type": "string",
"enum": ["1m", "1d"]
}
},
{
"name": "count",
"in": "query",
"required": false,
"description": "조회 봉 수 (최대 200)",
"schema": {
"type": "integer",
"default": 100,
"minimum": 1,
"maximum": 200
}
},
{
"name": "before",
"in": "query",
"required": false,
"description": "페이지네이션 상한 (exclusive, ISO 8601). 이 시각보다 이전의 봉만 반환합니다. 미지정 시 가장 최신 봉부터 반환.\n다음 페이지 요청 시 이전 응답의 `nextBefore` 값을 그대로 전달합니다.\n",
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2026-03-25T09:00:00+09:00"
},
{
"name": "adjusted",
"in": "query",
"required": false,
"description": "수정주가 적용 여부. `true` 면 수정주가 적용, `false` 면 미적용.",
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "성공",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/ApiResponse"
},
{
"type": "object",
"properties": {
"result": {
"$ref": "#/components/schemas/CandlePageResponse"
}
}
}
]
},
"examples": {
"dailyCandles": {
"summary": "일봉 (1d)",
"value": {
"result": {
"candles": [
{
"timestamp": "2026-03-25T09:00:00+09:00",
"openPrice": "71600",
"highPrice": "72300",
"lowPrice": "71500",
"closePrice": "72000",
"volume": "3521000",
"currency": "KRW"
},
{
"timestamp": "2026-03-24T09:00:00+09:00",
"openPrice": "71200",
"highPrice": "71800",
"lowPrice": "71000",
"closePrice": "71600",
"volume": "2984000",
"currency": "KRW"
}
],
"nextBefore": "2026-03-24T09:00:00+09:00"
}
}
},
"minuteCandles": {
"summary": "분봉 (1m)",
"value": {
"result": {
"candles": [
{
"timestamp": "2026-03-25T09:32:00+09:00",
"openPrice": "72000",
"highPrice": "72100",
"lowPrice": "71950",
"closePrice": "72050",
"volume": "15200",
"currency": "KRW"
},
{
"timestamp": "2026-03-25T09:31:00+09:00",
"openPrice": "71950",
"highPrice": "72050",
"lowPrice": "71900",
"closePrice": "72000",
"volume": "18400",
"currency": "KRW"
}
],
"nextBefore": "2026-03-25T09:31:00+09:00"
}
}
},
"lastPage": {
"summary": "마지막 페이지 (nextBefore null)",
"value": {
"result": {
"candles": [
{
"timestamp": "2026-03-20T09:00:00+09:00",
"openPrice": "70800",
"highPrice": "71200",
"lowPrice": "70500",
"closePrice": "71000",
"volume": "2112000",
"currency": "KRW"
}
],
"nextBefore": null
}
}
}
}
}
}
},
"400": {
"description": "잘못된 요청",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"examples": {
"unsupportedCandleInterval": {
"summary": "지원하지 않는 캔들 주기",
"value": {
"error": {
"requestId": "01HXYZABCDEFG123456789",
"code": "invalid-request",
"message": "지원하지 않는 캔들 주기입니다.",
"data": {
"field": "interval",
"allowedValues": ["1m", "1d"]
}
}
}
}
}
}
}
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"429": {
"$ref": "#/components/responses/RateLimitExceeded"
},
"500": {
"$ref": "#/components/responses/InternalErrorMarketData"
}
}
}
},
"/api/v1/stocks": {
"get": {
"tags": ["Stock Info"],
"summary": "종목 기본 정보 조회",
"description": "종목의 기본 정보를 조회합니다. `symbols` 를 콤마로 구분하여 최대 200건 까지 다건 조회를 지원합니다.\n종목명, 시장, 통화, 상장 상태, 거래정지 여부 등 트레이딩에서 필요한 참조 데이터를 제공합니다.\n\n**Rate Limits Group**: `STOCK`\n",
"operationId": "getStocks",
"security": [
{
"oauth2ClientCredentials": []
}
],
"parameters": [
{
"name": "symbols",
"in": "query",
"required": true,
"description": "종목 심볼. 콤마로 구분하여 최대 200건. 예: 005930 또는 005930,AAPL. 영문 대/소문자, 숫자, '.', '-' 만 허용한다.",
"schema": {
"type": "string",
"pattern": "^[A-Za-z0-9.,\\-]+$"
},
"example": "005930,AAPL"
}
],
"responses": {
"200": {
"description": "성공",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/ApiResponse"
},
{
"type": "object",
"properties": {
"result": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StockInfo"
}
}
}
}
]
},
"examples": {
"multiple": {
"summary": "다건 조회 (국내 + 미국)",
"value": {
"result": [
{
"symbol": "005930",
"name": "삼성전자",
"englishName": "SamsungElec",
"isinCode": "KR7005930003",
"market": "KOSPI",
"securityType": "STOCK",
"isCommonShare": true,
"status": "ACTIVE",
"currency": "KRW",
"listDate": "1975-06-11",
"delistDate": null,
"sharesOutstanding": "5919637922",
"leverageFactor": null,
"koreanMarketDetail": {
"liquidationTrading": false,
"nxtSupported": true,
"krxTradingSuspended": false,
"nxtTradingSuspended": false
}
},
{
"symbol": "AAPL",
"name": "애플",
"englishName": "APPLE INC",
"isinCode": "US0378331005",
"market": "NASDAQ",
"securityType": "STOCK",
"isCommonShare": true,
"status": "ACTIVE",
"currency": "USD",
"listDate": "1980-12-12",
"delistDate": null,
"sharesOutstanding": "14702703000",
"leverageFactor": null,
"koreanMarketDetail": null
}
]
}
},
"krxStock": {
"summary": "국내 주식 (삼성전자)",
"value": {
"result": [
{
"symbol": "005930",
"name": "삼성전자",
"englishName": "SamsungElec",
"isinCode": "KR7005930003",
"market": "KOSPI",
"securityType": "STOCK",
"isCommonShare": true,
"status": "ACTIVE",
"currency": "KRW",
"listDate": "1975-06-11",
"delistDate": null,
"sharesOutstanding": "5919637922",
"leverageFactor": null,
"koreanMarketDetail": {
"liquidationTrading": false,
"nxtSupported": true,
"krxTradingSuspended": false,
"nxtTradingSuspended": false
}
}
]
}
},
"usStock": {
"summary": "미국 주식 (Apple)",
"value": {
"result": [
{
"symbol": "AAPL",
"name": "애플",
"englishName": "APPLE INC",
"isinCode": "US0378331005",
"market": "NASDAQ",
"securityType": "STOCK",
"isCommonShare": true,
"status": "ACTIVE",
"currency": "USD",
"listDate": "1980-12-12",
"delistDate": null,
"sharesOutstanding": "14702703000",
"leverageFactor": null,
"koreanMarketDetail": null
}
]
}
},
"etf": {
"summary": "ETF (KODEX 200)",
"value": {
"result": [
{
"symbol": "069500",
"name": "KODEX 200",
"englishName": "KODEX 200",
"isinCode": "KR7069500007",
"market": "KOSPI",
"securityType": "ETF",
"isCommonShare": true,
"status": "ACTIVE",
"currency": "KRW",
"listDate": "2002-10-14",
"delistDate": null,
"sharesOutstanding": "208050000",
"leverageFactor": "1",
"koreanMarketDetail": {
"liquidationTrading": false,
"nxtSupported": false,
"krxTradingSuspended": false,
"nxtTradingSuspended": null
}
}
]
}
}
}
}
}
},
"400": {
"description": "잘못된 요청",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"examples": {
"tooManySymbols": {
"summary": "허용 개수 초과 (1~200건)",
"value": {
"error": {
"requestId": "01HXYZABCDEFG123456789",
"code": "invalid-request",
"message": "요청이 올바르지 않습니다.",
"data": {
"field": "symbols",
"constraint": {
"min": 1,
"max": 200
}
}
}
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"429": {
"$ref": "#/components/responses/RateLimitExceeded"
},
"500": {
"$ref": "#/components/responses/InternalErrorStock"
}
}
}
},
"/api/v1/stocks/{symbol}/warnings": {
"get": {
"tags": ["Stock Info"],
"summary": "매수 유의사항 조회",
"description": "종목의 매수 유의사항 및 변동성 완화(VI) 발동 정보를 조회합니다.\n\n**포함 종류**: 정리매매(`LIQUIDATION_TRADING`), 단기과열종목(`OVERHEATED`), 투자경고(`INVESTMENT_WARNING`), 투자위험(`INVESTMENT_RISK`), VI 정적/동적/혼합(`VI_STATIC` / `VI_DYNAMIC` / `VI_STATIC_AND_DYNAMIC`), 신주인수권(`STOCK_WARRANTS`). 전체 enum 은 `StockWarning.warningType` 참조.\n\n**\"활성\"의 시간 기준**: 응답 시점 기준으로 `startDate <= 오늘 <= endDate` 인 항목 (또는 `endDate` 가 `null` 인 진행 중 항목).\n\n**응답 정렬**: `startDate` 내림차순 (최근 발동된 항목부터). `startDate` 가 동일한 경우 정렬 순서는 보장되지 않습니다.\n\n**데이터 적시성**: VI 발동/해제는 거래소 이벤트 발생 후 수 초 내 반영됩니다. 정리매매·단기과열·투자경고/위험 지정은 거래소 공시 기준 일배치로 반영됩니다.\n\n**미존재 vs 빈 배열**:\n- 종목 자체가 없으면 `404 stock-not-found`.\n- 종목은 있으나 활성 유의사항이 없으면 `200 OK` + `result: []`.\n\n**Rate Limits Group**: `STOCK`\n",
"operationId": "getStockWarnings",
"security": [
{
"oauth2ClientCredentials": []
}
],