I am trying to import API data from cryptopia.co.nz
They have publicly issued their APIs here:
https://www.cryptopia.co.nz/Forum/Thread/255
Let's say I choose to import this one:
https://www.cryptopia.co.nz/api/GetCurrencies
how should I do this?
I am trying to import API data from cryptopia.co.nz
They have publicly issued their APIs here:
https://www.cryptopia.co.nz/Forum/Thread/255
Let's say I choose to import this one:
https://www.cryptopia.co.nz/api/GetCurrencies
how should I do this?
Well, first, you need to get an API from the site owner and then use the API given to you on the HTTP Get method.
I am not sure how the API on this site works, but most likely would be
https://www.cryptopia.co.nz/(Your API goes in here)/GetCurrencies.
You then get a JSON object. You then parse JSON object.
Hi,
Something of this sort -
I am using this JSON ParserPlease Login or Register to view this content.
https://github.com/VBA-tools/VBA-JSON
References to be added from VBE. And also Microsoft XML v6.0 (Which I forgot to add in the Screenshot)
See the attached file
Last edited by NeedForExcel; 01-12-2018 at 12:26 AM.
Cheers!
Deep Dave
I will try once I get back home from work!
Is it possible to make it a live data? To refresh it as often as possible, for example every minute (like in PQ)?
Thank you very much.
So I downloaded your excel worksheet and it looks like it works.
The thing is, unfortunately, I do not understand a thing about VBA, so I am unable to transfer this thing to my own worksheet.
Also, I tried to replace that url with this one:
https://www.cryptopia.co.nz/api/GetMarkets
then it did not work.
Does it mean that there are some changes that must be done with each URL?
Hi,
If you see this part, the initial API had data for Symbol, Name, Algorithm etc.Please Login or Register to view this content.
In this API, there is data for TradePairId, AskPrice etc.
All you have to do is change the Tags which your API has and the below line (Highlighted in Red) based on the number of tags - 1 as the Array bound starts with 0. (I have included only 5, you can include more if you want.)Please Login or Register to view this content.
Apart from the above suggested change, all you will need to change is the API URL.Please Login or Register to view this content.
Last edited by NeedForExcel; 01-12-2018 at 06:35 AM.
Thanks.
I change it as you said here, but it would only return me three columns, tradepairid, ask and bid prices, but no low and high prices.
Why is that?
Can I do that with XML?
Or it has necessarily to be JSON?
If so, how to know if my API is JSON or XML?
I am watching this tutorial and would like to use it as an example:
https://www.youtube.com/watch?v=mmT4qxOnEZk&t=603s
Have you changed this line?
ReDim Results(Parsed("Data").Count - 1, 4)
Also, JSON or XML are output which you need to parse.
Both have different structures and can be figured out if it is XML/JSON just by looking at the output.
You can have your API return XML as well as JSON, both can be parsed.
Yes, I did.
I am using exactly this line now:
So, when working with the API in my case, I can do both - XML and JSON? Its of my choice?Please Login or Register to view this content.
This line is changed a bit
Notice + 1 added at the end. I missed it out by error.Please Login or Register to view this content.
This should do it.
The easiest way is to find it in the API's documentation. You can also find it on the header response.
Hello,
I have been unsuccessfully trying to import this API into excel:
https://api.kraken.com/0/public/Ticker
Could anybody help me with this please?
still looking for help!!
How to make this macro refresh itself automatically as often as possible without bringing me to the sheet the macro belongs?
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks