Yahoo's service doesn't seem to provide an API I can use. What web services are there for currency conversions?
A:
You can do currency conversion using Yahoo's API, e.g. like this in PHP:
<?php
$from = 'USD'; //US Dollar
$to = 'PHP'; //to Philippine Peso
$url = 'http://finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s='. $from . $to .'=X';
$handle = @fopen($url, 'r');
if ($handle) {
$result = fgets($handle, 4096);
fclose($handle);
}
$array = explode(',',$result);
var_dump($array);
/*
OUTPUTS:
array(4) {
[0]=>
string(10) ""USDPHP=X""
[1]=>
string(6) "47.125"
[2]=>
string(11) ""10/3/2008""
[3]=>
string(10) ""5:03pm"
"
}
*/
From here.
Dominic Rodger
2010-05-17 09:19:07
hi, thanks for your help, that is great, but seem it just got current exchange rate, it seem not accept time argument, I also want find history exchange rate, does it support ? thanks again for you help !
Robin
2010-05-17 10:58:53