> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getmempoolancestors | Bitcoin

The `getmempoolancestors` method retrieves all in-mempool ancestors for a specific transaction in the mempool.

<Note>
  **Get an unconfirmed transaction hash**

  For the example to work, get an unconfirmed transaction hash from [mempool.space](https://mempool.space/).
</Note>

<Note>
  **Empty result**

  If there is no pending transaction in the mempool that is an ancestor to the one you are querying, you will get an empty response.
</Note>

<Check>
  **Get your own node endpoint today**

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## Parameters

* `txid` (required) — the transaction ID for which to retrieve in-mempool ancestors.

## Response

* `result` — an array containing all in-mempool ancestor transactions for the specified transaction.
* `error` — an object containing an error message if an error occurred, otherwise `null`.
* `id` — an integer representing the ID of the request, used to match requests with responses.

## Use case

The `getmempoolancestors` method is useful for exploring the ancestry of a transaction in the mempool. It provides insights into the chain of transactions that are waiting to be included in a block.


## OpenAPI

````yaml /openapi/bitcoin_node_api/getmempoolancestors.json POST /788f110831fe13808302bd79796d55e8
openapi: 3.0.0
info:
  title: getmempoolancestors example
  version: 1.0.0
  description: >-
    This is an API example for getmempoolancestors, a method to retrieve all
    in-mempool ancestors for a  transaction in the mempool.
servers:
  - url: https://nd-202-842-353.p2pify.com
security: []
paths:
  /788f110831fe13808302bd79796d55e8:
    post:
      tags:
        - Blockchain Operations
      summary: getmempoolancestors
      operationId: getMempoolAncestors
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '1.0'
                method:
                  type: string
                  default: getmempoolancestors
                params:
                  type: array
                  items:
                    type: string
                    description: The transaction ID
                    example: >-
                      f6a4beaf3b26ae273d50eb8f6ea18e776932b4fefd24c8b915b94b6d22e89bc9
                  default:
                    - >-
                      f6a4beaf3b26ae273d50eb8f6ea18e776932b4fefd24c8b915b94b6d22e89bc9
                id:
                  type: integer
                  default: 1
      responses:
        '200':
          description: All in-mempool ancestors for the specified transaction
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    description: An array of in-mempool ancestor transactions
                  error:
                    type: object
                  id:
                    type: integer

````