{"id":10622,"date":"2026-01-22T16:02:06","date_gmt":"2026-01-22T08:02:06","guid":{"rendered":"https:\/\/blog.alltick.co\/zh-CN\/?p=10622"},"modified":"2026-01-22T16:02:06","modified_gmt":"2026-01-22T08:02:06","slug":"%e6%89%8b%e6%8a%8a%e6%89%8b%e7%94%a8%e8%82%a1%e7%a5%a8api%e5%bf%ab%e9%80%9f%e6%8e%a5%e5%85%a5%e5%ae%9e%e6%97%b6%e5%92%8c%e5%8e%86%e5%8f%b2%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"https:\/\/blog.alltick.co\/zh-CN\/%e6%89%8b%e6%8a%8a%e6%89%8b%e7%94%a8%e8%82%a1%e7%a5%a8api%e5%bf%ab%e9%80%9f%e6%8e%a5%e5%85%a5%e5%ae%9e%e6%97%b6%e5%92%8c%e5%8e%86%e5%8f%b2%e6%95%b0%e6%8d%ae\/","title":{"rendered":"\u624b\u628a\u624b\u7528\u80a1\u7968API\u5feb\u901f\u63a5\u5165\u5b9e\u65f6\u548c\u5386\u53f2\u6570\u636e"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"800\" height=\"414\" src=\"https:\/\/i0.wp.com\/blog.alltick.co\/zh-CN\/wp-content\/uploads\/2026\/01\/%E7%94%9F%E6%88%90%E7%AC%A6%E5%90%88%E8%82%A1%E7%A5%A8-API-%E6%96%87%E7%AB%A0%E7%9A%84%E9%85%8D%E5%9B%BE.png?resize=800%2C414&#038;ssl=1\" alt=\"\" class=\"wp-image-10623\" srcset=\"https:\/\/i0.wp.com\/blog.alltick.co\/zh-CN\/wp-content\/uploads\/2026\/01\/%E7%94%9F%E6%88%90%E7%AC%A6%E5%90%88%E8%82%A1%E7%A5%A8-API-%E6%96%87%E7%AB%A0%E7%9A%84%E9%85%8D%E5%9B%BE-scaled.png?resize=1024%2C530&amp;ssl=1 1024w, https:\/\/i0.wp.com\/blog.alltick.co\/zh-CN\/wp-content\/uploads\/2026\/01\/%E7%94%9F%E6%88%90%E7%AC%A6%E5%90%88%E8%82%A1%E7%A5%A8-API-%E6%96%87%E7%AB%A0%E7%9A%84%E9%85%8D%E5%9B%BE-scaled.png?resize=300%2C155&amp;ssl=1 300w, https:\/\/i0.wp.com\/blog.alltick.co\/zh-CN\/wp-content\/uploads\/2026\/01\/%E7%94%9F%E6%88%90%E7%AC%A6%E5%90%88%E8%82%A1%E7%A5%A8-API-%E6%96%87%E7%AB%A0%E7%9A%84%E9%85%8D%E5%9B%BE-scaled.png?resize=768%2C397&amp;ssl=1 768w, https:\/\/i0.wp.com\/blog.alltick.co\/zh-CN\/wp-content\/uploads\/2026\/01\/%E7%94%9F%E6%88%90%E7%AC%A6%E5%90%88%E8%82%A1%E7%A5%A8-API-%E6%96%87%E7%AB%A0%E7%9A%84%E9%85%8D%E5%9B%BE-scaled.png?resize=1536%2C794&amp;ssl=1 1536w, https:\/\/i0.wp.com\/blog.alltick.co\/zh-CN\/wp-content\/uploads\/2026\/01\/%E7%94%9F%E6%88%90%E7%AC%A6%E5%90%88%E8%82%A1%E7%A5%A8-API-%E6%96%87%E7%AB%A0%E7%9A%84%E9%85%8D%E5%9B%BE-scaled.png?resize=2048%2C1059&amp;ssl=1 2048w, https:\/\/i0.wp.com\/blog.alltick.co\/zh-CN\/wp-content\/uploads\/2026\/01\/%E7%94%9F%E6%88%90%E7%AC%A6%E5%90%88%E8%82%A1%E7%A5%A8-API-%E6%96%87%E7%AB%A0%E7%9A%84%E9%85%8D%E5%9B%BE-scaled.png?w=1600&amp;ssl=1 1600w, https:\/\/i0.wp.com\/blog.alltick.co\/zh-CN\/wp-content\/uploads\/2026\/01\/%E7%94%9F%E6%88%90%E7%AC%A6%E5%90%88%E8%82%A1%E7%A5%A8-API-%E6%96%87%E7%AB%A0%E7%9A%84%E9%85%8D%E5%9B%BE-scaled.png?w=2400&amp;ssl=1 2400w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\u5728\u5f00\u53d1\u5de5\u5177\u6216\u7b56\u7565\u7cfb\u7edf\u65f6\uff0c\u6570\u636e\u6765\u6e90\u662f\u6700\u6838\u5fc3\u7684\u73af\u8282\u3002\u5bf9\u5f00\u53d1\u8005\u6765\u8bf4\uff0c\u91cd\u70b9\u4e0d\u662f\u7406\u89e3\u80a1\u7968\u672c\u8eab\uff0c\u800c\u662f<strong>\u5982\u4f55\u5feb\u901f\u3001\u7a33\u5b9a\u3001\u53ef\u9760\u5730\u83b7\u53d6\u6570\u636e<\/strong>\u3002\u5728\u6211\u5b9e\u9645\u9879\u76ee\u4e2d\uff0c\u4f7f\u7528\u80a1\u7968API\u80fd\u591f\u8ba9\u6570\u636e\u63a5\u5165\u53d8\u5f97\u975e\u5e38\u7b80\u5355\uff0c\u540c\u65f6\u4fdd\u8bc1\u5904\u7406\u6548\u7387\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>API \u63a5\u5165\u7684\u57fa\u672c\u6b65\u9aa4<\/strong><\/h2>\n\n\n\n<p>\u63a5\u5165\u80a1\u7968API\u7684\u8fc7\u7a0b\u975e\u5e38\u76f4\u63a5\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u83b7\u53d6 API Key\uff0c\u8fd9\u662f\u8bbf\u95ee\u51ed\u8bc1<\/li>\n\n\n\n<li>\u9009\u62e9\u6570\u636e\u63a5\u53e3\uff1a\u5b9e\u65f6\u884c\u60c5\u6216\u5386\u53f2\u6570\u636e<\/li>\n\n\n\n<li>\u6784\u9020\u8bf7\u6c42\u5e76\u89e3\u6790\u8fd4\u56de\u6570\u636e<\/li>\n<\/ol>\n\n\n\n<p>\u4ee5 Python \u4e3a\u4f8b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>import requests<br><br>API_KEY = &#8220;\u4f60\u7684_API_KEY&#8221;<br>url = &#8220;https:\/\/api.alltick.co\/v1\/stock\/quote&#8221;<br>params = {<br>&nbsp; &nbsp; &#8220;symbol&#8221;: &#8220;AAPL&#8221;,<br>&nbsp; &nbsp; &#8220;apikey&#8221;: API_KEY<br>}<br><br>response = requests.get(url, params=params)<br>data = response.json()<br>print(data)<br><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u53ea\u8981\u4e09\u6b65\uff0c\u5c31\u80fd\u5f97\u5230\u7ed3\u6784\u5316\u7684\u6570\u636e\uff0c\u65b9\u4fbf\u540e\u7eed\u5904\u7406\u3002\u8fd9\u4e2a\u6d41\u7a0b\u5728 Java\u3001Node.js\u3001Go \u7b49\u8bed\u8a00\u4e2d\u4e5f\u662f\u4e00\u81f4\u7684\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u5b9e\u65f6\u6570\u636e\u63a5\u5165<\/strong><\/h2>\n\n\n\n<p>\u5b9e\u65f6\u6570\u636e\u9002\u5408\u505a <strong>\u76d1\u63a7\u6216\u770b\u677f<\/strong>\uff0cWebSocket \u662f\u9ad8\u6548\u65b9\u5f0f\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>from websocket import create_connection<br><br>ws = create_connection(&#8220;wss:\/\/api.alltick.co\/v1\/stock\/realtime?symbol=AAPL&amp;apikey=\u4f60\u7684_API_KEY&#8221;)<br>while True:<br>&nbsp; &nbsp; data = ws.recv()<br>&nbsp; &nbsp; print(data)<br><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u76f8\u6bd4 HTTP \u8f6e\u8be2\uff0cWebSocket \u53ef\u4ee5\u6301\u7eed\u63a8\u9001\u6700\u65b0\u6570\u636e\uff0c\u5ef6\u8fdf\u4f4e\uff0c\u9002\u5408\u5f00\u53d1\u8005\u9700\u8981\u5373\u65f6\u54cd\u5e94\u7684\u573a\u666f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u5386\u53f2\u6570\u636e\u83b7\u53d6<\/strong><\/h2>\n\n\n\n<p>\u5386\u53f2\u6570\u636e\u7528\u4e8e\u5206\u6790\u548c\u9a8c\u8bc1\u7cfb\u7edf\u903b\u8f91\uff0c\u4f8b\u5982\u56de\u6d4b\u6216\u8d8b\u52bf\u5206\u6790\u3002\u8bf7\u6c42\u53ea\u9700\u6307\u5b9a\u65f6\u95f4\u8303\u56f4\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>params = {<br>&nbsp; &nbsp; &#8220;symbol&#8221;: &#8220;AAPL&#8221;,<br>&nbsp; &nbsp; &#8220;start&#8221;: &#8220;2025-01-01&#8221;,<br>&nbsp; &nbsp; &#8220;end&#8221;: &#8220;2025-01-20&#8221;,<br>&nbsp; &nbsp; &#8220;interval&#8221;: &#8220;1min&#8221;,<br>&nbsp; &nbsp; &#8220;apikey&#8221;: API_KEY<br>}<br>response = requests.get(&#8220;https:\/\/api.alltick.co\/v1\/stock\/history&#8221;, params=params)<br>data = response.json()<br><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u8fd4\u56de\u7684\u6570\u636e\u53ef\u4ee5\u76f4\u63a5\u5bfc\u5165 Pandas \u8fdb\u884c\u6e05\u6d17\u548c\u5206\u6790\uff0c\u8f7b\u677e\u751f\u6210\u65f6\u95f4\u5e8f\u5217\u3001\u8d8b\u52bf\u56fe\u6216\u4ea4\u6613\u4fe1\u53f7\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u591a\u8bed\u8a00\u652f\u6301\u4e0e\u96c6\u6210\u5b9e\u8df5<\/strong><\/h2>\n\n\n\n<p>\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u80a1\u7968API\u7684\u63a5\u5165\u8bed\u8a00\u53ef\u4ee5\u7075\u6d3b\u9009\u62e9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Python\uff1a\u5feb\u901f\u539f\u578b\u3001\u6570\u636e\u5206\u6790<\/li>\n\n\n\n<li>Java \/ Kotlin\uff1a\u540e\u7aef\u7a33\u5b9a\u670d\u52a1<\/li>\n\n\n\n<li>Node.js\uff1a\u5b9e\u65f6\u770b\u677f\u5c55\u793a<\/li>\n\n\n\n<li>Go\uff1a\u9ad8\u5e76\u53d1\u884c\u60c5\u8ba2\u9605<\/li>\n<\/ul>\n\n\n\n<p>\u4e0d\u8bba\u8bed\u8a00\u5982\u4f55\u53d8\u5316\uff0c\u903b\u8f91\u4fdd\u6301\u4e00\u81f4\uff1a<strong>\u6784\u9020\u8bf7\u6c42 \u2192 \u83b7\u53d6\u6570\u636e \u2192 \u5904\u7406\u6570\u636e \u2192 \u96c6\u6210\u4e1a\u52a1\u903b\u8f91<\/strong>\u3002\u8fd9\u79cd\u65b9\u5f0f\u80fd\u8ba9\u5f00\u53d1\u8005\u5feb\u901f\u642d\u5efa\u6570\u636e\u9a71\u52a8\u7cfb\u7edf\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u5b9e\u6218\u7ecf\u9a8c\u4e0e\u5f00\u53d1\u6280\u5de7<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u9650\u6d41\u63a7\u5236<\/strong>\uff1aAPI\u901a\u5e38\u6709\u9650\u5236\uff0c\u5408\u7406\u8bbe\u8ba1\u7f13\u5b58\u548c\u8bf7\u6c42\u9891\u7387\u907f\u514d\u88ab\u62d2<\/li>\n\n\n\n<li><strong>\u6570\u636e\u5b8c\u6574\u6027<\/strong>\uff1a\u5b9e\u65f6\u6570\u636e\u53ef\u80fd\u5076\u5c14\u4e22\u5931\uff0c\u53ef\u4ee5\u7ed3\u5408\u5386\u53f2\u63a5\u53e3\u8865\u9f50<\/li>\n\n\n\n<li><strong>\u5bb9\u9519\u4e0e\u91cd\u8bd5<\/strong>\uff1a\u77ed\u6682\u7f51\u7edc\u5f02\u5e38\u53ef\u4ee5\u8bbe\u8ba1\u91cd\u8bd5\u903b\u8f91\uff0c\u4fdd\u8bc1\u7cfb\u7edf\u7a33\u5b9a<\/li>\n<\/ul>\n\n\n\n<p>\u8fd9\u4e9b\u90fd\u662f\u5f00\u53d1\u8005\u5728\u9879\u76ee\u4e2d\u6700\u5e38\u9047\u5230\u7684\u95ee\u9898\uff0c\u638c\u63e1\u540e\u53ef\u4ee5\u8ba9\u7cfb\u7edf\u5728\u9ad8\u5e76\u53d1\u3001\u957f\u65f6\u95f4\u8fd0\u884c\u4e0b\u4f9d\u7136\u53ef\u9760\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u5f00\u53d1\u8005\u89c6\u89d2\u7684\u4ef7\u503c<\/strong><\/h2>\n\n\n\n<p>\u901a\u8fc7\u80a1\u7968API\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5feb\u901f\u83b7\u53d6\u9ad8\u8d28\u91cf\u6570\u636e\uff0c\u628a\u7cbe\u529b\u653e\u5728<strong>\u6570\u636e\u5904\u7406\u548c\u4e1a\u52a1\u903b\u8f91<\/strong>\u4e0a\uff0c\u800c\u4e0d\u662f\u7ea0\u7ed3\u4e8e\u6293\u53d6\u3001\u89e3\u6790\u6216\u7ef4\u62a4\u6570\u636e\u6e90\u3002\u65e0\u8bba\u662f\u505a\u53ef\u89c6\u5316\u770b\u677f\u3001\u56de\u6d4b\u7cfb\u7edf\uff0c\u8fd8\u662f\u6784\u5efa\u5b9e\u65f6\u76d1\u63a7\u5de5\u5177\uff0cAPI \u90fd\u80fd\u8ba9\u5f00\u53d1\u6d41\u7a0b\u66f4\u9ad8\u6548\u3001\u66f4\u7a33\u5b9a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5f00\u53d1\u5de5\u5177\u6216\u7b56\u7565\u7cfb\u7edf\u65f6\uff0c\u6570\u636e\u6765\u6e90\u662f\u6700\u6838\u5fc3\u7684\u73af\u8282\u3002\u5bf9\u5f00\u53d1\u8005\u6765\u8bf4\uff0c\u91cd\u70b9\u4e0d\u662f\u7406\u89e3\u80a1\u7968\u672c\u8eab\uff0c\u800c\u662f\u5982\u4f55\u5feb\u901f\u3001\u7a33\u5b9a\u3001\u53ef\u9760\u5730&#8230;<\/p>\n","protected":false},"author":5,"featured_media":10625,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-10622","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tick-data-wiki"],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.alltick.co\/zh-CN\/wp-json\/wp\/v2\/posts\/10622","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.alltick.co\/zh-CN\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.alltick.co\/zh-CN\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.alltick.co\/zh-CN\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.alltick.co\/zh-CN\/wp-json\/wp\/v2\/comments?post=10622"}],"version-history":[{"count":1,"href":"https:\/\/blog.alltick.co\/zh-CN\/wp-json\/wp\/v2\/posts\/10622\/revisions"}],"predecessor-version":[{"id":10624,"href":"https:\/\/blog.alltick.co\/zh-CN\/wp-json\/wp\/v2\/posts\/10622\/revisions\/10624"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.alltick.co\/zh-CN\/wp-json\/wp\/v2\/media\/10625"}],"wp:attachment":[{"href":"https:\/\/blog.alltick.co\/zh-CN\/wp-json\/wp\/v2\/media?parent=10622"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.alltick.co\/zh-CN\/wp-json\/wp\/v2\/categories?post=10622"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.alltick.co\/zh-CN\/wp-json\/wp\/v2\/tags?post=10622"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}