getindexinfo - Bitcoin
Example code for the getindexinfo JSON-RPC method. Complete guide on how to use getindexinfo JSON-RPC in GetBlock Web3 documentation.
This method returns the status of one or more indices currently running on the node.
Parameters
index_name
string
No
Filter for a specific index name (e.g., "txindex", "coinstatsindex", "blockfilterindex").
Request
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "getindexinfo",
"params": [],
"id": "getblock.io"
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"method": "getindexinfo",
"params": [],
"id": "getblock.io"
});
const config = {
method: 'post',
url: 'https://go.getblock.io/<ACCESS-TOKEN>/',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(response => console.log(JSON.stringify(response.data)))
.catch(error => console.log(error));Response
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": {
"txindex": {
"synced": true,
"best_block_height": 820000
},
"blockfilterindex": {
"synced": true,
"best_block_height": 820000
},
"coinstatsindex": {
"synced": true,
"best_block_height": 820000
}
}
}Response Parameters
[index_name]
object
Object containing index status.
synced
boolean
Whether the index is fully synced.
best_block_height
number
The block height up to which the index is synced.
Use Case
The getindexinfo method is essential for:
Checking node index availability
Verifying index sync status
Debugging lookup failures
Monitoring node health
Validating feature availability
Building admin dashboards
Error Handling
403
Forbidden
Missing or invalid ACCESS-TOKEN.
-8
Unknown index name
The specified index name is not valid.
Integration With Web3
The getindexinfo method helps developers:
Verify index availability before queries
Build node monitoring tools
Check sync progress for indices
Ensure transaction lookups will work
Debug index-related errors
Last updated
Was this helpful?