txpool_status
https://api.triport.io/Returns the current depth of the Polygon mempool as two integer counts — pending and queued transactions — without any transaction bodies.
txpool_status returns the number of transactions currently held in the node's
mempool, split into two buckets: pending (transactions that are executable
right now — the account nonce and balance allow them to be included in the next
block) and queued (transactions that are not yet executable, usually because
of a nonce gap). The result is counts only — no transaction hashes, senders, or
calldata are included.
This is the lightest of the three mempool snapshot methods: a typical response
is around 30 bytes, so it is well suited to frequent polling (every 1–5 seconds)
when you want to track pool depth or detect congestion in near real time. Use it
as the cheap health-check signal, and reach for the heavier
txpool_content on a slower cadence (every ~30–60
seconds) only when you actually need the full transaction bodies.
txpool_status is a premium capability and requires the Pro tier or higher.
It is not part of the free read-RPC namespace.
Parameters
This method takes no parameters. Send an empty params array.
——optionalResponse
The pending and queued counts are returned as hex-encoded quantities (Geth
convention). In the example above, 0x2a1f = 10783 pending and 0x83 = 131
queued transactions.
resultobjectresult.pendingstring (hex quantity)result.queuedstring (hex quantity)Errors
| Code | Meaning | When it happens |
|---|---|---|
-32002 | tier_insufficient | Your key's tier is below Pro. txpool_status requires the polygon_txpool scope (Pro or Business). HTTP 403. |
-32003 | rate_limited | You exceeded the per-tier RPS limit (Pro 1 rps, Business 2 rps). Back off and retry. HTTP 429. |
See errors.md for the full JSON-RPC error envelope and the complete list of platform error codes.
Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io/", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "txpool_status",
params: [],
}),
});
const { result } = await res.json();
const pending = parseInt(result.pending, 16);
const queued = parseInt(result.queued, 16);
console.log(`mempool depth — pending: ${pending}, queued: ${queued}`);TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const client = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const status = await client.polygon.rpc<{ pending: string; queued: string }>(
"txpool_status",
[],
);
console.log({
pending: parseInt(status.pending, 16),
queued: parseInt(status.queued, 16),
});Python (triport-sdk)
import os
from triport import Triport
client = Triport(api_key=os.environ["TRIPORT_API_KEY"])
status = client.polygon.rpc("txpool_status", [])
print({
"pending": int(status["pending"], 16),
"queued": int(status["queued"], 16),
})Notes
- Polling cadence. Because the payload is tiny (~30 bytes) this method is the right tool for tight polling loops to chart mempool depth over time. Stay within your tier's RPS budget (Pro 1 rps, Business 2 rps) — at Pro that means one call per second.
- Pair with
txpool_content.txpool_statustells you how many;txpool_contenttells you which transactions (full bodies). A common pattern istxpool_statusevery 1–5 s for depth tracking plus a periodictxpool_contentfor the full snapshot. - Hex counts. Both fields follow the Geth quantity encoding (hex string).
Convert with
parseInt(value, 16)/int(value, 16)before doing arithmetic. - Related methods:
txpool_content(full mempool snapshot) andtxpool_inspect(human-readable per-account summary). All three share thepolygon_txpoolscope and the Pro tier requirement.