Get the latest data regarding the block chain. View full API documentation.
var blockexplorer = require('blockchain.info/blockexplorer')
All method options can include an apiCode
property to prevent hitting request limits.
Usage:
blockexplorer.getBlock(blockId, options)
Get a single block based on a block index or hash. Returns a Block
object.
Usage:
blockexplorer.getTx(txId, options)
Get a single transaction based on a transaction index or hash. Returns a Transaction
object.
Usage:
blockexplorer.getBlockHeight(height, options)
Get an array of blocks at the specified height. Returns an array of Block
objects.
Usage:
blockexplorer.getAddress(address, options)
Get a single address and its transactions. Returns an Address
object.
Options (optional):
limit
- the number of transactions to limit the response to (number)offset
- skip the first n transactions (number)
Usage:
blockexplorer.getMultiAddress(addresses, options)
Get information on multiple addresses.
Options (optional):
limit
- the number of transactions to limit the response to (number)offset
- skip the first n transactions (number)
Usage:
blockexplorer.getUnspentOutputs(address, options)
Get an array of unspent outputs for an address. Returns an array of UnspentOutput
objects.
Options (optional):
confirmations
- the minimum number of confirmations of the outputs to be included (number)limit
- the number of outputs to limit the response to (number)
Usage:
blockexplorer.getBalance(address, options)
Get an array of individual address balance for given addresses. Returns an array of Balance
objects.
Usage:
blockexplorer.getLatestBlock(options)
Get the latest block on the main chain. Returns a LatestBlock
object.
Usage:
blockexplorer.getUncomfirmedTx(options)
Get a list of currently unconfirmed transactions. Returns an array of Transaction
objects.
Usage:
blockexplorer.getBlocks(time, options)
Get a list of blocks for a specific day. Returns an array of SimpleBlock
objects.
A description of each of the objects that may be passed into the callback's data
parameter when one of the above functions is called.
- hash: string
- version: number
- previous_block: string
- merkle_root: string
- time: number
- bits: number
- fee: number
- nonce: number
- t_tx: number
- size: number
- block_index: number
- main_chain: boolean
- height: number
- received_time: number
- relayed_by: string
- transactions: array of
Transaction
objects
- double_spend: boolean
- block_height: number
- time: number
- relayed_by: string
- hash: string
- tx_index: number
- version: number
- size: number
- inputs: array of
Input
objects - outputs: array of
Output
objects
- n: number
- value: number
- address: string
- tx_index: number
- type: number
- script: string
- script_sig: string
- sequence: number
- n: number
- value: number
- address: string
- tx_index: number
- script: string
- spent: number
- hash160: string
- address: string
- n_tx: number
- total_received: number
- total_sent: number
- final_balance: number
- transactions: array of
Transaction
objects
- tx_hash: string
- tx_index: number
- tx_output_n: number
- script: string
- value: number
- value_hex: string
- confirmations: number
- final_balance: number
- n_tx: number
- total_received: number
- hash: string
- time: number
- block_index: number
- height: number
- tx_indexes: array of tx indices (number)
- height: number
- hash: string
- time: number
- main_chain: boolean