Solution 1 :

Firstly JSON is a standard data format. PHP is a backend programming language. Basically the URL is returning JSON Format. You have to call the endpoint with an apikey. Because if you call now the api by a client call f.e with the jquery’s AJAX request:

$.get("<url>", function(data){

You will get this information:

responseText: "{↵    "Information": "The **demo** API key is for demo purposes only. Please claim your free API key at ( to explore our full API offerings. It takes fewer than 20 seconds, and we are committed to making it free forever."↵}"

After adding you apikey you are able to receive your data.

Please read this:
for asynchronous calls to an endpoint:

how to work with json:

you will get a stringified json, to work with it you have to parse it, to work with it as an object.

Problem :

I’m trying to work with the alphavantage API to fetch the currency exchange data.

This is the query URI I’m using:

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?