I followed gavinadresen's answer at Bitcoin-Qt command line control on Mac. When I enter the following in terminal, it works:

open Bitcoin-Qt.app --args -server

I've put in the following into my bitcoin.conf file:


I entered the following in terminal:

curl --user yourname --data-binary '{"id":"t0", "method": "getinfo", "params": [] }'

The above prompts me for the password and then it shows the following:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'>
<BODY><H1>401 Unauthorized.</H1></BODY>

The above output doesn't look right. Aren't I supposed to get data from Bitcoin? How do I get the curl command to work?

  • Can you check if rpcssl=1 is set in the bitcoin.conf ? If so, bitcoin is excepting only HTTPS connections.
    – Nontenda
    Jan 23 '14 at 8:32

Three things to check :

  • Is there rpcssl=1 in your bitcoin.conf ? If so, set it to 0 or make HTTPS connections only
  • Have you set rpcallowip= ?
  • Try connect to http: //yourname:yourpassword@ directly

And the fourth thing to check (as I saw your answer) :

  • Check if you have correctly entered your username and password ;)
  • Please see my answer. I tried entering yourname:yourpassword@ into my browser and got {"result":null,"error":{"code":-32700,"message":"Parse error"},"id":null}. How can I get this to work?
    – JLP
    Jan 23 '14 at 14:57
  • Just edited my answer so ;) Indeed rcpallowip and rcpssl are not required but they can help you configure correctly your install
    – Nontenda
    Jan 23 '14 at 15:20

I had screwed up. I entered the wrong yourname in

curl --user yourname --data-binary '{"id":"t0", "method": "getinfo", "params": [] }'

as what I had entered for rpcuser= in my bitcoin.conf file.

When I entered the right yourname, the curl command responded with correct data from my bitcoin wallet.

I had tried entering the following into bitcoin.conf file but they were unnecessary and so I removed them:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.