I am trying to develop my website to display bitcoin and all altcoins prices with volumes from exchanges.
I got all prices from worldcoinindex :
https://www.worldcoinindex.com/apiservice/json?key=
it is working fine from localhost (xampp) but when I try it from server it sends to a cloudflare page.
Please suggest what i am doing wrong / missing?
Thanks
It's probably something in your code as to why you're pulling a cloudflare message or it could be seeing your source IP address as suspect and wanting to do a challenge/response with you. There's a lot of IP address space that's tagged at cloudflare as suspect.
I left out your API key for security reasons, but the code below shows the price of BTC.
$jsondata = file_get_contents($json_string);
$obj = json_decode($jsondata, true);
echo '
';
echo $obj['Markets']['46']['Price_usd'];