Get mempool snapshot
https://api.triport.io/v1/polygon/mempool/snapshot?limit=2Returns a point-in-time snapshot of the Polygon PoS transaction pool — all currently `pending` and `queued` transactions, with the block height and wall-clock instant the snapshot was taken.
Returns a snapshot of the Polygon mempool: every transaction the node has
accepted but not yet included in a block. Results are split into two arrays —
pending (transactions executable right now, i.e. the nonce is next in line for
the sender) and queued (transactions parked behind a nonce gap and not yet
executable). Each entry is a PolyPendingTx with the sender,
recipient, nonce, and gas-pricing fields.
The snapshot also reports observed_at (the instant it was captured) and
block_height (the chain head at that instant), so you can correlate the pool
state against a specific block.
Use this endpoint for one-shot mempool inspection: gas-price estimation, nonce reconciliation for a pending send, or detecting whether a broadcast transaction has reached the pool. For a continuous stream of pending transactions, use the mempool firehose connect-info endpoint instead (see Notes); for aggregate counts and gas percentiles, see Get mempool stats.
This is the only Polygon mempool access available on the free underlying canal —
the upstream pool view is a scarce resource, which is why the endpoint is gated
at Pro and is rate-limited per tier. Snapshots can be large on a busy chain; use
the limit parameter to cap the number of entries returned per array.
Parameters
Query parameters
limitintegeroptional1–1000, default 50. Applied to each of the pending and queued arrays.Response
Response fields
| Field | Type | Description |
|---|---|---|
observed_at | string (date-time) | Instant the snapshot was captured (RFC 3339 / ISO 8601). |
block_height | integer (int64) | Chain head block number at the time of the snapshot. |
pending | array of PolyPendingTx | Executable transactions (sender's next nonce). |
queued | array of PolyPendingTx | Non-executable transactions parked behind a nonce gap. |
PolyPendingTx
| Field | Type | Description |
|---|---|---|
hash | string | Transaction hash. (required) |
from | string | Sender address (0x-prefixed). (required) |
to | string | null | Recipient address, or null for contract-creation transactions. |
gas_price_wei | string | Legacy gas price in wei (decimal string). Empty/"0" for EIP-1559 transactions. |
max_fee_per_gas_wei | string | EIP-1559 max fee per gas in wei (decimal string). |
max_priority_fee_per_gas_wei | string | EIP-1559 max priority fee (tip) per gas in wei (decimal string). |
nonce | integer (int64) | Sender account nonce for this transaction. |
Errors
| Code | Meaning | When it happens |
|---|---|---|
401 | unauthorized / trial_expired / subscription_expired | Missing, invalid, or expired credentials. |
403 | tier_insufficient / method_unknown | API key's tier is below Pro, or the method is not part of the Polygon product. |
429 | rate_limited | Sustained RPS for the polygon_mempool category exceeded. Honor the Retry-After header. |
Example 403 body (tier below Pro):
{
"error": "tier_insufficient",
"message": "polygon_mempool requires the pro tier",
"request_id": "req_8c1d2e3f4a5b",
"current_tier": "basic",
"required_tier": "pro",
"category": "polygon_mempool",
"method": "polygonMempoolSnapshot",
"upgrade_url": "https://api.triport.io/billing/upgrade"
}Example 429 body:
{
"error": "rate_limited",
"message": "rate limit exceeded on polygon_mempool",
"request_id": "req_a1b2c3d4e5f6",
"current_tier": "pro",
"category": "polygon_mempool",
"retry_after_sec": 1,
"limit_rps": 25,
"burst_capacity": 50
}429 responses also carry Retry-After, X-RateLimit-Limit,
X-RateLimit-Remaining, X-RateLimit-Reset, and X-RateLimit-Category
headers. See the shared error reference for the full envelope
and every error code.
Examples
JavaScript (fetch)
const res = await fetch(
"https://api.triport.io/v1/polygon/mempool/snapshot?limit=100",
{ headers: { Authorization: `Bearer ${process.env.TRIPORT_API_KEY}` } }
);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const snapshot = await res.json();
console.log(`@block ${snapshot.block_height}: ` +
`${snapshot.pending.length} pending, ${snapshot.queued.length} queued`);TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const client = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const snapshot = await client.polygon.mempool.snapshot({ limit: 100 });
for (const tx of snapshot.pending) {
console.log(`${tx.hash} from ${tx.from} (nonce ${tx.nonce})`);
}Python (triport-sdk)
import os
from triport import Triport
client = Triport(api_key=os.environ["TRIPORT_API_KEY"])
snapshot = client.polygon.mempool.snapshot(limit=100)
print(f"@block {snapshot.block_height}: "
f"{len(snapshot.pending)} pending, {len(snapshot.queued)} queued")Notes
limitcaps each array independently — a request withlimit=50can return up to 50pendingand up to 50queuedentries.- A transaction in
queuedis waiting on an earlier nonce from the same sender; it becomes executable (and moves topending) once the gap is filled. - For EIP-1559 transactions, read
max_fee_per_gas_wei/max_priority_fee_per_gas_wei;gas_price_weiwill be"0"or empty. For legacy transactions, the reverse holds. - The snapshot is a single point in time — the pool changes every block. For a live stream, request a signed WebSocket URL from the mempool firehose connect-info endpoint (Business tier). For rolling aggregates instead of raw entries, see Get mempool stats.