{"id":490,"date":"2026-04-21T10:01:02","date_gmt":"2026-04-21T10:01:02","guid":{"rendered":"https:\/\/blog.alltick.co\/ja-jp\/?p=490"},"modified":"2026-04-21T10:01:29","modified_gmt":"2026-04-21T10:01:29","slug":"rest-api-%e3%81%a8-websocket-api-%e3%81%ae%e9%81%95%e3%81%84","status":"publish","type":"post","link":"https:\/\/blog.alltick.co\/ja-jp\/rest-api-%e3%81%a8-websocket-api-%e3%81%ae%e9%81%95%e3%81%84\/","title":{"rendered":"REST API \u3068 WebSocket API \u306e\u9055\u3044"},"content":{"rendered":"\n<p>\u73fe\u4ee3\u306e\u30a6\u30a7\u30d6\u304a\u3088\u3073\u91d1\u878d\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u6839\u5e79\u306f\u3001\u30c7\u30fc\u30bf\u4ea4\u63db\u306b\u3042\u308a\u307e\u3059\u3002\u6570\u3042\u308b\u30d7\u30ed\u30c8\u30b3\u30eb\u306e\u4e2d\u3067\u3082\u3001<strong>REST (Representational State Transfer)<\/strong> \u3068 <strong>WebSocket<\/strong> \u306f\u6700\u3082\u6709\u529b\u306a\u9078\u629e\u80a2\u3067\u3059\u3002REST \u306f\u5f93\u6765\u306e\u300c\u30ea\u30af\u30a8\u30b9\u30c8\u30fb\u30ec\u30b9\u30dd\u30f3\u30b9\u300d\u578b\u30a4\u30f3\u30bf\u30e9\u30af\u30b7\u30e7\u30f3\u306e\u696d\u754c\u6a19\u6e96\u3067\u3059\u304c\u3001\u682a\u5f0f\u30c8\u30ec\u30fc\u30c9\u3084\u30e9\u30a4\u30d6\u4fa1\u683c\u30d5\u30a3\u30fc\u30c9\u306a\u3069\u306e\u4f4e\u9045\u5ef6\u74b0\u5883\u3067\u306f WebSocket \u304c\u4e0d\u53ef\u6b20\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u672c\u8a18\u4e8b\u3067\u306f\u3001REST \u3068 WebSocket API \u306e\u57fa\u672c\u7684\u306a\u9055\u3044\u3001\u6280\u8853\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3001\u304a\u3088\u3073\u5177\u4f53\u7684\u306a\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">REST API \u3068\u306f\uff1f<\/h3>\n\n\n\n<p>REST \u306f\u3001\u6a19\u6e96\u7684\u306a <strong>HTTP \u30d7\u30ed\u30c8\u30b3\u30eb<\/strong>\u4e0a\u3067\u52d5\u4f5c\u3059\u308b\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u30b9\u30bf\u30a4\u30eb\u3067\u3059\u3002<strong>\u30b9\u30c6\u30fc\u30c8\u30ec\u30b9\uff08\u72b6\u614b\u3092\u4fdd\u6301\u3057\u306a\u3044\uff09\u306a\u30ea\u30af\u30a8\u30b9\u30c8\u30fb\u30ec\u30b9\u30dd\u30f3\u30b9<\/strong>\u901a\u4fe1\u30e2\u30c7\u30eb\u306b\u5f93\u3044\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1\u3057\u3001\u30b5\u30fc\u30d0\u30fc\u304c\u305d\u308c\u306b\u5fdc\u3058\u305f\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>REST \u306e\u4e3b\u306a\u7279\u5fb4:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5358\u65b9\u5411\u6027:<\/strong> \u30c7\u30fc\u30bf\u306f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u3042\u3063\u305f\u5834\u5408\u306b\u306e\u307f\u3001\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3078\u6d41\u308c\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30b9\u30c6\u30fc\u30c8\u30ec\u30b9\u6027:<\/strong> \u5404\u30ea\u30af\u30a8\u30b9\u30c8\u306f\u72ec\u7acb\u3057\u3066\u304a\u308a\u3001\u30b5\u30fc\u30d0\u30fc\u304c\u51e6\u7406\u3092\u884c\u3046\u305f\u3081\u306b\u5fc5\u8981\u306a\u3059\u3079\u3066\u306e\u60c5\u5831\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u542b\u3081\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u6a19\u6e96\u30e1\u30bd\u30c3\u30c9:<\/strong> <code>GET<\/code>\uff08\u30c7\u30fc\u30bf\u53d6\u5f97\uff09\u3001<code>POST<\/code>\uff08\u4f5c\u6210\uff09\u3001<code>PUT<\/code>\uff08\u66f4\u65b0\uff09\u3001<code>DELETE<\/code>\uff08\u524a\u9664\uff09\u306a\u3069\u306e\u6a19\u6e96 HTTP \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>JSON \u30b5\u30dd\u30fc\u30c8:<\/strong> \u73fe\u4ee3\u306e REST API \u306e\u591a\u304f\u306f\u3001\u69cb\u9020\u5316\u30fb\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3055\u308c\u305f JSON \u5f62\u5f0f\u3067\u30c7\u30fc\u30bf\u3092\u8fd4\u3057\u3001\u9ad8\u3044\u53ef\u8aad\u6027\u3068\u89e3\u6790\u306e\u3057\u3084\u3059\u3055\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">WebSocket API \u3068\u306f\uff1f<\/h3>\n\n\n\n<p>WebSocket \u306f\u3001\u5358\u4e00\u306e\u6c38\u7d9a\u7684\u306a TCP \u63a5\u7d9a\u3092\u4ecb\u3057\u3066**\u5168\u4e8c\u91cd\uff08\u30d5\u30eb\u30c7\u30e5\u30d7\u30ec\u30c3\u30af\u30b9\uff09**\u901a\u4fe1\u30c1\u30e3\u30cd\u30eb\u3092\u63d0\u4f9b\u3059\u308b\u30d7\u30ed\u30c8\u30b3\u30eb\u3067\u3059\u3002REST \u3068\u306f\u7570\u306a\u308a\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3068\u30b5\u30fc\u30d0\u30fc\u9593\u3067\u7d99\u7d9a\u7684\u306a\u30c7\u30fc\u30bf\u30b9\u30c8\u30ea\u30fc\u30e0\u3092\u53ef\u80fd\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>WebSocket \u306e\u4e3b\u306a\u7279\u5fb4:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u53cc\u65b9\u5411\u6027:<\/strong> \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3068\u30b5\u30fc\u30d0\u30fc\u306e\u4e21\u65b9\u304c\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u5f85\u3064\u3053\u3068\u306a\u304f\u3044\u3064\u3067\u3082\u30c7\u30fc\u30bf\u3092\u9001\u4fe1\u3067\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u6c38\u7d9a\u7684\u63a5\u7d9a:<\/strong> \u4e00\u5ea6\u300c\u30cf\u30f3\u30c9\u30b7\u30a7\u30a4\u30af\u300d\u304c\u5b8c\u4e86\u3059\u308b\u3068\u3001\u3069\u3061\u3089\u304b\u304c\u9589\u3058\u308b\u307e\u3067\u63a5\u7d9a\u304c\u7dad\u6301\u3055\u308c\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30b5\u30fc\u30d0\u30fc\u30d7\u30c3\u30b7\u30e5:<\/strong> \u66f4\u65b0\u304c\u767a\u751f\u3057\u305f\u77ac\u9593\u306b\u30b5\u30fc\u30d0\u30fc\u304c\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3078\u30c7\u30fc\u30bf\u3092\u300c\u30d7\u30c3\u30b7\u30e5\u300d\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u540c\u671f\u306b\u304a\u3044\u3066\u6975\u3081\u3066\u91cd\u8981\u3067\u3059\u3002<\/li>\n\n\n\n<li><strong>\u4f4e\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9:<\/strong> \u521d\u56de\u63a5\u7d9a\u5f8c\u306e WebSocket \u30d5\u30ec\u30fc\u30e0\u306f HTTP \u30d8\u30c3\u30c0\u30fc\u3088\u308a\u3082\u306f\u308b\u304b\u306b\u8efd\u91cf\u3067\u3042\u308b\u305f\u3081\u3001\u9045\u5ef6\u304c\u6e1b\u5c11\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e3b\u306a\u9055\u3044: REST vs. WebSocket<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><td><strong>\u6a5f\u80fd<\/strong><\/td><td><strong>REST API<\/strong><\/td><td><strong>WebSocket API<\/strong><\/td><\/tr><\/thead><tbody><tr><td><strong>\u30d7\u30ed\u30c8\u30b3\u30eb<\/strong><\/td><td>\u6a19\u6e96 HTTP<\/td><td>TCP \u30d9\u30fc\u30b9 (WS\/WSS)<\/td><\/tr><tr><td><strong>\u901a\u4fe1\u65b9\u5f0f<\/strong><\/td><td>\u5358\u65b9\u5411 (\u30ea\u30af\u30a8\u30b9\u30c8\u30fb\u30ec\u30b9\u30dd\u30f3\u30b9)<\/td><td>\u53cc\u65b9\u5411 (\u5168\u4e8c\u91cd)<\/td><\/tr><tr><td><strong>\u72b6\u614b\u7ba1\u7406<\/strong><\/td><td>\u30b9\u30c6\u30fc\u30c8\u30ec\u30b9 (\u5404\u56de\u4f7f\u3044\u5207\u308a)<\/td><td>\u30b9\u30c6\u30fc\u30c8\u30d5\u30eb (\u63a5\u7d9a\u7dad\u6301)<\/td><\/tr><tr><td><strong>\u30e1\u30ab\u30cb\u30ba\u30e0<\/strong><\/td><td>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u3088\u308b\u30d7\u30eb\u578b<\/td><td>\u30b5\u30fc\u30d0\u30fc\u306b\u3088\u308b\u30d7\u30c3\u30b7\u30e5\u578b<\/td><\/tr><tr><td><strong>\u9045\u5ef6 (\u30ec\u30a4\u30c6\u30f3\u30b7)<\/strong><\/td><td>\u9ad8\u3081 (\u30ea\u30af\u30a8\u30b9\u30c8\u6bce\u306e\u8ca0\u8377)<\/td><td>\u6975\u4f4e\u9045\u5ef6 (\u5e73\u5747 170ms)<\/td><\/tr><tr><td><strong>\u30c7\u30fc\u30bf\u5f62\u5f0f<\/strong><\/td><td>\u4e3b\u306b\u69cb\u9020\u5316 JSON<\/td><td>\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306a\u30d0\u30a4\u30ca\u30ea\/\u30c6\u30ad\u30b9\u30c8<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3068\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u306e\u6bd4\u8f03<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">1. \u9045\u5ef6\u3068\u66f4\u65b0\u983b\u5ea6<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>REST:<\/strong> \u30c7\u30fc\u30bf\u306e\u3084\u308a\u53d6\u308a\u3054\u3068\u306b\u65b0\u3057\u3044\u30ea\u30af\u30a8\u30b9\u30c8\/\u30ec\u30b9\u30dd\u30f3\u30b9\u30fb\u30b5\u30a4\u30af\u30eb\uff08\u30d8\u30c3\u30c0\u30fc\u3084\u30cf\u30f3\u30c9\u30b7\u30a7\u30a4\u30af\u3092\u542b\u3080\uff09\u304c\u5fc5\u8981\u306a\u305f\u3081\u3001\u9ad8\u983b\u5ea6\u306a\u66f4\u65b0\u306b\u306f\u5411\u304d\u307e\u305b\u3093\u3002<\/li>\n\n\n\n<li><strong>WebSocket:<\/strong> <strong>\u6975\u4f4e\u9045\u5ef6<\/strong>\u3092\u5b9f\u73fe\u3059\u308b\u3088\u3046\u306b\u8a2d\u8a08\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u91d1\u878d\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001WebSocket \u306e\u5e73\u5747\u30ec\u30b9\u30dd\u30f3\u30b9\u30bf\u30a4\u30e0\u306f\u7d04 170ms \u3067\u3042\u308a\u3001\u9ad8\u983b\u5ea6\u53d6\u5f15 (HFT) \u306e\u6a19\u6e96\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">2. \u91d1\u878d\u30c7\u30fc\u30bf\u306e\u53d6\u308a\u6271\u3044<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u904e\u53bb\u30c7\u30fc\u30bf:<\/strong> REST \u306f\u300c\u7d42\u5024\u300d(EOD) \u30c7\u30fc\u30bf\u3001\u904e\u53bb\u306e\u30c1\u30e3\u30fc\u30c8\uff08K\u7dda\/kline\uff09\u306e\u53d6\u5f97\u3001\u307e\u305f\u306f\u30a2\u30ab\u30a6\u30f3\u30c8\u8a2d\u5b9a\u306e\u7ba1\u7406\u306b\u6700\u9069\u3067\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30e9\u30a4\u30d6\u5e02\u5834\u30c7\u30fc\u30bf:<\/strong> \u6b69\u307f\u5024\uff08\u30c6\u30a3\u30c3\u30af\u30c7\u30fc\u30bf\uff09\u3001\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u677f\u60c5\u5831\u3001\u30df\u30ea\u79d2\u5358\u4f4d\u306e\u30e9\u30b0\u304c\u8a31\u3055\u308c\u306a\u3044\u30e9\u30a4\u30d6\u4fa1\u683c\u30b9\u30c8\u30ea\u30fc\u30df\u30f3\u30b0\u306b\u306f WebSocket \u304c\u4e0d\u53ef\u6b20\u3067\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p>REST \u3068 WebSocket \u306e\u3069\u3061\u3089\u3092\u9078\u629e\u3059\u308b\u304b\u306f\u3001\u6271\u3046<strong>\u30c7\u30fc\u30bf\u306e\u6027\u8cea<\/strong>\u306b\u3088\u3063\u3066\u5b8c\u5168\u306b\u6c7a\u307e\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>REST API \u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\uff1a<\/strong> \u5358\u767a\u306e\u30c7\u30fc\u30bf\u53d6\u5f97\u3001CRUD \u64cd\u4f5c\uff08\u4f5c\u6210\u30fb\u53d6\u5f97\u30fb\u66f4\u65b0\u30fb\u524a\u9664\uff09\u3001\u304a\u3088\u3073\u904e\u53bb\u30c7\u30fc\u30bf\u306e\u5206\u6790\u306b\u9069\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>WebSocket API \u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\uff1a<\/strong> \u30c8\u30ec\u30fc\u30c7\u30a3\u30f3\u30b0\u30fb\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u3084\u30a4\u30f3\u30b9\u30bf\u30f3\u30c8\u30fb\u30e1\u30c3\u30bb\u30fc\u30b8\u30f3\u30b0\u306a\u3069\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u30a4\u30d9\u30f3\u30c8\u99c6\u52d5\u578b\u306e\u300c\u30cf\u30fc\u30c8\u30d3\u30fc\u30c8\uff08\u751f\u5b58\u78ba\u8a8d\/\u7d99\u7d9a\u7684\u306a\u901a\u4fe1\uff09\u300d\u304c\u5fc5\u8981\u306a\u5834\u5408\u306b\u9069\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u73fe\u4ee3\u306e\u91d1\u878d\u5de5\u5b66\u3067\u306f\u3001<strong>\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u30fb\u30a2\u30d7\u30ed\u30fc\u30c1<\/strong>\u304c\u6700\u9069\u3068\u3055\u308c\u308b\u3053\u3068\u304c\u4e00\u822c\u7684\u3067\u3059\u3002\u307e\u305a REST \u3092\u4f7f\u7528\u3057\u3066\u8a8d\u8a3c\u3084\u904e\u53bb\u306e\u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u30fb\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3001\u305d\u306e\u5f8c\u3001\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306e\u5e02\u5834\u57f7\u884c\u306e\u305f\u3081\u306b WebSocket \u306b\u5207\u308a\u66ff\u3048\u308b\u3068\u3044\u3046\u624b\u6cd5\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u73fe\u4ee3\u306e\u30a6\u30a7\u30d6\u304a\u3088\u3073\u91d1\u878d\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u6839\u5e79\u306f\u3001\u30c7\u30fc\u30bf\u4ea4\u63db\u306b\u3042\u308a\u307e\u3059\u3002\u6570\u3042\u308b\u30d7\u30ed\u30c8\u30b3\u30eb\u306e\u4e2d\u3067\u3082\u3001REST (Representational State Transfer) \u3068 WebSocket \u306f\u6700\u3082\u6709\u529b\u306a\u9078\u629e\u80a2\u3067\u3059 [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":491,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-490","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guide"],"featured_image_src":"https:\/\/i0.wp.com\/blog.alltick.co\/ja-jp\/wp-content\/uploads\/sites\/2\/2026\/04\/REST%E4%B8%8EWebSocket%E5%8C%BA%E5%88%AB%E5%B0%81%E9%9D%A2-1.png?fit=2443%2C1235&ssl=1","author_info":{"display_name":"pang","author_link":"https:\/\/blog.alltick.co\/ja-jp\/author\/pang\/"},"_links":{"self":[{"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/posts\/490","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/comments?post=490"}],"version-history":[{"count":2,"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/posts\/490\/revisions"}],"predecessor-version":[{"id":494,"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/posts\/490\/revisions\/494"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/media\/491"}],"wp:attachment":[{"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/media?parent=490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/categories?post=490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.alltick.co\/ja-jp\/wp-json\/wp\/v2\/tags?post=490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}