MtGox API Overview and explanation of steps required to create connection


I am trying to write a simple app that uses the Mt Gox. (bitcoin exchange) API.

It's very simple to use the price API it's just a http request that returns a .JSON string.

However now I want to do more with my app, I was thinking it would be good to be able to log into the users mtgox account and show their balance of bitcoin.

I have an API key (you can generate one on their site) but I'm finding it really hard to understand whats required to generate a connection and pull the balance.

Is there anyone who might be able to point me in the right direction?

I have researched quite a bit and turned up very little information - API Overview:

In the above link they have some python code, but i'm finding it difficult to translate into Objective C.

So if anyone can:

A. Give me a highlevel overview of the steps required to log in and get a bitcoin balance using the API.

B. Give me some pointers on how to turn their Python example into Objective C I would really appreciate it.

I understand to use the API I need to use this URL to Get my current balance -- however first I need to get a "nonce" parameter to the post data (which must be an ever-increasing interger, for example with PHP in 64bits: (int)(microtime(true)*1000000)) and two HTTP headers: Rest-Key (your key) nad Rest-Sign (a signature generated by doing a sha512-hmac on the POST data with the secret as key, encoded in base64).

I found this documentation: -- still not clear however, how to code in Objective C thanks


Posted 2013-06-06T16:48:25.393

Reputation: 133

This is a badly titled question. Please give some kind of indication of what the question is about in the title. – user1068446 – 2013-08-09T04:32:43.897

Updated thanks. need to type more chars because of the silly limit where by you cannot just say thank you. – Woodstock – 2013-08-09T06:27:51.607



Take a look at the Java XChange project

While it is not Objective C it will provide you with all the details you'll need to get your library off the ground including the HMAC authentication process and websockets.

You'll also find a range of other exchanges supported so you can implement those as well thus providing your application with a broader range of potential users since not everyone uses MtGox these days.

Gary Rowe

Posted 2013-06-06T16:48:25.393

Reputation: 7 383

Yep, I'm very pleased with the way that XChange has shaped up. There's been a lot of good work done on it. – Gary Rowe – 2013-08-09T11:27:17.160

1going to mark this as answered as yours is as close as I'll get! – Woodstock – 2013-08-09T13:52:45.417