手把手教你学习BitMEX API之Announcement

以下教程均基于BitMex官方API文档,访问BitMex请自备梯子,比特币量化交易交流群:154502997BitMEX/OKEX量化机器人

BitMex  API在数字货币交易平台中功能最为强大,覆盖面非常广,可以说你所能想到的简单功能BitMEX API都可以轻松的做到,比如现有挂单的平均挂单价格,其他数字货币平台的API并不会提供这样的功能,你只能自己去写代码实现,而BitMEX却只需要几个简单的参数就可以返回这种数据,虽然BitMEX API如此强大,但官方却没有中文文档,对国人来说是一个较大的障碍,作为开篇,今天讲的第一功能就是Announcement

Announcement无需认证,直接发送http请求,返回的是官方的最新公告信息。

请求地址:

https://www.bitmex.com/api/v1/announcement

参数:

columns:获取字段的个数,留空为全部获取

我们通过BitMex restapi浏览器测试一下,可以得到如下返回值:

[  {    "id": 10596,    "title": "New EOS Futures Contract",    "date": "2018-06-07T05:41:28Z",    "content": "<p>Over the past month we have made some significant performance improvements to the BitMEX trading engine, increasing the overall capacity of the platform and reducing System Overload responses.  We will soon be publishing the second part in our series on BitMEX’s growth and how we are scaling which will detail the recent improvements we have made, and what we’re currently working on.  You can find part one <a href=\"https://blog.bitmex.com/bitmex-technology-scaling-part-1/\">here</a>.</p>\n<p>As a result of the increased capacity and due to popular demand, we will be listing the BitMEX EOS Token / Bitcoin 29 June 2018 futures contract, EOSM18, on or before 7 June 2018 07:00 UTC.</p>\n",    "link": "https://blog.bitmex.com/site_announcement/new-eos-futures-contract/"  },  {    "id": 10439,    "title": "BitMEX Downtime, May 17 2018",    "date": "2018-05-18T05:54:29Z",    "content": "<p>Please see <a href=\"https://blog.bitmex.com/bitmex-downtime-may-17-2018/\">the linked post</a> for more information on exchange instability and downtime on May 17, 2018.</p>\n",    "link": "https://blog.bitmex.com/site_announcement/bitmex-downtime-may-17-2018/"  },  {    "id": 10262,    "title": "BitMEX Technology Scaling: Part 1",    "date": "2018-04-30T03:28:20Z",    "content": "<p>We’ve published <a href=\"https://blog.bitmex.com/bitmex-technology-scaling-part-1/\">the first of a series on understanding the growth of the BitMEX platform, performance bottlenecks, and scaling strategies</a>.</p>\n",    "link": "https://blog.bitmex.com/site_announcement/bitmex-technology-scaling-part-1/"  },  {    "id": 9734,    "title": "Altcoin Futures Contracts Changes",    "date": "2018-03-29T05:22:05Z",    "content": "<p>On 30 March 2018, we are making the following changes to Altcoin products:</p>\n<ul>\n<li>The 0.25% settlement fee <strong>will be removed</strong> on future products.<strong> </strong>We hope that will encourage greater liquidity by removing barriers to entry and exit.</li>\n<li>We <strong>will be removing</strong> the DASH, ETC, NEO, XMR, XLM, and ZEC pairs after they expire, for the time being. This is to free up trading engine capacity on our more popular contracts. After certain optimisations are made, we may re-list them.</li>\n<li>The ADA, BCH, ETH, LTC, and XRP contracts <strong>will be re-listed</strong> for another quarterly today:\n<ul>\n<li>BitMEX Cardano / Bitcoin 29 June 2018 futures contract (ADAM18)</li>\n<li>BitMEX Bitcoin Cash / Bitcoin 29 June 2018 futures contract (BCHM18)</li>\n<li>BitMEX Ether / Bitcoin 29 June 2018 futures contract (ETHM18)</li>\n<li>BitMEX Litecoin / Bitcoin 29 June 2018 futures contract (LTCM18)</li>\n<li>BitMEX Ripple / Bitcoin 29 June 2018 futures contract (XRPM18)</li>\n</ul>\n</li>\n</ul>\n",    "link": "https://blog.bitmex.com/site_announcement/altcoin-futures-contracts-changes/"  },  {    "id": 9712,    "title": "Share Orders, Positions, and PNL with Trollbox Slash Commands",    "date": "2018-03-26T04:17:30Z",    "content": "<p>Today, BitMEX launches an easy, verifiable way to share your positions, orders, and PNL with the Trollbox community: slash commands!</p>\n<p>Just type <code>/</code> at the beginning of one of the following combinations to send an official view of your activity on BitMEX:</p>\n<ol>\n<li><code>/orders</code> : Share all your open orders.</li>\n<li><code>/orders &lt;symbol&gt;</code>: Share your open orders for a symbol.</li>\n<li><