Skip to content

Instantly share code, notes, and snippets.

@truth3
Created July 8, 2019 23:42
Show Gist options
  • Save truth3/31bcccb63b5cad7da451a01dd5e180dc to your computer and use it in GitHub Desktop.
Save truth3/31bcccb63b5cad7da451a01dd5e180dc to your computer and use it in GitHub Desktop.

Revisions

  1. truth3 created this gist Jul 8, 2019.
    16 changes: 16 additions & 0 deletions crypto-prices.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    <?php

    $cryptoID = $_GET["crypto_id"];
    $requestUrl ='https://api.coinmarketcap.com/v1/ticker/' . $cryptoID . '/';

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $requestUrl);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    $response = curl_exec($ch);
    echo($response);
    curl_close($ch);

    ?>