# getmempoolinfo

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://bitcoin-mainnet.g.alchemy.com/v2/{apiKey}

Provides information about the TX memory pool's current state, including memory usage, transaction count, and relay fee settings.


Reference: https://www.alchemy.com/docs/chains/bitcoin/bitcoin-api-endpoints/getmempoolinfo

## Result

**result** (object): Mempool state information.

## Example

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "loaded": true,
    "size": 4889,
    "bytes": 13816734,
    "usage": 49380080,
    "total_fee": 0.14547621,
    "maxmempool": 300000000,
    "mempoolminfee": 0.00001,
    "minrelaytxfee": 0.00001,
    "incrementalrelayfee": 0.00001,
    "unbroadcastcount": 0,
    "fullrbf": true
  },
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://bitcoin-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getmempoolinfo"
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({jsonrpc: '2.0', id: 1, method: 'getmempoolinfo'})
};

fetch('https://bitcoin-mainnet.g.alchemy.com/v2/docs-demo', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://bitcoin-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getmempoolinfo"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://bitcoin-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"getmempoolinfo\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://bitcoin-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"getmempoolinfo\"\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://bitcoin-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"getmempoolinfo\"\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## OpenRPC Method Specification

```yaml
name: getmempoolinfo
summary: Retrieve information about the mempool state
description: |
  Provides information about the TX memory pool's current state, including memory usage, transaction count, and relay fee settings.
params: []
result:
  name: result
  description: Mempool state information.
  schema:
    type: object
    required:
      - loaded
      - size
      - bytes
      - usage
      - total_fee
      - maxmempool
      - mempoolminfee
      - minrelaytxfee
      - incrementalrelayfee
      - unbroadcastcount
      - fullrbf
    properties:
      loaded:
        type: boolean
        description: Whether the mempool is fully loaded.
      size:
        type: integer
        description: Number of transactions in the mempool.
      bytes:
        type: integer
        description: Total size of mempool in bytes.
      usage:
        type: integer
        description: Total dynamic memory usage for the mempool (in bytes).
      total_fee:
        type: number
        format: double
        description: Total fees of all transactions in the mempool in BTC.
      maxmempool:
        type: integer
        description: Maximum allowed memory usage for the mempool in bytes.
      mempoolminfee:
        type: number
        format: double
        description: Minimum fee rate for transactions to be accepted into the mempool (in BTC/kvB).
      minrelaytxfee:
        type: number
        format: double
        description: Minimum fee rate for relaying transactions (in BTC/kvB).
      incrementalrelayfee:
        type: number
        format: double
        description: Incremental relay fee rate used for BIP 125 replacement (in BTC/kvB).
      unbroadcastcount:
        type: integer
        description: Number of transactions waiting for initial broadcast acknowledgement.
      fullrbf:
        type: boolean
        description: Whether full Replace-by-Fee is enabled.
examples:
  - name: getmempoolinfo example
    params: []
    result:
      name: result
      value:
        loaded: true
        size: 4889
        bytes: 13816734
        usage: 49380080
        total_fee: 0.14547621
        maxmempool: 300000000
        mempoolminfee: 0.00001
        minrelaytxfee: 0.00001
        incrementalrelayfee: 0.00001
        unbroadcastcount: 0
        fullrbf: true
```
