json 通过 VBA/宏通过 API 将数据提取到 Excel 中?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20360288/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Pulling data through API into Excel via VBA/Macro?
提问by Anthony
I am trying to use the API on the following site, https://www.cryptsy.com/pages/api, to download information to Excel.
我正在尝试使用以下站点https://www.cryptsy.com/pages/api上的 API将信息下载到 Excel。
I have never worked with JSON before, and I'm confused how to implement this. In particular I am interested in http://pubapi.cryptsy.com/api.php?method=singlemarketdata&marketid={MARKET ID}
我以前从未使用过 JSON,我很困惑如何实现它。特别是我对http://pubapi.cryptsy.com/api.php?method=singlemarketdata&marketid={MARKET ID}感兴趣
I need to be signed in I think, so I can generate my own API key. Is it also possible to execute a trade on this API using an Excel macro?
我想我需要登录,这样我才能生成我自己的 API 密钥。是否也可以使用 Excel 宏在此 API 上执行交易?
回答by 0rangeCrush
I am working on a similar project.
我正在做一个类似的项目。
I suggest going to http://ramblings.mcpher.com/Home/excelquirks/json/declaritive/populatingThis is effectively the solution I am using. His cObject class converts the json into an Excel object with properties and methods, which is easily manipulated. It will put some of the data into a sheet for you.
我建议去http://ramblings.mcpher.com/Home/excelquirks/json/declaritive/populating这实际上是我正在使用的解决方案。他的cObject类将json转换成带有属性和方法的Excel对象,操作起来很方便。它将为您将一些数据放入工作表中。
On the page he has a code example where he details how it is working. You should be able to change the URL to the cryptsy public API. You will have to write code to handle the returned data. If you figure out how to connect to the private API, give me a shout as I am still working on that one.
在页面上,他有一个代码示例,详细说明了它是如何工作的。您应该能够将 URL 更改为 cryptsy 公共 API。您将不得不编写代码来处理返回的数据。如果您想知道如何连接到私有 API,请告诉我,因为我仍在研究该 API。

