# chainquery getblockchaininfo – Bitcoin Chain State via x402

> chainquery getblockchaininfo – Bitcoin Chain State via x402 is a paid API for AI agents from x402.chainquery.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Returns current Bitcoin blockchain state (height, best block hash, difficulty, sync progress, disk size) from chainquery's independent full node using Bitcoin Core's getblockchaininfo RPC.

## Facts

- Endpoint: GET https://x402.chainquery.com/v1/rpc/getblockchaininfo
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/chainquery-getblockchaininfo-bitcoin-chain-state-via-x402-6c47a216
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xAvJi6Vin1z60DbAFmVEh

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-getblockchaininfo-bitcoin-chain-state-via-x402-6c47a216
```

Example prompt: What's the current Bitcoin block height, best block hash, and difficulty right now — pull it straight from a Bitcoin Core full node?

## When to prefer this

Use this endpoint when you need trustworthy, real-time Bitcoin chain state (height, hash, difficulty, sync status) from an independent full node without obtaining an API key — ideal for agents that need to verify current chain conditions, monitor sync progress, or anchor transactions to a known block height, and are willing to pay micro-USDC per call via x402.

## Known failure modes

- Payment failure (x402): insufficient USDC balance or misconfigured payment header returns HTTP 402
- Node temporarily out of sync: verification progress < 1.0 may indicate stale data
- Rate or network errors from the upstream Bitcoin Core node return 5xx
- Invalid optional params JSON causes 400 bad request

## How this service works

chainquery Bitcoin RPC: pay-per-call Bitcoin Core over x402, no API key. Current Bitcoin (BTC) chain state from chainquery's independent full node: height, best block hash, difficulty, sync progress, on-disk size. Bitcoin Core getblockchaininfo.

## Output

A JSON object matching Bitcoin Core's getblockchaininfo response, including: chain name (e.g. 'main'), current block height, best block hash, difficulty, verification progress (0–1 float), headers count, on-disk size in bytes, pruned flag, and softfork/BIP activation statuses.

## 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": "getblockchaininfo result"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/chainquery-getblockchaininfo-bitcoin-chain-state-via-x402-6c47a216/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)
