# Block402 Bitcoin RPC API

> Block402 Bitcoin RPC API is a paid API for AI agents from api.block402.xyz, paid per call via x402, $0.0025/call, status unknown (last checked 2026-10-12).

Query Bitcoin blockchain data via JSON-RPC methods including block counts, hashes, headers, transactions, and unspent outputs

## Facts

- Endpoint: POST https://api.block402.xyz/rpc/bitcoin?utm_source=zero.xyz
- Price: $0.0025/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/block402-bitcoin-rpc-api-018a01c1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1MINIHOGSxtZqo9wZ_oTf

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 block402-bitcoin-rpc-api-018a01c1 -d '<json body>'
```

Example prompt: What is the current Bitcoin block count, and can you also get me the block hash for block height 850000 using the Block402 Bitcoin RPC?

## When to prefer this

Choose this endpoint when you need real-time, read-only access to Bitcoin blockchain data — specifically block counts, block hashes, block headers, full block contents, raw transactions, or UTXO states — via a standard JSON-RPC interface. It is ideal for AI agents that need pay-per-request access without a subscription, using the x402 micropayment protocol. Prefer this over general blockchain explorers when you need programmatic, structured JSON output rather than human-readable pages, and when you specifically need Bitcoin (not Ethereum or other chains).

## Known failure modes

- Invalid or unsupported RPC method name returns an error response
- Missing or malformed params array causes a parse/invalid-params error
- Block hash or TXID not found on chain returns null result
- Exceeding maxItems (20) in params array is rejected
- Payment not processed (402 response) if x402 payment is not properly attached
- Network timeout if Bitcoin node is temporarily unavailable

## How this service works

Blockchain intelligence for AI agents. Query blockchain data through a read-only, pay-per-request API with x402.

## Output

A JSON-RPC 2.0 response object containing the result of the requested Bitcoin query — for example, an integer block count, a hex-encoded block hash string, a block header object with fields like confirmations and difficulty, a full block object with transaction list, or a raw transaction hex string and decoded UTXO details.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "id": {
   "type": [
    "string",
    "integer"
   ]
  },
  "method": {
   "enum": [
    "getblockcount",
    "getbestblockhash",
    "getblockhash",
    "getblockheader",
    "getblock",
    "getrawtransaction",
    "gettxout"
   ],
   "type": "string"
  },
  "params": {
   "type": "array",
   "maxItems": 20
  },
  "jsonrpc": {
   "const": "2.0"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "id": 1,
  "result": 969011,
  "jsonrpc": "2.0"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/block402-bitcoin-rpc-api-018a01c1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.block402.xyz](https://www.zero.xyz/host/api.block402.xyz/llms.txt)
