Bitcoin Forum
May 08, 2024, 07:56:02 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Need php api and example to display all coins prices on my website  (Read 369 times)
techansaari (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
July 11, 2017, 10:50:42 AM
 #1

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
1715154962
Hero Member
*
Offline Offline

Posts: 1715154962

View Profile Personal Message (Offline)

Ignore
1715154962
Reply with quote  #2

1715154962
Report to moderator
Activity + Trust + Earned Merit == The Most Recognized Users on Bitcointalk
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715154962
Hero Member
*
Offline Offline

Posts: 1715154962

View Profile Personal Message (Offline)

Ignore
1715154962
Reply with quote  #2

1715154962
Report to moderator
mprep
Global Moderator
Legendary
*
Offline Offline

Activity: 3766
Merit: 2610


In a world of peaches, don't ask for apple sauce


View Profile WWW
July 11, 2017, 05:42:58 PM
 #2

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.

BilalHIMITE
Full Member
***
Offline Offline

Activity: 159
Merit: 100


View Profile
July 11, 2017, 05:52:27 PM
Last edit: July 12, 2017, 12:44:56 PM by BilalHIMITE
 #3

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.
cloverme
Legendary
*
Offline Offline

Activity: 1512
Merit: 1057


SpacePirate.io


View Profile WWW
July 11, 2017, 08:38:21 PM
 #4

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 '<pre>';
echo $obj['Markets']['46']['Price_usd'];
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!