{
  "openapi": "3.0.0",
  "info": {
    "title": "BTC Blockbook JSON-RPC API",
    "description": "Get access to balances, transactions, and UTXOs for addresses or xpubs via JSON-RPC. Adds 10 new methods.",
    "version": "1.0.0",
    "contact": {
      "email": "support@quicknode.com",
      "url": "https://support.quicknode.com/hc/en-us"
    }
  },
  "servers": [
    {
      "url": "https://{quicknode_endpoint}",
      "description": "Your Quicknode endpoint",
      "variables": {
        "quicknode_endpoint": {
          "default": "your-endpoint.quiknode.pro",
          "description": "Your Quicknode endpoint URL"
        }
      }
    }
  ],
  "tags": [
    {
      "name": "JSON-RPC",
      "description": "See request body examples for the available methods you can call on this add-on"
    }
  ],
  "paths": {
    "/rpc": {
      "post": {
        "summary": "JSON-RPC methods for https://blockbook-json-rpc.quicknode.com/rpc",
        "description": "Available methods:\n• bb_getXPUB: bb_getXPUB(xpub_or_descriptor, options_object)Returns balances and transactions of an xpub or output descriptor.\n• bb_getBalanceHistory: Returns a balance history for the specified XPUB or address.\n• bb_getUTXOs: bb_getUTXOs(address_or_xpub_or_descriptor, options_object)Returns array of unspent transaction outputs of address or xpub. By default, the list contains both confirmed and unconfirmed transactions. The option { confirmed: true } disables return of unconfirmed transactions.\n• bb_getAddress: bb_getAddress(address, options_object)Returns balances and transactions of an address. The returned transactions are sorted by block height, newest blocks first.\n• bb_getTxSpecific: Returns transaction data in the exact format as returned by backend.\n• bb_getTickersList: Returns a list of available currency rate tickers (secondary currencies) for the specified date, along with an actual data timestamp.\n• bb_getTx: bb_getTx(txHash) Returns transaction object for txHash.\n• bb_getBlock: bb_getBlock(block_hash_or_height) Returns the block data with transaction objects.\n• bb_getBlockHash: Returns the hash of the block at the given height.\n• bb_getTickers: Returns currency rate for the specified currency and date. If the currency is not available for that specific timestamp, the next closest rate will be returned. All responses contain an actual rate timestamp.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "bb_getXPUB"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "array",
                        "description": "Positional parameters",
                        "items": {
                          "description": "Parameter value (can be string, number, boolean, object, etc.)"
                        },
                        "example": [
                          "xpub661MyMwAqRbcGrx39FhTVkPJSd1oMiD8P8Vu4EP8SHyuvhqnaqu9VeK4m43WPPXouHpuUakK77Y6GzqCCKYYiCTsxhPBjmqhrfHqosmEFjL",
                          {
                            "page": 1,
                            "size": 1000,
                            "fromHeight": 0,
                            "details": "txids"
                          }
                        ]
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "bb_getBalanceHistory"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "array",
                        "description": "Positional parameters",
                        "items": {
                          "description": "Parameter value (can be string, number, boolean, object, etc.)"
                        },
                        "example": [
                          "bc1qwfgdjyy95aay2686fn74h6a4nu9eev6np7q4fn204dkj3274frlqrskvx0",
                          {
                            "from": "1683684000",
                            "to": "1700042400",
                            "fiatcurrency": "usd",
                            "groupBy": 3600
                          }
                        ]
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "bb_getUTXOs"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "array",
                        "description": "Positional parameters",
                        "items": {
                          "description": "Parameter value (can be string, number, boolean, object, etc.)"
                        },
                        "example": [
                          "bc1qwfgdjyy95aay2686fn74h6a4nu9eev6np7q4fn204dkj3274frlqrskvx0",
                          {
                            "confirmed": true
                          }
                        ]
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "bb_getAddress"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "array",
                        "description": "Positional parameters",
                        "items": {
                          "description": "Parameter value (can be string, number, boolean, object, etc.)"
                        },
                        "example": [
                          "bc1p72h09wplu60qdxyr8q3ftgdhga7jxnjhdz08qs4u9we9q3lzmqmqa4yzj6",
                          {
                            "page": 1,
                            "size": 1000,
                            "fromHeight": 0,
                            "details": "txids"
                          }
                        ]
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "bb_getTxSpecific"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "array",
                        "description": "Positional parameters",
                        "items": {
                          "description": "Parameter value (can be string, number, boolean, object, etc.)"
                        },
                        "example": [
                          "1c0a0c55a91c658688f3a9673b6f4ddb37e36b7160be93cb79dc1f507772834e"
                        ]
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "bb_getTickersList"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "array",
                        "description": "Positional parameters",
                        "items": {
                          "description": "Parameter value (can be string, number, boolean, object, etc.)"
                        },
                        "example": [
                          {
                            "timestamp": 1574346615
                          }
                        ]
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "bb_getTx"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "array",
                        "description": "Positional parameters",
                        "items": {
                          "description": "Parameter value (can be string, number, boolean, object, etc.)"
                        },
                        "example": [
                          "8970770f2069d60d6ff0f8f405a702b0caac03ce418061fd4af7326ba2e67810"
                        ]
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "bb_getBlock"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "array",
                        "description": "Positional parameters",
                        "items": {
                          "description": "Parameter value (can be string, number, boolean, object, etc.)"
                        },
                        "example": [
                          "000000000000000000016ad86be0be4793bf450d07816ed016cf375838b1dc2b",
                          {
                            "page": 1
                          }
                        ]
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "bb_getBlockHash"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "array",
                        "description": "Positional parameters",
                        "items": {
                          "description": "Parameter value (can be string, number, boolean, object, etc.)"
                        },
                        "example": [
                          "816884"
                        ]
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "bb_getTickers"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "array",
                        "description": "Positional parameters",
                        "items": {
                          "description": "Parameter value (can be string, number, boolean, object, etc.)"
                        },
                        "example": [
                          {
                            "timestamp": 1574346615
                          }
                        ]
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  }
                ],
                "discriminator": {
                  "propertyName": "method"
                }
              },
              "examples": {
                "bb_getXPUB": {
                  "summary": "bb_getXPUB(xpub_or_descriptor, options_object)Returns balances and transactions of an xpub or output descriptor.",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "bb_getXPUB",
                    "id": 1,
                    "params": [
                      "xpub661MyMwAqRbcGrx39FhTVkPJSd1oMiD8P8Vu4EP8SHyuvhqnaqu9VeK4m43WPPXouHpuUakK77Y6GzqCCKYYiCTsxhPBjmqhrfHqosmEFjL",
                      {
                        "page": 1,
                        "size": 1000,
                        "fromHeight": 0,
                        "details": "txids"
                      }
                    ]
                  }
                },
                "bb_getBalanceHistory": {
                  "summary": "Returns a balance history for the specified XPUB or address.",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "bb_getBalanceHistory",
                    "id": 1,
                    "params": [
                      "bc1qwfgdjyy95aay2686fn74h6a4nu9eev6np7q4fn204dkj3274frlqrskvx0",
                      {
                        "from": "1683684000",
                        "to": "1700042400",
                        "fiatcurrency": "usd",
                        "groupBy": 3600
                      }
                    ]
                  }
                },
                "bb_getUTXOs": {
                  "summary": "bb_getUTXOs(address_or_xpub_or_descriptor, options_object)Returns array of unspent transaction outputs of address or xpub. By default, the list contains both confirmed and unconfirmed transactions. The option { confirmed: true } disables return of unconfirmed transactions.",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "bb_getUTXOs",
                    "id": 1,
                    "params": [
                      "bc1qwfgdjyy95aay2686fn74h6a4nu9eev6np7q4fn204dkj3274frlqrskvx0",
                      {
                        "confirmed": true
                      }
                    ]
                  }
                },
                "bb_getAddress": {
                  "summary": "bb_getAddress(address, options_object)Returns balances and transactions of an address. The returned transactions are sorted by block height, newest blocks first.",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "bb_getAddress",
                    "id": 1,
                    "params": [
                      "bc1p72h09wplu60qdxyr8q3ftgdhga7jxnjhdz08qs4u9we9q3lzmqmqa4yzj6",
                      {
                        "page": 1,
                        "size": 1000,
                        "fromHeight": 0,
                        "details": "txids"
                      }
                    ]
                  }
                },
                "bb_getTxSpecific": {
                  "summary": "Returns transaction data in the exact format as returned by backend.",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "bb_getTxSpecific",
                    "id": 1,
                    "params": [
                      "1c0a0c55a91c658688f3a9673b6f4ddb37e36b7160be93cb79dc1f507772834e"
                    ]
                  }
                },
                "bb_getTickersList": {
                  "summary": "Returns a list of available currency rate tickers (secondary currencies) for the specified date, along with an actual data timestamp.",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "bb_getTickersList",
                    "id": 1,
                    "params": [
                      {
                        "timestamp": 1574346615
                      }
                    ]
                  }
                },
                "bb_getTx": {
                  "summary": "bb_getTx(txHash) Returns transaction object for txHash.",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "bb_getTx",
                    "id": 1,
                    "params": [
                      "8970770f2069d60d6ff0f8f405a702b0caac03ce418061fd4af7326ba2e67810"
                    ]
                  }
                },
                "bb_getBlock": {
                  "summary": "bb_getBlock(block_hash_or_height) Returns the block data with transaction objects.",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "bb_getBlock",
                    "id": 1,
                    "params": [
                      "000000000000000000016ad86be0be4793bf450d07816ed016cf375838b1dc2b",
                      {
                        "page": 1
                      }
                    ]
                  }
                },
                "bb_getBlockHash": {
                  "summary": "Returns the hash of the block at the given height.",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "bb_getBlockHash",
                    "id": 1,
                    "params": [
                      "816884"
                    ]
                  }
                },
                "bb_getTickers": {
                  "summary": "Returns currency rate for the specified currency and date. If the currency is not available for that specific timestamp, the next closest rate will be returned. All responses contain an actual rate timestamp.",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "bb_getTickers",
                    "id": 1,
                    "params": [
                      {
                        "timestamp": 1574346615
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jsonrpc": {
                      "type": "string",
                      "enum": [
                        "2.0"
                      ]
                    },
                    "id": {
                      "type": "integer"
                    },
                    "result": {
                      "description": "Method result"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "description": "Additional error data"
                        }
                      }
                    }
                  },
                  "required": [
                    "jsonrpc",
                    "id"
                  ]
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://www.quicknode.com/docs/bitcoin/bb_getxpub",
          "description": "Documentation: bb_getXPUB: https://www.quicknode.com/docs/bitcoin/bb_getxpub, bb_getBalanceHistory: https://www.quicknode.com/docs/bitcoin/bb_getbalancehistory, bb_getUTXOs: https://www.quicknode.com/docs/bitcoin/bb_getutxos, bb_getAddress: https://www.quicknode.com/docs/bitcoin/bb_getaddress, bb_getTxSpecific: https://www.quicknode.com/docs/bitcoin/bb_gettxspecific, bb_getTickersList: https://www.quicknode.com/docs/bitcoin/bb_gettickerslist, bb_getTx: https://www.quicknode.com/docs/bitcoin/bb_gettx, bb_getBlock: https://www.quicknode.com/docs/bitcoin/bb_getblock, bb_getBlockHash: https://www.quicknode.com/docs/bitcoin/bb_getblockhash, bb_getTickers: https://www.quicknode.com/docs/bitcoin/bb_gettickers"
        },
        "tags": [
          "JSON-RPC"
        ]
      }
    }
  },
  "externalDocs": {
    "description": "Support Documentation",
    "url": "https://support.quicknode.com/hc/en-us"
  }
}