API Documentation

The Beerscoin Explorer provides access to the Beerscoin blockchain through a set of RPC commands.

New REST API Available!

We now provide a modern REST API for accessing blockchain data. This API is designed for public use and follows REST principles.

Our new REST API provides standardized access to blockchain data including statistics, blocks, transactions, and address information.

REST API Endpoints

Modern REST API for accessing blockchain data

The main REST API endpoint is /api/blockchain/data which provides access to various blockchain data.

Query Parameters

  • type - Type of data to fetch (blocks, transactions, address, stats)
  • limit - Number of items to return (max: 100)
  • offset - Offset for pagination
  • address - Address to fetch data for (required for type=address)
  • height - Block height (for type=blocks with specific height)
  • hash - Transaction or block hash (for type=transactions or type=blocks)

Examples

  • /api/blockchain/data?type=stats - Get blockchain statistics
  • /api/blockchain/data?type=blocks&limit=10 - Get the latest 10 blocks
  • /api/blockchain/data?type=transactions&hash=txid - Get a specific transaction
  • /api/blockchain/data?type=address&address=BNDJwbYrgxdi2ZQTbLzagsi8CBAq9QzZTP - Get address information

Blockchain Commands

Commands for interacting with the blockchain

  • getbestblockhash - Returns the hash of the best (tip) block in the longest blockchain
  • getblock "blockhash" ( verbosity ) - Returns information about a block
  • getblockchaininfo - Returns an object containing various state info regarding blockchain processing
  • getblockcount - Returns the number of blocks in the longest blockchain
  • getblockhash height - Returns hash of block in best-block-chain at height provided
  • getblockheader "hash" ( verbose ) - Returns information about a block header
  • getblockstats hash ( stats ) - Compute per block statistics for a given window
  • getchaintips - Return information about all known tips in the block tree
  • getcoincount - Returns the total number of coins in the blockchain
  • getdifficulty - Returns the proof-of-work difficulty as a multiple of the minimum difficulty
  • getmempoolancestors txid (verbose) - Returns all in-mempool ancestors for a transaction
  • getmempooldescendants txid (verbose) - Returns all in-mempool descendants for a transaction
  • getmempoolentry txid - Returns mempool data for given transaction
  • getmempoolinfo - Returns details on the active state of the TX memory pool
  • getrawmempool ( verbose ) - Returns all transaction ids in memory pool
  • gettxout "txid" n ( include_mempool ) - Returns details about an unspent transaction output
  • gettxoutproof ["txid",...] ( blockhash ) - Returns a hex-encoded proof that "txid" was included in a block
  • gettxoutsetinfo - Returns statistics about the unspent transaction output set
  • preciousblock "blockhash" - Treats a block as if it were received before others with the same work
  • pruneblockchain - Prunes the blockchain up to a specified height or timestamp
  • verifychain ( checklevel nblocks ) - Verifies blockchain database
  • verifytxoutproof "proof" - Verifies that a proof points to a transaction in a block

Mining Commands

Commands for mining operations

  • createauxblock <address> - Create a new auxiliary block for mining
  • getauxblock (hash auxpow) - Get auxiliary block information
  • getblocktemplate ( TemplateRequest ) - Returns data needed to construct a block to work on
  • getmininginfo - Returns a json object containing mining-related information
  • getnetworkhashps ( nblocks height ) - Returns the estimated network hashes per second
  • prioritisetransaction <txid> <priority delta> <fee delta> - Accepts the transaction into mined blocks at a higher (or lower) priority
  • submitauxblock <hash> <auxpow> - Submit auxiliary proof-of-work solution to the network
  • submitblock "hexdata" ( "jsonparametersobject" ) - Attempts to submit new block to network

Network Commands

Commands for network operations

  • addnode "node" "add|remove|onetry" - Attempts to add or remove a node from the addnode list
  • clearbanned - Clear all banned IPs
  • disconnectnode "address" - Immediately disconnects from the specified node
  • getaddednodeinfo ( "node" ) - Returns information about the given added node
  • getconnectioncount - Returns the number of connections to other nodes
  • getnettotals - Returns information about network traffic
  • getnetworkinfo - Returns an object containing various state info regarding P2P networking
  • getpeerinfo - Returns data about each connected network node
  • listbanned - List all banned IPs/Subnets
  • ping - Requests that a ping be sent to all other nodes
  • setban "subnet" "add|remove" (bantime) (absolute) - Attempts to add or remove an IP/Subnet from the banned list
  • setmaxconnections - Set the maximum number of connections
  • setnetworkactive true|false - Disable/enable all p2p network activity