Question: So far I have seen some Perl modules; [Finance:MtGox](http://search.cpan.org/~mndrix/Finance-MtGox-0.01/lib/Finance/MtGox.pm) and [Webservice:MtGox](http://search.cpan.org/~beppu/WebService-MtGox-0.05/lib/WebService/MtGox.pm) for interacting with Mt.Gox, a [Ruby gem for Mt.Gox](http://rubygems.org/gems/mtgox) and a [Python based command line client](http://www.goxsh.info/) for again, Mt.Gox.

I'm wondering if there are any other language APIs for other exchanges? 

I'd especially like to find a Java API for more than one exchange.

Answer: 
**There is now the [XChange](https://github.com/timmolter/XChange) library**

This is a pure Java library that has been released under the MIT license. It currently supports Mt Gox, but there are simple hooks to allow other exchanges such as [Intersango](http://intersango.com) and [CryptoXChange](http://cryptoxchange.com/) to be supported.

It is currently used by the [MultiBit](http://multibit.org) client.
I don't know of a currently existing Java API for Mt Gox - most folks will probably roll their own until Mt Gox issues their own demonstration client in Java. 

However, in the interests of helping you make some progress in this area here is a short tutorial that may be of some use.

**How to build a Java API for Mt Gox**

You could just throw one together using the [web API specification provided by Mt Gox](https://en.bitcoin.it/wiki/MtGox/API).

Although the examples are written in PHP, the nature of the API is a bunch of simple HTTP requests which typically use JSON to transfer the payload.

For example the getDepth request

```
https://mtgox.com/api/0/data/getDepth.php?Currency=PLN

```

will return a block of JSON that looks something like this:

> 
> {"asks":[[13.32937,46.25473014],
> 
> 
> ....
> 
> 
> "bids": [[11.09752,1],[11.18583,259.5],
> 
> 
> [12.64579,3]]}
> 
> 
> 

which can be mapped to a Java object as follows

```
package org.example.mtgox;

import java.util.List;

public class Depth {
    private List<Asks> asks;
    private List<Bids> bids;

    public List<Asks> getAsks(){
        return this.asks;
    }
    public void setAsks(List<Asks> asks){
        this.asks = asks;
    }
    public List<Bids> getBids(){
        return this.bids;
    }
    public void setBids(List<Bids> bids){
        this.bids = bids;
    }
}

```

Add a sprinkle of JAXB annotations (@XmlRootElement and so on), plug it into the RESTEasy framework and it'll handle all the translation for you. Note that JAXB annotations allow rendering to XML, JSON and YAML - they're just markers. Barely a line of code to be written. 

Incidentally, if you have a JSON input and you want a bare Java POJO generated from it, you can use the [very handy JSONGen web service](http://jsongen.byingtondesign.com/). 

**Shameless plug**

If you want this developed more, then let me know and I'll see what I can do to help.