Litecoin JSON-RPC API
The Litecoin JSON-RPC API exposes the Litecoin Core node interface: methods for reading blocks, transactions, and UTXOs, inspecting the mempool, building and broadcasting raw transactions, and estimating fees. Requests POST a JSON-RPC 2.0 body to the endpoint; the method is selected by the body.
This is the node interface. It has no address index, so it cannot answer "what is the balance of this address" or "what are the unspent outputs of this address". Those queries belong on the Blockbook REST or Blockbook WebSocket add-on, which is provisioned as its own endpoint.
Base URL
bashhttps://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/Request Format
Every request is a POST carrying a JSON-RPC 2.0 body:
bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "getblockcount",
"params": [],
"id": "getblock.io"
}'Available Methods
Methods that require wallet or node-administration privileges are not available on shared endpoints and are omitted below.
Blockchain information
Methods that report the state of the chain.
| Method | Description |
|---|---|
getblockchaininfo | Returns an object containing various state info regarding blockchain processing |
getbestblockhash | Returns the hash of the best (tip) block in the longest blockchain |
getblockcount | Returns the number of blocks in the longest blockchain |
getdifficulty | Returns the proof-of-work difficulty as a multiple of the minimum difficulty |
getchaintips | Returns information about all known tips in the block tree |
Block retrieval
Methods that fetch block data.
| Method | Description |
|---|---|
getblock | Returns an object with information about the block for a given hash |
getblockhash | Returns the hash of the block at the given height |
getblockstats | Computes per-block statistics for a given window |
getblocktemplate | Returns data needed to construct a block to work on |
Transaction methods
Methods for reading, creating, decoding, and testing transactions.
| Method | Description |
|---|---|
getrawtransaction | Returns the raw transaction data |
decoderawtransaction | Returns a JSON object representing the serialized transaction |
decodescript | Decodes a hex-encoded script |
createrawtransaction | Creates a transaction spending the given inputs |
createmultisig | Creates a multi-signature address from a set of public keys |
testmempoolaccept | Tests whether a raw transaction would be accepted into the mempool |
Mempool methods
Methods for querying the pool of unconfirmed transactions.
| Method | Description |
|---|---|
getmempoolinfo | Returns details on the active state of the transaction memory pool |
getmempoolentry | Returns mempool data for a given transaction |
getmempoolancestors | Returns all in-mempool ancestors of a transaction |
getmempooldescendants | Returns all in-mempool descendants of a transaction |
Mining methods
Methods related to mining operations and statistics.
| Method | Description |
|---|---|
getmininginfo | Returns a JSON object containing mining-related information |
getnetworkhashps | Returns the estimated network hashes per second |
Network methods
Methods for querying network state and peer information.
| Method | Description |
|---|---|
getconnectioncount | Returns the number of connections to other nodes |
getnettotals | Returns information about network traffic |
listbanned | Lists all manually banned IP addresses and subnets |
getmemoryinfo | Returns information about memory usage |
UTXO methods
Methods for querying unspent transaction outputs by outpoint.
| Method | Description |
|---|---|
gettxout | Returns details about an unspent transaction output |
gettxoutsetinfo | Returns statistics about the unspent transaction output set |
gettxoutproof | Returns a hex-encoded proof that txids were included in a block |
Utility methods
General validation and information methods.
| Method | Description |
|---|---|
validateaddress | Returns information about the given Litecoin address |
verifymessage | Verifies a signed message |
estimatesmartfee | Estimates the approximate fee per kilobyte |
help | Lists all commands, or gets help for a specified command |
gettxout cannot list the outputs belonging to an address. For that, use api/v2/utxo on the Blockbook add-on. The Litecoin Core wallet RPCs, including listunspent, are disabled on shared nodes because those nodes carry no user wallets.
Support
- Support: support@getblock.io