$url = 'https://www.live-rates.com/rates'; // path to your JSON file
$data = file_get_contents($url); // put the contents of the file into a variable
$json = json_decode($data); // decode the JSON feed
foreach($json as $obj){
if ($obj->currency == 'EUR/USD'){
echo "Pair: $obj->currency\n";
echo "Bid: $obj->bid\n";
echo "Ask: $obj->ask\n";
echo "Timestamp: $obj->timestamp\n";
}
}
The previous example would get you updated prices for EUR/USD. If you want to get all the instruments, just comment the line
if ($obj->currency == 'EUR/USD'){
If you are looking how to import real-times JSON on your Javascript / Nodejs application, please read our Previous Post - How to Retrieve JSON forex data in Javascript.