TriportRPC

Get mempool snapshot

GEThttps://api.triport.io/v1/polygon/mempool/snapshot?limit=2

Returns 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.

Polygoncategory polygon_mempoolPro tier or higher — RPS-per-tier with 2× burst

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

limitintegeroptional
Maximum number of entries to return. Range 11000, default 50. Applied to each of the pending and queued arrays.

Response

Response fields

FieldTypeDescription
observed_atstring (date-time)Instant the snapshot was captured (RFC 3339 / ISO 8601).
block_heightinteger (int64)Chain head block number at the time of the snapshot.
pendingarray of PolyPendingTxExecutable transactions (sender's next nonce).
queuedarray of PolyPendingTxNon-executable transactions parked behind a nonce gap.

PolyPendingTx

FieldTypeDescription
hashstringTransaction hash. (required)
fromstringSender address (0x-prefixed). (required)
tostring | nullRecipient address, or null for contract-creation transactions.
gas_price_weistringLegacy gas price in wei (decimal string). Empty/"0" for EIP-1559 transactions.
max_fee_per_gas_weistringEIP-1559 max fee per gas in wei (decimal string).
max_priority_fee_per_gas_weistringEIP-1559 max priority fee (tip) per gas in wei (decimal string).
nonceinteger (int64)Sender account nonce for this transaction.

Errors

CodeMeaningWhen it happens
401unauthorized / trial_expired / subscription_expiredMissing, invalid, or expired credentials.
403tier_insufficient / method_unknownAPI key's tier is below Pro, or the method is not part of the Polygon product.
429rate_limitedSustained 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

  • limit caps each array independently — a request with limit=50 can return up to 50 pending and up to 50 queued entries.
  • A transaction in queued is waiting on an earlier nonce from the same sender; it becomes executable (and moves to pending) once the gap is filled.
  • For EIP-1559 transactions, read max_fee_per_gas_wei / max_priority_fee_per_gas_wei; gas_price_wei will 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.