paulmagm Posted November 5, 2021 Share Posted November 5, 2021 Hey, i started to take a look on APIs. Im really at the beginning and i tried to copy this snippet on my website.https://codesandbox.io/s/43n6y0r4j7?file=/public/index.html Can someone assist me what JS snippet i have to put on my page to have the same output? I already included the index.js Thank you. Quote Link to comment Share on other sites More sharing options...
paulmagm Posted November 5, 2021 Author Share Posted November 5, 2021 (edited) Or is this better to try it like this? https://stackoverflow.com/questions/48124551/how-to-display-24h-volume-coinmarketcap-api Edited November 5, 2021 by paulmagm Quote Link to comment Share on other sites More sharing options...
paulmagm Posted November 5, 2021 Author Share Posted November 5, 2021 (edited) <?php ini_set('max_execution_time', 300); // $tick = file_get_contents('https://api.coinmarketcap.com/v1/ticker/bitcoin/'); $url ='https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?limit=2000';// path to your JSON file $data = file_get_contents($url); // put the contents of the file into a variable $characters = json_decode($data); // decode the JSON feed $api_key = 'API KEY'; // echo $characters[0]->name; foreach ($characters as $character) { echo '<tr>'; echo '<td>' . $character->{'24h_volume_usd'} . '</td>'; echo '</tr></tbody>sdsdf</table>'; } ?> But my Page is empty.. Edited November 5, 2021 by paulmagm Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.