Fetching API inside curly braces

Viewed 201

I am trying to fetch data inside curly braces but it is not working. I am a student & I don't have much knowledge regarding on API's.

The Result I am trying to get is 89325 in php

{"ethereum":{"php":89325}}

**What I have tried **

    fetch ("https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=PHP")
    .then((response) => { return response.json();
    })
    .then((data) => {
    var api =data.php;
    console.log(api);
    })
    .catch();

The Error I am getting:

enter image description here

0 Answers
Related