# chainquery Bitcoin getblockcount RPC

> chainquery Bitcoin getblockcount RPC is a paid API for AI agents from x402.chainquery.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-12).

Returns the current block height (block count) of the Bitcoin chain tip from chainquery's independent full node via pay-per-call x402 API

## Facts

- Endpoint: GET https://x402.chainquery.com/v1/rpc/getblockcount?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/chainquery-bitcoin-getblockcount-rpc-71f1a24e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wfF-xqmgMg2TkiMCQLiZC

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability chainquery-bitcoin-getblockcount-rpc-71f1a24e
```

Example prompt: What is the current Bitcoin block height right now? Use chainquery's independent full node to get the latest block count.

## When to prefer this

Use this endpoint when you need the current Bitcoin block height from an independent full node without setting up an API key, especially in automated or agent-driven workflows that can handle x402 micropayments. Prefer over free APIs when you need trustless, node-level data or when API key management is undesirable.

## Known failure modes

- Payment failure (HTTP 402) if x402 micropayment is not processed correctly
- Node temporarily out of sync returning a slightly stale block height
- Network timeout if chainquery's full node is unavailable
- Malformed response if optional params are incorrectly JSON-encoded

## How this service works

chainquery Bitcoin RPC: pay-per-call Bitcoin Core over x402, no API key. Current block height of the chain tip from chainquery's independent full node. Bitcoin Core getblockcount.

## Output

A JSON object with a 'result' field containing the current Bitcoin block height as an integer (e.g. {"result": 843210}), representing the number of blocks in the longest chain as seen by chainquery's full node.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "params": {
       "type": "string",
       "description": "optional: JSON-encoded array of positional RPC params"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "result": {
       "description": "getblockcount result"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/chainquery-bitcoin-getblockcount-rpc-71f1a24e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.chainquery.com](https://www.zero.xyz/host/x402.chainquery.com/llms.txt)
