I recently implemented the same thing, but using Google's API. The query URL looks like this:
http://www.google.com/ig/calculator?hl=en&q=1GBP=?USD
It takes 3 parameters. The first parameter is the amount, followed by the ISO 4217 currency code you're converting from, an equals sign and a question mark, and the currency code you're converting to. You can find a list of codes that Google supports here. The response to the query will look like this:
{lhs: "1 British pound",rhs: "1.6132 U.S. dollars",error: "",icc: true}
This is pretty self-explanatory, so I won't go into details here. This is how I handled the query response:
function convert_currency($amount, $from_code, $to_code){
ini_set('max_execution_time', 60);
$temp = 'http://www.google.com/ig/calculator?hl=en&q=' . $amount . $from_code . '=?' . $to_code;
$response = file_get_contents($temp);
$result_string = explode('"', $response);
$final_result = $result_string['3'];
$float_result = preg_replace("/[^0-9\.]/", '', $full_result);
return $float_result;
}
I'm sure it's far from the most elegant way to do this, but I'm pretty new to PHP. Hope it helps!