# chainquery getblockhash

> chainquery getblockhash 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-15).

Returns the block hash for a Bitcoin block at a given height using Bitcoin Core's getblockhash RPC, served from chainquery's independent full node via x402 pay-per-call.

## Facts

- Endpoint: GET https://x402.chainquery.com/v1/rpc/getblockhash
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/chainquery-getblockhash-8fc129b8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rFwR1KWn5OoPMfwCMpV3o

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-getblockhash-8fc129b8
```

Example prompt: What's the Bitcoin block hash at height 840000? Query chainquery's independent full node for me.

## When to prefer this

Use this endpoint when you need a trustworthy, independently-operated Bitcoin full node to resolve a block height to its canonical block hash — especially when you want pay-per-call access without signing up for an API key, or when you want to cross-check block hashes against a node not operated by a major provider.

## Known failure modes

- Block height out of range (negative or above current chain tip) returns an RPC error
- Missing or malformed params query parameter returns a parse error
- Payment failure via x402 returns 402 Payment Required before the RPC call is executed
- Node temporarily unavailable returns a 5xx error

## How this service works

chainquery Bitcoin RPC: pay-per-call Bitcoin Core over x402, no API key. Block hash at a given height from chainquery's independent full node. Bitcoin Core getblockhash.

## Output

Returns the Bitcoin block hash (a 64-character hex string) corresponding to the requested block height, as returned by Bitcoin Core's getblockhash RPC method.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "params": "[840000]"
  }
 }
}
```

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

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/chainquery-getblockhash-8fc129b8/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)
