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.
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.
Usage:
blockexplorer.getInventoryData(hash, options);
Get inventory data for recent blocks and addresses (up to 1 hour old). Returns an InventoryData
object.
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
- 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
- hash: string
- type: string
- initial_time: number
- initial_ip: string
- nconnected: number
- relayed_count: number
- relayed_percent: number