Hi
I try use Poloniex API to test some script but it always say some error like this. If I access link from browser it will stuck at security check. Is it wrong with my code
echo file_get_contents("https://poloniex.com/public?command=return24hVolume");
PHP Warning: file_get_contents(https://poloniex.com/public?command=return24hVolume): failed to open stream: HTTP request failed! HTTP/1.1 403 ForbiddenThe correct usage is :
$url = "https://poloniex.com/public?command=return24hVolume";
$query = file_get_contents("https://poloniex.com/public?command=return24hVolume");
echo $query;
In your snipper you are asking to echo the function, always segment your code, don't try to use short codes as they are buggy, instead, declare variables and use them to work.
Now in order to use the informations you receive, do this :
$url = "https://poloniex.com/public?command=return24hVolume";
$query = file_get_contents("https://poloniex.com/public?command=return24hVolume");
$info = json_decode($query); //now you can use the informations in php
echo $query;
Just remeber not to be lazy.