<p>Apparently, a full API reference just got published on the Bitcoin website: </p>

<p><a href="https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs" rel="nofollow">https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs</a></p>

CC BY-SA 3.0
2014-05-24T21:21:42.613Z
2014-05-24T21:21:42.613Z
Steven Roose
<p>Here is a complete API reference that has a pending pull request for bitcoin.org</p>

<blockquote>
  <p><a href="http://bitcoindev.us.to/en/developer-reference#bitcoin-core-apis" rel="nofollow">http://bitcoindev.us.to/en/developer-reference#bitcoin-core-apis</a></p>
</blockquote>

<p><em>More information:
<a href="https://bitcointalk.org/index.php?topic=511876.0" rel="nofollow">https://bitcointalk.org/index.php?topic=511876.0</a></em></p>

CC BY-SA 3.0
2014-05-14T17:52:29.807Z
2014-05-14T17:52:29.807Z
CoinHeavy
<p>I've used macros and pulled the <strong>full</strong> <a href="http://pastebin.com/B7R7MFjQ" rel="nofollow">RPC documentation</a> from Bitcoin Core 0.9.2.1 (rough formatting, help appreciated!)</p>

<p>Full code won't fit here (80000 chars>30000 limit), but here's the help commands I entered and copied the returned data from:</p>

<pre><code>help addmultisigaddress
help addnode 
help backupwallet 
help createmultisig 
help createrawtransaction 
help decoderawtransaction 
help decodescript 
help dumpprivkey 
help dumpwallet 
help getaccount 
help getaccountaddress 
help getaddednodeinfo 
help getaddressesbyaccount 
help getbalance 
help getbestblockhash
help getblock 
help getblockchaininfo
help getblockcount
help getblockhash 
help getblocktemplate 
help getconnectioncount
help getdifficulty
help getgenerate
help gethashespersec
help getinfo
help getmininginfo
help getnettotals
help getnetworkhashps 
help getnetworkinfo
help getnewaddress 
help getpeerinfo
help getrawchangeaddress
help getrawmempool 
help getrawtransaction 
help getreceivedbyaccount 
help getreceivedbyaddress 
help gettransaction 
help gettxout 
help gettxoutsetinfo
help getunconfirmedbalance
help getwalletinfo
help getwork 
help help 
help importprivkey 
help importwallet 
help keypoolrefill 
help listaccounts 
help listaddressgroupings
help listlockunspent
help listreceivedbyaccount 
help listreceivedbyaddress 
help listsinceblock 
help listtransactions 
help listunspent 
help lockunspent 
help move 
help ping
help sendfrom 
help sendmany 
help sendrawtransaction 
help sendtoaddress 
help setaccount 
help setgenerate 
help settxfee 
help signmessage 
help signrawtransaction 
help stop
help submitblock 
help validateaddress 
help verifychain 
help verifymessage 
help walletlock
help walletpassphrase 
help walletpassphrasechange
</code></pre>

<p>And a few egs:</p>

<pre><code>addmultisigaddress nrequired ["key",...] ( "account" )

Add a nrequired-to-sign multisignature address to the wallet.
Each key is a Bitcoin address or hex-encoded public key.
If 'account' is specified, assign address to that account.

Arguments:
1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.
2. "keysobject" (string, required) A json array of bitcoin addresses or hex-encoded public keys
[
"address" (string) bitcoin address or hex-encoded public key
...,
]
3. "account" (string, optional) An account to assign the addresses to.

Result:
"bitcoinaddress" (string) A bitcoin address associated with the keys.

Examples:

Add a multisig address from 2 addresses
&gt; bitcoin-cli addmultisigaddress 2 "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]"

As json rpc call
&gt; curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addmultisigaddress", "params": [2, "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/



addnode "node" "add|remove|onetry"

Attempts add or remove a node from the addnode list.
Or try a connection to a node once.

Arguments:
1. "node" (string, required) The node (see getpeerinfo for nodes)
2. "command" (string, required) 'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once

Examples:
&gt; bitcoin-cli addnode "192.168.0.6:8333" "onetry"
&gt; curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addnode", "params": ["192.168.0.6:8333", "onetry"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/


backupwallet "destination"

Safely copies wallet.dat to destination, which can be a directory or a path with filename.

Arguments:
1. "destination" (string) The destination directory or file

Examples:
&gt; bitcoin-cli backupwallet "backup.dat"
&gt; curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "backupwallet", "params": ["backup.dat"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
</code></pre>

<p><em>PS. C++/QT formatting at <a href="http://pastebin.com/B7R7MFjQ" rel="nofollow">Pastebin file</a> so formatting may need changing and there's still time stamps I didn't edit out.</em></p>

CC BY-SA 3.0
2014-09-28T11:10:40.373Z
2014-09-28T11:10:40.373Z
Wizard Of Ozzie
<p>One of the recent additions to the API is:</p>

<pre><code>bitcoind getnetworkhashps
</code></pre>

<p>This is not documented in the wiki to which your question links.</p>

<p>While the source code is indeed the ultimate reference, in practice, <code>bitcoind help</code> is the shortest path to most answers.</p>

<p>Here is the entry for lockunspent:</p>

<pre><code>root@blockchainer-test:~# bitcoind help lockunspent
lockunspent unlock [{"txid":"txid","vout":n},...]

Updates list of temporarily unspendable outputs.
Temporarily lock (lock=true) or unlock (lock=false) specified transaction outputs.
A locked transaction output will not be chosen by automatic coin selection, when spending bitcoins.
Locks are stored in memory only. Nodes start with zero locked outputs, and the locked output list
is always cleared (by virtue of process exit) when a node stops or fails.
Also see the listunspent call

Arguments:
1. unlock            (boolean, required) Whether to unlock (true) or lock (false) the specified transactions
2. "transactions"  (string, required) A json array of objects. Each object the txid (string) vout (numeric)
     [           (json array of json objects)
       {
         "txid":"id",    (string) The transaction id
         "vout": n         (numeric) The output number
       }
       ,...
     ]

Result:
true|false    (boolean) Whether the command was successful or not

Examples:

List the unspent transactions
&gt; bitcoin-cli listunspent

Lock an unspent transaction
&gt; bitcoin-cli lockunspent false "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"

List the locked transactions
&gt; bitcoin-cli listlockunspent

Unlock the transaction again
&gt; bitcoin-cli lockunspent true "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"

As a json rpc call
&gt; curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "lockunspent", "params": [false, "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
</code></pre>

<p>Below is a list of all methods you can call on bitcoind, for reference:</p>

<pre><code>root@blockchainer-test:~# bitcoind help
addmultisigaddress nrequired ["key",...] ( "account" )
addnode "node" "add|remove|onetry"
backupwallet "destination"
createmultisig nrequired ["key",...]
createrawtransaction [{"txid":"id","vout":n},...] {"address":amount,...}
decoderawtransaction "hexstring"
decodescript "hex"
dumpprivkey "bitcoinaddress"
dumpwallet "filename"
encryptwallet "passphrase"
getaccount "bitcoinaddress"
getaccountaddress "account"
getaddednodeinfo dns ( "node" )
getaddressesbyaccount "account"
getbalance ( "account" minconf )
getbestblockhash
getblock "hash" ( verbose )
getblockchaininfo
getblockcount
getblockhash index
getblocktemplate ( "jsonrequestobject" )
getconnectioncount
getdifficulty
getgenerate
gethashespersec
getinfo
getmininginfo
getnettotals
getnetworkhashps ( blocks height )
getnetworkinfo
getnewaddress ( "account" )
getpeerinfo
getrawchangeaddress
getrawmempool ( verbose )
getrawtransaction "txid" ( verbose )
getreceivedbyaccount "account" ( minconf )
getreceivedbyaddress "bitcoinaddress" ( minconf )
gettransaction "txid"
gettxout "txid" n ( includemempool )
gettxoutsetinfo
getunconfirmedbalance
getwalletinfo
getwork ( "data" )
help ( "command" )
importprivkey "bitcoinprivkey" ( "label" rescan )
importwallet "filename"
keypoolrefill ( newsize )
listaccounts ( minconf )
listaddressgroupings
listlockunspent
listreceivedbyaccount ( minconf includeempty )
listreceivedbyaddress ( minconf includeempty )
listsinceblock ( "blockhash" target-confirmations )
listtransactions ( "account" count from )
listunspent ( minconf maxconf  ["address",...] )
lockunspent unlock [{"txid":"txid","vout":n},...]
move "fromaccount" "toaccount" amount ( minconf "comment" )
ping
sendfrom "fromaccount" "tobitcoinaddress" amount ( minconf "comment" "comment-to" )
sendmany "fromaccount" {"address":amount,...} ( minconf "comment" )
sendrawtransaction "hexstring" ( allowhighfees )
sendtoaddress "bitcoinaddress" amount ( "comment" "comment-to" )
setaccount "bitcoinaddress" "account"
setgenerate generate ( genproclimit )
settxfee amount
signmessage "bitcoinaddress" "message"
signrawtransaction "hexstring" ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] ["privatekey1",...] sighashtype )
stop
submitblock "hexdata" ( "jsonparametersobject" )
validateaddress "bitcoinaddress"
verifychain ( checklevel numblocks )
verifymessage "bitcoinaddress" "signature" "message"
</code></pre>

CC BY-SA 3.0
2014-05-10T14:13:33.247Z
I was more looking to an official reference that is maintained by the devs and that also contains formatting information of parameters and return values.
Steven Roose
CC BY-SA 3.0
2014-05-10T14:14:57.437Z
Also, most people use bitcoind through RPC and some may not have an instance available to use the help command on. There should be an online reference somewhere IMO.
Steven Roose
CC BY-SA 3.0
2014-05-09T03:20:01.683Z
2014-05-09T03:20:01.683Z
CoinHeavy
<p>I know that all Bitcoin API methods are listed on the wiki: <a href="https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list" rel="noreferrer">https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list</a>. However, some of the methods are very poorly documented. </p>

<p>F.e. the <code>lockunspent</code> method is only documented as taking the parameters <code>&lt;unlock?&gt; [array-of-objects]</code>. No clue about what type of objects. And there are more examples like this.</p>

<p>Is there a <em>good</em> API <strong>reference</strong> that specifies what parameters are expected and what result they give back?</p>

<p>This would so much lower the bar for new developers!</p>

CC BY-SA 3.0
2013-05-02T21:15:01.020Z
I hate to say this, but the source code is probably the ultimate reference.
Tom van der Woerdt
CC BY-SA 3.0
2013-10-22T17:52:08.810Z
Unfortunately more developers lend their time towards making new exchanges or arbitrage bots than actually making Bitcoin more useful. Those who put together Bitcoin.it did a wonderful job but there needs to be an updated spec sheet with examples as you outline in your question.
bvpx
CC BY-SA 3.0
2014-03-17T16:12:06.833Z
The 'help' RPC was improved a lot in 0.9.0 (you can currently download rc3). Parameter names, types and examples are now included.
laanwj
CC BY-SA 3.0
2014-09-28T11:34:07.563Z
@wumpus see my answer; rpc reference definitely improved
Wizard Of Ozzie
<bitcoind><api>
Does a full Bitcoin API reference exist with examples?
Steven Roose
# Does a full Bitcoin API reference exist with examples?

(Asked by: username_0 on 2013-05-02)

I know that all Bitcoin API methods are listed on the wiki: <https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list>. However, some of the methods are very poorly documented.

F.e. the `lockunspent` method is only documented as taking the parameters `<unlock?> [array-of-objects]`. No clue about what type of objects. And there are more examples like this.

Is there a *good* API **reference** that specifies what parameters are expected and what result they give back?

This would so much lower the bar for new developers!

**Tags:** bitcoind, api

> **Comments:**
> **username_1**: I hate to say this, but the source code is probably the ultimate reference.  
> **username_2**: Unfortunately more developers lend their time towards making new exchanges or arbitrage bots than actually making Bitcoin more useful. Those who put together Bitcoin.it did a wonderful job but there needs to be an updated spec sheet with examples as you outline in your question.  
> **username_3**: The 'help' RPC was improved a lot in 0.9.0 (you can currently download rc3). Parameter names, types and examples are now included.  
> **username_4**: @wumpus see my answer; rpc reference definitely improved  

---

## 4 answers

### Answer by username_0 on 2014-05-24. Score: 2 | Accepted answer

Apparently, a full API reference just got published on the Bitcoin website:

<https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs>


---

### Answer by username_5 on 2014-05-14. Score: 3

Here is a complete API reference that has a pending pull request for bitcoin.org

> <http://bitcoindev.us.to/en/developer-reference#bitcoin-core-apis>

*More information:
<https://bitcointalk.org/index.php?topic=511876.0>*


---

### Answer by username_4 on 2014-09-28. Score: 1

I've used macros and pulled the **full** [RPC documentation](http://pastebin.com/B7R7MFjQ) from Bitcoin Core 0.9.2.1 (rough formatting, help appreciated!)

Full code won't fit here (80000 chars>30000 limit), but here's the help commands I entered and copied the returned data from:

```
help addmultisigaddress
help addnode 
help backupwallet 
help createmultisig 
help createrawtransaction 
help decoderawtransaction 
help decodescript 
help dumpprivkey 
help dumpwallet 
help getaccount 
help getaccountaddress 
help getaddednodeinfo 
help getaddressesbyaccount 
help getbalance 
help getbestblockhash
help getblock 
help getblockchaininfo
help getblockcount
help getblockhash 
help getblocktemplate 
help getconnectioncount
help getdifficulty
help getgenerate
help gethashespersec
help getinfo
help getmininginfo
help getnettotals
help getnetworkhashps 
help getnetworkinfo
help getnewaddress 
help getpeerinfo
help getrawchangeaddress
help getrawmempool 
help getrawtransaction 
help getreceivedbyaccount 
help getreceivedbyaddress 
help gettransaction 
help gettxout 
help gettxoutsetinfo
help getunconfirmedbalance
help getwalletinfo
help getwork 
help help 
help importprivkey 
help importwallet 
help keypoolrefill 
help listaccounts 
help listaddressgroupings
help listlockunspent
help listreceivedbyaccount 
help listreceivedbyaddress 
help listsinceblock 
help listtransactions 
help listunspent 
help lockunspent 
help move 
help ping
help sendfrom 
help sendmany 
help sendrawtransaction 
help sendtoaddress 
help setaccount 
help setgenerate 
help settxfee 
help signmessage 
help signrawtransaction 
help stop
help submitblock 
help validateaddress 
help verifychain 
help verifymessage 
help walletlock
help walletpassphrase 
help walletpassphrasechange

```

And a few egs:

```
addmultisigaddress nrequired ["key",...] ( "account" )

Add a nrequired-to-sign multisignature address to the wallet.
Each key is a Bitcoin address or hex-encoded public key.
If 'account' is specified, assign address to that account.

Arguments:
1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.
2. "keysobject" (string, required) A json array of bitcoin addresses or hex-encoded public keys
[
"address" (string) bitcoin address or hex-encoded public key
...,
]
3. "account" (string, optional) An account to assign the addresses to.

Result:
"bitcoinaddress" (string) A bitcoin address associated with the keys.

Examples:

Add a multisig address from 2 addresses
> bitcoin-cli addmultisigaddress 2 "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]"

As json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addmultisigaddress", "params": [2, "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

addnode "node" "add|remove|onetry"

Attempts add or remove a node from the addnode list.
Or try a connection to a node once.

Arguments:
1. "node" (string, required) The node (see getpeerinfo for nodes)
2. "command" (string, required) 'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once

Examples:
> bitcoin-cli addnode "192.168.0.6:8333" "onetry"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addnode", "params": ["192.168.0.6:8333", "onetry"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

backupwallet "destination"

Safely copies wallet.dat to destination, which can be a directory or a path with filename.

Arguments:
1. "destination" (string) The destination directory or file

Examples:
> bitcoin-cli backupwallet "backup.dat"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "backupwallet", "params": ["backup.dat"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

```

*PS. C++/QT formatting at [Pastebin file](http://pastebin.com/B7R7MFjQ) so formatting may need changing and there's still time stamps I didn't edit out.*


---

### Answer by username_5 on 2014-05-09. Score: -1

One of the recent additions to the API is:

```
bitcoind getnetworkhashps

```

This is not documented in the wiki to which your question links.

While the source code is indeed the ultimate reference, in practice, `bitcoind help` is the shortest path to most answers.

Here is the entry for lockunspent:

```
root@blockchainer-test:~# bitcoind help lockunspent
lockunspent unlock [{"txid":"txid","vout":n},...]

Updates list of temporarily unspendable outputs.
Temporarily lock (lock=true) or unlock (lock=false) specified transaction outputs.
A locked transaction output will not be chosen by automatic coin selection, when spending bitcoins.
Locks are stored in memory only. Nodes start with zero locked outputs, and the locked output list
is always cleared (by virtue of process exit) when a node stops or fails.
Also see the listunspent call

Arguments:
1. unlock            (boolean, required) Whether to unlock (true) or lock (false) the specified transactions
2. "transactions"  (string, required) A json array of objects. Each object the txid (string) vout (numeric)
     [           (json array of json objects)
       {
         "txid":"id",    (string) The transaction id
         "vout": n         (numeric) The output number
       }
       ,...
     ]

Result:
true|false    (boolean) Whether the command was successful or not

Examples:

List the unspent transactions
> bitcoin-cli listunspent

Lock an unspent transaction
> bitcoin-cli lockunspent false "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"

List the locked transactions
> bitcoin-cli listlockunspent

Unlock the transaction again
> bitcoin-cli lockunspent true "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"

As a json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "lockunspent", "params": [false, "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

```

Below is a list of all methods you can call on bitcoind, for reference:

```
root@blockchainer-test:~# bitcoind help
addmultisigaddress nrequired ["key",...] ( "account" )
addnode "node" "add|remove|onetry"
backupwallet "destination"
createmultisig nrequired ["key",...]
createrawtransaction [{"txid":"id","vout":n},...] {"address":amount,...}
decoderawtransaction "hexstring"
decodescript "hex"
dumpprivkey "bitcoinaddress"
dumpwallet "filename"
encryptwallet "passphrase"
getaccount "bitcoinaddress"
getaccountaddress "account"
getaddednodeinfo dns ( "node" )
getaddressesbyaccount "account"
getbalance ( "account" minconf )
getbestblockhash
getblock "hash" ( verbose )
getblockchaininfo
getblockcount
getblockhash index
getblocktemplate ( "jsonrequestobject" )
getconnectioncount
getdifficulty
getgenerate
gethashespersec
getinfo
getmininginfo
getnettotals
getnetworkhashps ( blocks height )
getnetworkinfo
getnewaddress ( "account" )
getpeerinfo
getrawchangeaddress
getrawmempool ( verbose )
getrawtransaction "txid" ( verbose )
getreceivedbyaccount "account" ( minconf )
getreceivedbyaddress "bitcoinaddress" ( minconf )
gettransaction "txid"
gettxout "txid" n ( includemempool )
gettxoutsetinfo
getunconfirmedbalance
getwalletinfo
getwork ( "data" )
help ( "command" )
importprivkey "bitcoinprivkey" ( "label" rescan )
importwallet "filename"
keypoolrefill ( newsize )
listaccounts ( minconf )
listaddressgroupings
listlockunspent
listreceivedbyaccount ( minconf includeempty )
listreceivedbyaddress ( minconf includeempty )
listsinceblock ( "blockhash" target-confirmations )
listtransactions ( "account" count from )
listunspent ( minconf maxconf  ["address",...] )
lockunspent unlock [{"txid":"txid","vout":n},...]
move "fromaccount" "toaccount" amount ( minconf "comment" )
ping
sendfrom "fromaccount" "tobitcoinaddress" amount ( minconf "comment" "comment-to" )
sendmany "fromaccount" {"address":amount,...} ( minconf "comment" )
sendrawtransaction "hexstring" ( allowhighfees )
sendtoaddress "bitcoinaddress" amount ( "comment" "comment-to" )
setaccount "bitcoinaddress" "account"
setgenerate generate ( genproclimit )
settxfee amount
signmessage "bitcoinaddress" "message"
signrawtransaction "hexstring" ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] ["privatekey1",...] sighashtype )
stop
submitblock "hexdata" ( "jsonparametersobject" )
validateaddress "bitcoinaddress"
verifychain ( checklevel numblocks )
verifymessage "bitcoinaddress" "signature" "message"

```

> **Comments:**
> **username_0**: I was more looking to an official reference that is maintained by the devs and that also contains formatting information of parameters and return values.  
> **username_0**: Also, most people use bitcoind through RPC and some may not have an instance available to use the help command on. There should be an online reference somewhere IMO.  

---

