# chainquery gettxspendingprevout

> chainquery gettxspendingprevout is a paid API for AI agents from x402.chainquery.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-11).

Checks whether given Bitcoin transaction outputs (UTXOs) are currently being spent by any unconfirmed mempool transaction

## Facts

- Endpoint: GET https://x402.chainquery.com/v1/rpc/gettxspendingprevout?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/chainquery-gettxspendingprevout-fcdc168a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_j_pjT4t59ag44-58rxHwR

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-gettxspendingprevout-fcdc168a
```

Example prompt: Check whether the output at index 0 of Bitcoin transaction a1b2c3d4e5f6... is currently being spent by any unconfirmed mempool transaction using chainquery's independent full node.

## When to prefer this

Use this endpoint when you need to detect double-spend attempts or check real-time mempool spend status for specific UTXOs without managing your own Bitcoin full node or obtaining an API key. Ideal for wallet software, exchange custody checks, and Lightning channel monitoring that need trustless, independent node data on a pay-per-call basis.

## Known failure modes

- Invalid or malformed transaction ID returns an RPC error
- Output index out of range for the given transaction
- Payment of $0.01 USDC not provided or rejected — returns HTTP 402
- Mempool data may differ from other nodes due to network propagation lag
- UTXO not found if transaction is unconfirmed or pruned

## How this service works

chainquery Bitcoin RPC: pay-per-call Bitcoin Core over x402, no API key. Whether given outputs are being spent by any mempool transaction, from chainquery's independent full node. Bitcoin Core gettxspendingprevout.

## Output

Returns the result of Bitcoin Core's gettxspendingprevout RPC call — for each queried prevout, indicates whether a mempool transaction is currently spending it and, if so, provides the spending transaction ID.

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

## More

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