{"id":230,"date":"2024-09-24T00:17:17","date_gmt":"2024-09-23T15:17:17","guid":{"rendered":"https:\/\/openstudyspace.com\/?p=230"},"modified":"2024-09-30T23:43:19","modified_gmt":"2024-09-30T14:43:19","slug":"binance-futures-api-websocket-%ea%b8%b0%ec%b4%88-%ec%9d%b4%ed%95%b4","status":"publish","type":"post","link":"https:\/\/openstudyspace.com\/?p=230","title":{"rendered":"Binance Futures API: WebSocket \uae30\ucd08 \uc774\ud574"},"content":{"rendered":"\n<h2 class=\"wp-block-heading has-text-align-center\">WebSocket API\uc5d0 \ub300\ud574 \ubc30\uc6cc\ubcf4\uc790<\/h2>\n\n\n\n<p>Binance Futures API \uac1c\ubc1c\uc5d0 \uc785\ubb38\ud558\ub824\uba74, \uc2e4\uc2dc\uac04 \ub370\uc774\ud130\ub97c \ud6a8\uacfc\uc801\uc73c\ub85c \ucc98\ub9ac\ud558\uae30 \uc704\ud574 <strong>WebSocket<\/strong>\uc744 \uc774\ud574\ud558\ub294 \uac83\uc774 \uc911\uc694\ud569\ub2c8\ub2e4. <\/p>\n\n\n\n<p>\uc774 \ud29c\ud1a0\ub9ac\uc5bc\uc5d0\uc11c\ub294 Binance Futures\uc758 WebSocket API\ub97c \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95\uc744 \uc124\uba85\ud558\uace0,  \uc544\ub798\uc758 \ucc28\uc774\ub97c \uc124\uba85\ud574 \ub4dc\ub9ac\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<p>(1) <strong>\uacf5\uc6a9 WebSocket<\/strong><\/p>\n\n\n\n<p>(2) <strong>\uac1c\uc778 WebSocket<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h3 class=\"wp-block-heading has-text-align-center\">WebSocket API\ub780?<\/h3>\n\n\n\n<p>WebSocket\uc740 \uc571\uacfc Binance \uc11c\ubc84 \uac04\uc758 <strong>\uc9c0\uc18d\uc801\uc778 \uc5f0\uacb0<\/strong>\uc744 \uc720\uc9c0\ud558\uc5ec, \uc2e4\uc2dc\uac04\uc73c\ub85c \ub370\uc774\ud130\ub97c \uc8fc\uace0\ubc1b\uc744 \uc218 \uc788\uac8c \ud574\uc90d\ub2c8\ub2e4. \uc774\ub97c \ud1b5\ud574 \uc2dc\uc7a5 \ub370\uc774\ud130\uc640 \uacc4\uc88c \ub370\uc774\ud130\ub97c \uc989\uc2dc \ucc98\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\uc8fc\uc694 WebSocket \uc5d4\ub4dc\ud3ec\uc778\ud2b8<\/strong>: <code>wss:\/\/ws-fapi.binance.com\/ws-fapi\/v1<\/code><\/li>\n\n\n\n<li><strong>\ud14c\uc2a4\ud2b8\ub137 WebSocket \uc5d4\ub4dc\ud3ec\uc778\ud2b8<\/strong>: <code>wss:\/\/testnet.binancefuture.com\/ws-fapi\/v1<\/code><\/li>\n<\/ul>\n\n\n\n<p>\uc774 \ub450 \uc5d4\ub4dc\ud3ec\uc778\ud2b8\ub294 \uac01\uac01 <strong>\uacf5\uc6a9 \ub370\uc774\ud130<\/strong>\uc640 <strong>\uac1c\uc778 \ub370\uc774\ud130<\/strong> \uc2a4\ud2b8\ub9bc\uc5d0 \uc811\uadfc\ud560 \uc218 \uc788\uac8c \ud574\uc90d\ub2c8\ub2e4.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\uc5f0\uacb0 \uc720\uc9c0 \ubc29\ubc95<\/h3>\n\n\n\n<p>WebSocket \uc11c\ubc84\uc5d0 \uc5f0\uacb0\ub418\uba74, \uc11c\ubc84\ub294 <strong>3\ubd84\ub9c8\ub2e4 ping \ud504\ub808\uc784<\/strong>\uc744 \uc804\uc1a1\ud569\ub2c8\ub2e4. \ud074\ub77c\uc774\uc5b8\ud2b8\ub294 \uc774\ub97c \ubc1b\uc740 \ud6c4 <strong>pong \ud504\ub808\uc784<\/strong>\uc73c\ub85c \uc751\ub2f5\ud574\uc57c \ud558\uba70, \ub9cc\uc57d <strong>10\ubd84<\/strong> \ub3d9\uc548 \uc11c\ubc84\uac00 pong \ud504\ub808\uc784\uc744 \ubc1b\uc9c0 \ubabb\ud558\uba74 \uc5f0\uacb0\uc774 \ub04a\uae41\ub2c8\ub2e4. \ub530\ub77c\uc11c \uc774 ping-pong \uba54\ucee4\ub2c8\uc998\uc744 \ucc98\ub9ac\ud558\uc5ec \uc5f0\uacb0\uc774 \ub04a\uae30\uc9c0 \uc54a\ub3c4\ub85d \uad00\ub9ac\ud558\ub294 \uac83\uc774 \uc911\uc694\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">WebSocket\uc758 \uc885\ub958<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">1. <strong>\uacf5\uc6a9 WebSocket (Public WebSocket)<\/strong><\/h4>\n\n\n\n<p><strong>\uacf5\uc6a9 WebSocket<\/strong>\uc740 \ubaa8\ub4e0 \uc0ac\uc6a9\uc790\uc5d0\uac8c \uc811\uadfc \uac00\ub2a5\ud558\uba70, <strong>\uc2e4\uc2dc\uac04 \uc2dc\uc7a5 \ub370\uc774\ud130<\/strong>\ub97c \uc2a4\ud2b8\ub9ac\ubc0d\ud558\ub294 \ub370 \uc0ac\uc6a9\ub429\ub2c8\ub2e4. \uc81c\uacf5\ud558\ub294 \ub370\uc774\ud130\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\ud638\uac00\ucc3d (Order Book)<\/strong>: \uc2e4\uc2dc\uac04\uc73c\ub85c \ub9e4\uc218\/\ub9e4\ub3c4 \uc8fc\ubb38 \uc815\ubcf4\ub97c \ubc1b\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n\n\n\n<li><strong>\uac70\ub798 \ub0b4\uc5ed (Trade History)<\/strong>: \uc2dc\uc7a5\uc5d0\uc11c \ubc1c\uc0dd\ud558\ub294 \ucd5c\uc2e0 \uac70\ub798\ub97c \ubcfc \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n\n\n\n<li><strong>\uac00\uaca9 \ubcc0\ub3d9 (Price Changes)<\/strong>: \uc2e4\uc2dc\uac04 \uac00\uaca9 \ubcc0\ub3d9\uc744 \ucd94\uc801\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n<\/ul>\n\n\n\n<p>\uc774 \uc5d4\ub4dc\ud3ec\uc778\ud2b8\ub294 <code>wss:\/\/ws-fapi.binance.com\/ws-fapi\/v1<\/code>\uc5d0\uc11c \uc811\uadfc\ud560 \uc218 \uc788\uc73c\uba70, \ub204\uad6c\ub098 \uc2dc\uc7a5 \uc0c1\ud669\uc744 \uc2e4\uc2dc\uac04\uc73c\ub85c \ubaa8\ub2c8\ud130\ub9c1\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2. <strong>\uac1c\uc778 WebSocket (Private WebSocket)<\/strong><\/h4>\n\n\n\n<p><strong>\uac1c\uc778 WebSocket<\/strong>\uc740 <strong>listen key<\/strong>\ub77c\ub294 \uace0\uc720 \ud0a4\ub97c \uc0ac\uc6a9\ud558\uc5ec, \uac1c\ubcc4 \uc0ac\uc6a9\uc790\uc758 <strong>\uac1c\uc778 \uacc4\uc88c \ub370\uc774\ud130<\/strong>\uc5d0 \uc811\uadfc\ud569\ub2c8\ub2e4. \uc774\ub97c \ud1b5\ud574 \ub2e4\uc74c\uacfc \uac19\uc740 \uc815\ubcf4\ub97c \uc2e4\uc2dc\uac04\uc73c\ub85c \ubc1b\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\uacc4\uc88c \uc794\uace0<\/strong><\/li>\n\n\n\n<li><strong>\uc624\ud508 \ud3ec\uc9c0\uc158<\/strong><\/li>\n\n\n\n<li><strong>\uc2e4\uc2dc\uac04 \uac70\ub798 \ub0b4\uc5ed<\/strong><\/li>\n<\/ul>\n\n\n\n<p>\uc774 \uac1c\uc778 WebSocket\uc740 <code>wss:\/\/fstream.binance.com\/ws\/{listenKey}<\/code>\uc5d0\uc11c \uc5f0\uacb0\ud558\uba70, <strong>\uacc4\uc815 \uad00\ub828 \uc54c\ub9bc<\/strong>\uc744 \ubc1b\uace0 \uc2f6\uc744 \ub54c \uc0ac\uc6a9\ub429\ub2c8\ub2e4. Listen key\ub294 Binance API\ub97c \ud1b5\ud574 \ubc1c\uae09\ubc1b\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\uacf5\uc6a9 WebSocket\uacfc \uac1c\uc778 WebSocket\uc758 \ucc28\uc774\uc810<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\uacf5\uc6a9 WebSocket<\/strong>: <strong>\uc2dc\uc7a5 \ub370\uc774\ud130<\/strong>\ub97c \uc2e4\uc2dc\uac04\uc73c\ub85c \uc81c\uacf5\ud558\uba70, \ub204\uad6c\ub098 \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc8fc\ub85c \ud638\uac00\ucc3d, \uac00\uaca9 \ubcc0\ub3d9, \uac70\ub798 \ub0b4\uc5ed \ub4f1\uc758 \uc2dc\uc7a5 \uc815\ubcf4 \uc218\uc9d1\uc5d0 \uc0ac\uc6a9\ub429\ub2c8\ub2e4.<\/li>\n\n\n\n<li><strong>\uac1c\uc778 WebSocket<\/strong>: <strong>\uacc4\uc815 \uc815\ubcf4<\/strong>\uc640 \uad00\ub828\ub41c \ub370\uc774\ud130\ub97c \uc2a4\ud2b8\ub9ac\ubc0d\ud558\uba70, \uc0ac\uc6a9\uc790 \uac1c\uc778\uc758 \ud3ec\uc9c0\uc158, \uac70\ub798 \ub0b4\uc5ed, \uc794\uace0 \ubcc0\uacbd \ub4f1\uc744 \uc2e4\uc2dc\uac04\uc73c\ub85c \uc54c\ub9bc \ubc1b\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\uacb0\ub860<\/h3>\n\n\n\n<p>Binance WebSocket\uc744 \uc0ac\uc6a9\ud558\uba74 <strong>\uc2e4\uc2dc\uac04\uc73c\ub85c \ub370\uc774\ud130\ub97c \ucc98\ub9ac<\/strong>\ud560 \uc218 \uc788\ub294 \ub450 \uac00\uc9c0 \uc8fc\uc694 \ubc29\ubc95\uc774 \uc788\uc2b5\ub2c8\ub2e4. <strong>\uacf5\uc6a9 WebSocket<\/strong>\uc740 \uc2dc\uc7a5 \ub370\uc774\ud130\ub97c \ubaa8\ub2c8\ud130\ub9c1\ud558\ub294 \ub370 \uc720\uc6a9\ud558\uace0, <strong>\uac1c\uc778 WebSocket<\/strong>\uc740 \uc790\uc2e0\uc758 \uacc4\uc88c\uc640 \uac70\ub798 \ud65c\ub3d9\uc744 \ucd94\uc801\ud558\ub294 \ub370 \ud544\uc218\uc801\uc785\ub2c8\ub2e4. \ub450 \uac00\uc9c0 \ubaa8\ub450\ub97c \uc798 \ud65c\uc6a9\ud558\uba74 \ub354\uc6b1 \ud6a8\uc728\uc801\uc778 \uc790\ub3d9 \uac70\ub798 \uc2dc\uc2a4\ud15c\uc744 \uad6c\ucd95\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\uc2e4\uc2dc\uac04 \uac70\ub798 \uc2dc\uc2a4\ud15c\uc744 \ub9cc\ub4e4\uac70\ub098 \uc2dc\uc7a5\uc744 \ubaa8\ub2c8\ud130\ub9c1\ud558\ub824\ub294 \uac1c\ubc1c\uc790\ub4e4\uc5d0\uac8c <strong>WebSocket<\/strong>\uc740 \ud544\uc218\uc801\uc778 \ub3c4\uad6c\uc785\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WebSocket API\uc5d0 \ub300\ud574 \ubc30\uc6cc\ubcf4\uc790 Binance Futures API \uac1c\ubc1c\uc5d0 \uc785\ubb38\ud558\ub824\uba74, \uc2e4\uc2dc\uac04 \ub370\uc774\ud130\ub97c \ud6a8\uacfc\uc801\uc73c\ub85c \ucc98\ub9ac\ud558\uae30 \uc704\ud574 WebSocket\uc744 \uc774\ud574\ud558\ub294 \uac83\uc774 \uc911\uc694\ud569\ub2c8\ub2e4. \uc774 \ud29c\ud1a0\ub9ac\uc5bc\uc5d0\uc11c\ub294 Binance Futures\uc758 WebSocket API\ub97c \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95\uc744 \uc124\uba85\ud558\uace0, \uc544\ub798\uc758 \ucc28\uc774\ub97c \uc124\uba85\ud574 \ub4dc\ub9ac\uaca0\uc2b5\ub2c8\ub2e4. (1) \uacf5\uc6a9 WebSocket (2) \uac1c\uc778 WebSocket WebSocket API\ub780? WebSocket\uc740 \uc571\uacfc Binance \uc11c\ubc84 \uac04\uc758 \uc9c0\uc18d\uc801\uc778 \uc5f0\uacb0\uc744 \uc720\uc9c0\ud558\uc5ec, \uc2e4\uc2dc\uac04\uc73c\ub85c \ub370\uc774\ud130\ub97c \uc8fc\uace0\ubc1b\uc744 \uc218 \uc788\uac8c \ud574\uc90d\ub2c8\ub2e4. \uc774\ub97c \ud1b5\ud574 \uc2dc\uc7a5 \ub370\uc774\ud130\uc640 \uacc4\uc88c \ub370\uc774\ud130\ub97c \uc989\uc2dc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[28],"tags":[],"class_list":["post-230","post","type-post","status-publish","format-standard","hentry","category-trading-kr"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/openstudyspace.com\/index.php?rest_route=\/wp\/v2\/posts\/230"}],"collection":[{"href":"https:\/\/openstudyspace.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/openstudyspace.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/openstudyspace.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/openstudyspace.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=230"}],"version-history":[{"count":2,"href":"https:\/\/openstudyspace.com\/index.php?rest_route=\/wp\/v2\/posts\/230\/revisions"}],"predecessor-version":[{"id":247,"href":"https:\/\/openstudyspace.com\/index.php?rest_route=\/wp\/v2\/posts\/230\/revisions\/247"}],"wp:attachment":[{"href":"https:\/\/openstudyspace.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/openstudyspace.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/openstudyspace.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}