A web based interface to the Bitcoin API JSON-RPC

Command: getblockchaininfo

The getblockchaininfo RPC provides information about the current state of the block chain.

Parameters: none
Result—A JSON object providing information about the block chain

{
	"result": {
		"chain": "main",
		"blocks": 467641,
		"headers": 467641,
		"bestblockhash": "000000000000000001904098197a2efdb7e9477e698becc2810c845d4d0927f5",
		"difficulty": 559970892890.8381,
		"mediantime": 1495485021,
		"verificationprogress": 0.9999891578373458,
		"chainwork": "00000000000000000000000000000000000000000058bb68e167ed4716ab127a",
		"pruned": false,
		"softforks": [
			{
				"id": "bip34",
				"version": 2,
				"reject": {
					"status": true
				}
			},
			{
				"id": "bip66",
				"version": 3,
				"reject": {
					"status": true
				}
			},
			{
				"id": "bip65",
				"version": 4,
				"reject": {
					"status": true
				}
			}
		],
		"bip9_softforks": {
			"csv": {
				"status": "active",
				"startTime": 1462060800,
				"timeout": 1493596800,
				"since": 419328
			},
			"segwit": {
				"status": "started",
				"bit": 1,
				"startTime": 1479168000,
				"timeout": 1510704000,
				"since": 439488
			}
		}
	},
	"error": null,
	"id": null
}
getblockchaininfo
Returns an object containing various state info regarding blockchain processing.

Result:
{
  "chain": "xxxx",        (string) current network name as defined in BIP70 (main, test, regtest)
  "blocks": xxxxxx,         (numeric) the current number of blocks processed in the server
  "headers": xxxxxx,        (numeric) the current number of headers we have validated
  "bestblockhash": "...", (string) the hash of the currently best block
  "difficulty": xxxxxx,     (numeric) the current difficulty
  "mediantime": xxxxxx,     (numeric) median time for the current best block
  "verificationprogress": xxxx, (numeric) estimate of verification progress [0..1]
  "chainwork": "xxxx"     (string) total amount of work in active chain, in hexadecimal
  "pruned": xx,             (boolean) if the blocks are subject to pruning
  "pruneheight": xxxxxx,    (numeric) lowest-height complete block stored
  "softforks": [            (array) status of softforks in progress
     {
        "id": "xxxx",        (string) name of softfork
        "version": xx,         (numeric) block version
        "reject": {            (object) progress toward rejecting pre-softfork blocks
           "status": xx,       (boolean) true if threshold reached
        },
     }, ...
  ],
  "bip9_softforks": {          (object) status of BIP9 softforks in progress
     "xxxx" : {                (string) name of the softfork
        "status": "xxxx",    (string) one of "defined", "started", "locked_in", "active", "failed"
        "bit": xx,             (numeric) the bit (0-28) in the block version field used to signal this softfork (only for "started" status)
        "startTime": xx,       (numeric) the minimum median time past of a block at which the bit gains its meaning
        "timeout": xx,         (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in
        "since": xx            (numeric) height of the first block to which the status applies
     }
  }
}

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