I'm trying to work with the alphavantage API to fetch the currency exchange data.
This is the query URI I'm using:
https://www.alphavantage.co/query?function=CURRENCY_EXCHANGE_RATE&from_currency=USD&to_currency=JPY&apikey=demo
Below is the data the API returns:
{
"Realtime Currency Exchange Rate": {
"1. From_Currency Code": "USD",
"2. From_Currency Name": "United States Dollar",
"3. To_Currency Code": "JPY",
"4. To_Currency Name": "Japanese Yen",
"5. Exchange Rate": "108.99000000",
"6. Last Refreshed": "2020-01-28 14:35:01",
"7. Time Zone": "UTC",
"8. Bid Price": "108.99000000",
"9. Ask Price": "108.99000000"
}
}
How would I query for this data in PHP?