Author

Topic: Has the API stopped responding for anyone else? [PHP question] (Read 1054 times)

full member
Activity: 212
Merit: 100
Solved, MagicalTux must have changed something, because now USERAGENT is required.

curl_setopt($ch, CURLOPT_USERAGENT, "curl/7.21.3 (x86_64-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18");

did the trick

I usually don't even consider "tips" but damn lightbox, you just solved a HUGE headache for me!

Donation address please!

Lol glad i could help, i only pounded my head on the desk for about an hour to figure it out :p  now if only mtgox would get back up so I can finish the tweaks on the bot!

Thanks for the offer of a tip! here's an address: 1NgFb2LyyLvGaSHWasi2sYsn7iXDzDqzvb
member
Activity: 111
Merit: 10
Solved, MagicalTux must have changed something, because now USERAGENT is required.

curl_setopt($ch, CURLOPT_USERAGENT, "curl/7.21.3 (x86_64-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18");

did the trick

I usually don't even consider "tips" but damn lightbox, you just solved a HUGE headache for me!

Donation address please!
newbie
Activity: 7
Merit: 0
Quote
It would be nice for MagicalTux to create a developer mailing list or forum thread to keep us aware of this kind of thing...

That or a page describing the API would be awesome.
hero member
Activity: 548
Merit: 502
So much code.
Thanks so much for posting this! My services had bombed out today due to this change.

It would be nice for MagicalTux to create a developer mailing list or forum thread to keep us aware of this kind of thing...
newbie
Activity: 30
Merit: 0
Solved, MagicalTux must have changed something, because now USERAGENT is required.

curl_setopt($ch, CURLOPT_USERAGENT, "curl/7.21.3 (x86_64-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18");

did the trick





Yeah. For the C programmers out there:

curl_easy_setopt(curl, CURLOPT_USERAGENT, "Some bot.");

will do the trick.

Philipp

newbie
Activity: 30
Merit: 0
Same problem here. libcurl doesn't work, but plain curl does. Will try setting the useragent.

Philipp
newbie
Activity: 42
Merit: 0
Seeing how you have some experience with the mt. gox api, could you please have a look at my issue?
http://forum.bitcoin.org/index.php?topic=18934.0

Thanks!
full member
Activity: 212
Merit: 100
Solved, MagicalTux must have changed something, because now USERAGENT is required.

curl_setopt($ch, CURLOPT_USERAGENT, "curl/7.21.3 (x86_64-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18");

did the trick



full member
Activity: 212
Merit: 100
Not working again for me Sad for about the past hour or so...

but wget works fine, so something with php/curl is causing the problem

use im using SSL_VERIFYPEER  FALSE  and SSL_VERIFYHOST  FALSE

newbie
Activity: 7
Merit: 0
Nevermind, seems to be working again.
newbie
Activity: 7
Merit: 0
I used to be able to query the mtgox ticker with the following code:

Code:

  $c = curl_init();
  curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($c, CURLOPT_URL, 'https://mtgox.com/code/data/ticker.php');
  curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
  $result = curl_exec($c);
  curl_close($c);

2~3 hours ago that stopped working.  I tried saving the certificate so I could query as follows:

Code:
  $c = curl_init();
  curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($c, CURLOPT_URL, 'https://mtgox.com/code/data/ticker.php');
  curl_setopt($c, CURLOPT_SSL_VERIFYPEER, true);
  curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 2);
  curl_setopt($c, CURLOPT_CAINFO, "./CAcerts/www.mtgox.com");
  $result = curl_exec($c);
  curl_close($c);

That didn't work either.  Did the API change somehow or is my code simply off?
Jump to: