Created
July 8, 2019 23:42
-
-
Save truth3/31bcccb63b5cad7da451a01dd5e180dc to your computer and use it in GitHub Desktop.
Used to fetch the latest crypto prices from Coin Market cap and avoid the rate limiting issues when requesting from Google
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment