我一直在尝试使用4小时的间隔来获取特定对的最后几个月的历史数据。我被引导到以下格式来获取数据:
https://poloniex.com/public?command=returnOrderBook¤cyPair=BTC_ETH
但有没有办法可以使用这些链接指定持续时间和时间间隔?
以上链接仅返回非常少量的数据:
{"asks":[["0.07294262",3.85122249],["0.07294900",2.26083751],["0.07295000",0.27748267],["0.07297000",34.27004797],["0.07299956",9.30579032],["0.07300000",103.64388503],["0.07300018",0.72164225],["0.07300074",0.12641927],["0.07300121",0.03214637],["0.07300333",0.96234537],["0.07300529",0.053669],["0.07300748",0.01492704],["0.07301000",0.01382964],["0.07301075",0.02986241],["0.07301130",0.00511563],["0.07301925",0.06533743],["0.07302025",0.68858894],["0.07302388",0.00687104],["0.07302902",9.97493],["0.07302950",0.0484817],["0.07303112",2.38806309],["0.07303301",0.00197615],["0.07303370",0.00482243],["0.07303883",0.00414447],["0.07304410",0.00273807],["0.07304678",0.00543898],["0.07305040",0.01992],["0.07305356",0.0020625],["0.07305401",0.01992],["0.07305983",0.00824112],["0.07306577",0.00197615],["0.07306612",0.00594431],["0.07306892",0.002339],["0.07306967",0.01719775],["0.07307227",0.10283005],["0.07307859",0.002],["0.07308270",0.00510212],["0.07308420",0.002],["0.07308426",0.01724074],["0.07309242",0.02155794],["0.07309631",95.1377819],["0.07309632",49.76001349],["0.07309859",0.002],["0.07310000",31.31704335],["0.07310171",4.36135985],["0.07310212",137.17830882],["0.07310813",0.00621748],["0.07310819",0.00207332],["0.07310827",0.00245133],["0.07311173",0.029925]],"bids":[["0.07293000",4.09621352],["0.07289104",1],["0.07286573",13.56110606],["0.07286570",7.29719389],["0.07286206",6.75617681],["0.07284000",0.3823122],["0.07280223",15.63],["0.07280222",11.55307627],["0.07280000",3.26644858],["0.07279168",16],["0.07277763",3.49124993],["0.07275720",0.00516941],["0.07275307",2.90757784],["0.07275001",97.51342245],["0.07275000",17.74562526],["0.07274078",14.1],["0.07271471",12.37463714],["0.07270471",12.9],["0.07270230",0.00515932],["0.07270000",13.82385472],["0.07266474",14.7],["0.07265576",0.02465678],["0.07265458",0.09348869],["0.07265391",0.00963472],["0.07264610",0.00518762],["0.07263973",0.01514323],["0.07263608",0.02753452],["0.07262454",14.09],["0.07260920",0.00517377],["0.07260001",264.79356832],["0.07260000",28.09911486],["0.07258836",0.01253133],["0.07258678",14],["0.07258191",6.48535134],["0.07258160",1.93865965],["0.07257285",0.02163167],["0.07256098",0.24371694],["0.07255820",0.00515266],["0.07255422",0.21470731],["0.07255235",0.01585062],["0.07254862",0.22614504],["0.07254528",14],["0.07254433",0.01929854],["0.07253970",0.2],["0.07253112",0.25],["0.07252819",0.03338578],["0.07251200",0.02836056],["0.07250826",1.07484],["0.07250245",0.17763637],["0.07250000",76.3954694]],"isFrozen":"0","seq":408169450}
没有真正说明这些数据点的来源或它们究竟是什么意思。
非常感谢。
-Colin
答案 0 :(得分:0)
Poloniex API文档非常缺乏。对于订单簿条目,您可以指定深度:
https://poloniex.com/public?command=returnOrderBook¤cyPair=BTC_NXT的&安培;深度= 100 强>
通过这种方式,您可以获得更多或更少的出价和询问条目。
从我可以收集的内容(来自他们的支持页面和论坛),您无法指定这些订单何时下达的时间范围。此命令显示特定时刻的所有活动订单。通过使用他们的websocket,您还可以获得订单簿的实时订阅源。
答案 1 :(得分:0)
<强> returnOrderBook 强>
返回给定市场的订单簿,以及用于Push API的序列号和指示市场是否冻结的指标。您可以将currencyPair设置为&#34; all&#34;获得所有市场的订单。样本输出:
{&#34;问&#34;:[[0.00007600,1164],[0.00007620,1300],...],&#34;出价&#34;:[[0.00006901,200],[0.00006900, 408],...],&#34; isFrozen&#34;:0,&#34; seq&#34;:18849}
或者,对于所有市场:
{&#34; BTC_NXT&#34;:{&#34;问&#34;:[[0.00007600,1164],[0.00007620,1300],...],&#34;出价&#34;: [[0.00006901,200],[0.00006900,408],...],&#34; isFrozen&#34;:0,&#34; seq&#34;:149},&#34; BTC_XMR&#34;: ...}
致电:https://poloniex.com/public?command=returnOrderBook¤cyPair=BTC_NXT&depth=10
因此(正如弗洛林亚历山德鲁已经提到的那样)你需要添加“深度”&#39;查询参数。
数据包含要求和出价的元组。第一个数字是此条目的价格,第二个是该条目的销售/购买的(最大)金额。
如果您不需要实际优惠,我建议使用returnChartData:
<强> returnChartData 强>
返回烛台图表数据。所需的GET参数是&#34; currencyPair&#34;,&#34; period&#34; (烛台时间以秒为单位;有效值为300,900,1800,7200,14400和86400),&#34;开始&#34;和&#34;结束&#34;。 &#34;开始&#34;和&#34;结束&#34;以UNIX时间戳格式给出,用于指定返回数据的日期范围。样本输出:
[{&#34;日期&#34;:1405699200,&#34;高&#34;:0.0045388,&#34;低&#34;:0.00403001,&#34;开&#34;:0.00404545,& #34;靠近&#34;:0.00427592,&#34;体积&#34;:44.11655644, &#34; quoteVolume&#34;:10259.29079097,&#34; weightedAverage&#34;:0.00430015},...]