0

我一直在尝试以 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}

没有真正说明这些数据点的来源或它们的确切含义。

非常感谢。

-科林

4

2 回答 2

0

Poloniex API 文档非常稀缺。对于订单簿条目,您可以指定深度:

https://poloniex.com/public?command=returnOrderBook¤cyPair=BTC_NXT &depth=100

通过这种方式,您可以获得或多或少的出价和询价条目。

据我所知(从他们的支持页面和论坛),您无法指定下订单的时间范围。此命令会及时显示特定时刻的所有活动订单。通过使用他们的 websocket,您还可以获得订单簿的实时提要。

于 2017-09-22T17:53:32.780 回答
0

API 文档

返回订单簿

返回给定市场的订单簿,以及用于 Push API 的序列号和指定市场是否冻结的指标。您可以将 currencyPair 设置为“all”以获取所有市场的订单簿。样本输出:

{“询问”:[[0.00007600,1164],[0.00007620,1300],...],“出价”:[[0.00006901,200],[0.00006900,408],...],“isFrozen”:0 ,“序列”:18849}

或者,对于所有市场:

{"BTC_NXT":{"询价":[[0.00007600,1164],[0.00007620,1300], ... ], "出价":[[0.00006901,200],[0.00006900,408], ... ], “isFrozen”:0,“seq”:149},“BTC_XMR”:...}

致电:https ://poloniex.com/public?command=returnOrderBook¤cyPair=BTC_NXT&depth=10

因此(正如 Florin Alexandru 已经提到的),您需要添加“深度”查询参数。

数据由请求和出价的元组组成。第一个数字是该条目的价格,第二个数字是该条目的(最大)销售/购买量。


如果您不需要实际报价,我建议您使用 returnChartData:

返回图表数据

返回烛台图表数据。必需的 GET 参数是“currencyPair”、“period”(烛台周期,以秒为单位;有效值为 300、900、1800、7200、14400 和 86400)、“start”和“end”。“开始”和“结束”以 UNIX 时间戳格式给出,用于指定返回数据的日期范围。样本输出:

[{"date":1405699200,"high":0.0045388,"low":0.00403001,"open":0.00404545,"close":0.00427592,"volume":44.11655644, "quoteVolume":10259.29079097,"weightedAverage":0.0043001} , ...]

致电:https ://poloniex.com/public?command=returnChartData¤cyPair=BTC_XMR&start=1405699200&end=9999999999&period=14400

于 2017-10-13T22:35:10.003 回答