Author

Topic: Need php api and example to display all coins prices on my website (Read 379 times)

legendary
Activity: 1512
Merit: 1057
SpacePirate.io
Hello,
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.


Code:
$json_string = 'https://www.worldcoinindex.com/apiservice/json?key=';
$jsondata = file_get_contents($json_string);
$obj = json_decode($jsondata, true);
echo '
';
echo $obj['Markets']['46']['Price_usd'];
full member
Activity: 159
Merit: 100
Hello,
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=XXXXXXXXXXXXXXXXXXXXXXXXXXX

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

What message is on the CloudFlare page?
If it says 'Server Down', then probably the IP is not correct on CloudFlare.
PM me if you want help.


Edit you api key please.
global moderator
Activity: 3766
Merit: 2610
In a world of peaches, don't ask for apple sauce
I suggest you edit out your API key. Even though the service is free, you probably wouldn't want to have it revoked in case someone decided to troll you and spam the key with requests.
newbie
Activity: 12
Merit: 0
Hello,
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=hXqCVku1C8NK9UtZjMGBFBJip

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
Jump to: