Skip to main content

getblockfilter

Overview

The 'getblockfilter' method allows you to retrieve a BIP 157 content filter for a specific block in the Bitcoin blockchain.

Request

wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'X-CoinAPI-Key: 4303fb63-adec-42dc-b571-74bc2f2a5167' \
--body-data '{"jsonrpc":"2.0","id":1,"method":"getblockfilter","params": [ ]}' \
'https://bitcoin-mainnet.node.coinapi.io'

Request Parameters

  • blockhash (string): The hash of the block for which you want to retrieve the filter.
  • filtertype (string, optional, default=basic): The type name of the filter. You can specify the filter type as per your requirement.

Response

{
"result": null,
"error": {
"code": -1,
"message": "getblockfilter \"blockhash\" ( \"filtertype\" )\n\nRetrieve a BIP 157 content filter for a particular block.\n\nArguments:\n1. blockhash (string, required) The hash of the block\n2. filtertype (string, optional, default=\"basic\") The type name of the filter\n\nResult:\n{ (json object)\n \"filter\" : \"hex\", (string) the hex-encoded filter data\n \"header\" : \"hex\" (string) the hex-encoded filter header\n}\n\nExamples:\n> bitcoin-cli getblockfilter \"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\" \"basic\"\n> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\": \"curltest\", \"method\": \"getblockfilter\", \"params\": [\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\", \"basic\"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n"
},
"id": 1
}