githubEdit

help - Bitcoin

Example code for the help JSON-RPC method. Complete guide on how to use help JSON-RPC in GetBlock Web3 documentation.

This method lists all available commands or provides help for a specified command.

Parameters

Parameter
Type
Required
Description

command

string

No

The command to get help for. If omitted, lists all commands.

Request

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "help",
   "params": ["getblock"],
    "id": "getblock.io"
}'

Response

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": "getblock \"blockhash\" ( verbosity )\n\nIf verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.\nIf verbosity is 1, returns an Object with information about block <hash>.\nIf verbosity is 2, returns an Object with information about block <hash> and information about each transaction.\n\nArguments:\n1. blockhash    (string, required) The block hash\n2. verbosity    (numeric, optional, default=1) 0 for hex-encoded data, 1 for a JSON object, 2 for JSON object with transaction data\n\nResult (for verbosity = 0):\n\"hex\"    (string) A string that is serialized, hex-encoded data for block 'hash'\n\n..."
}

Response Parameters

Field
Type
Description

result

string

Help text for the specified command or list of all commands.

Use Case

The help method is essential for:

  • Discovering available RPC commands

  • Learning command parameters and usage

  • Building dynamic documentation

  • Debugging API integration

  • Exploring node capabilities

  • Creating command reference tools

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS-TOKEN.

Integration With Web3

The help method helps developers:

  • Explore available RPC methods

  • Understand parameter requirements

  • Build self-documenting tools

  • Create API exploration interfaces

  • Support developer onboarding

Last updated

Was this helpful?