Get aggregate mempool statistics
https://api.triport.io/v1/polygon/mempool/stats?window=1mReturns rolling, pre-aggregated Polygon mempool metrics — throughput, gas-price percentiles, and the most active sending addresses — over a configurable time window.
GET /v1/polygon/mempool/stats gives you a compact, server-aggregated view of
the current Polygon PoS mempool. Instead of pulling a full pending-transaction
snapshot and computing statistics yourself, you receive ready-made aggregates:
observed throughput (tx_per_sec), the p50 / p95 / p99 gas-price percentiles in
gwei, and a ranked list of the addresses sending the most transactions over the
window.
Use it to drive a live "network conditions" widget, to pick a competitive gas
price before broadcasting, or to monitor mempool congestion without paying the
bandwidth and CPU cost of parsing the raw pool. The gas percentiles are the
quickest way to answer "what should I bid to land in the next few blocks?" —
gas_p50_gwei is a typical inclusion price, while gas_p95_gwei /
gas_p99_gwei reflect what aggressive senders are paying during contention.
If you need the individual pending and queued transactions rather than aggregates, use the companion mempool snapshot endpoint.
Parameters
Query parameters
windowstringoptional1m, 5m). Defaults to 1m.Response
Response fields
| Field | Type | Description |
|---|---|---|
window | string | The window the statistics were computed over (echoes the request, defaulting to 1m). |
tx_per_sec | number (double) | Observed mempool ingress rate, in transactions per second, averaged over the window. |
gas_p50_gwei | number (double) | Median (50th percentile) gas price of pending transactions, in gwei. |
gas_p95_gwei | number (double) | 95th-percentile gas price, in gwei. |
gas_p99_gwei | number (double) | 99th-percentile gas price, in gwei. |
top_senders | array | Addresses with the most pending transactions over the window, ranked by count (descending). |
top_senders[].address | string | 0x-prefixed Polygon sender address. |
top_senders[].count | integer | Number of transactions from that address observed in the window. |
Errors
All errors use the shared Triport REST envelope (error code + message +
request_id). See errors.md for the full envelope and every
shared code.
| Code | Meaning | When it happens |
|---|---|---|
401 | unauthorized / trial_expired / subscription_expired | No or invalid credentials, or the key's trial / subscription has ended. |
403 | tier_insufficient | The key's tier is below pro. The X-Required-Tier header and body carry the required tier and an upgrade_url. |
403 | method_unknown | The endpoint is not part of the Polygon product for this key. |
429 | rate_limited | Sustained + burst RPS exceeded for the polygon_mempool category. Honor Retry-After (1s) and retry. |
Examples
JavaScript (fetch)
const res = await fetch(
"https://api.triport.io/v1/polygon/mempool/stats?window=1m",
{
headers: {
Authorization: `Bearer ${process.env.TRIPORT_API_KEY}`,
},
},
);
const stats = await res.json();
console.log(`${stats.tx_per_sec.toFixed(1)} tx/s`);
console.log(`suggested gas: ~${stats.gas_p50_gwei} gwei (p99 ${stats.gas_p99_gwei})`);TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const client = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const stats = await client.polygon.mempool.stats({ window: "1m" });
console.log(stats.txPerSec, stats.gasP50Gwei, stats.gasP99Gwei);
console.log(stats.topSenders[0]?.address, stats.topSenders[0]?.count);Python (triport-sdk)
import os
from triport import Triport
client = Triport(api_key=os.environ["TRIPORT_API_KEY"])
stats = client.polygon.mempool.stats(window="1m")
print(f"{stats.tx_per_sec:.1f} tx/s")
print(f"p50={stats.gas_p50_gwei} p95={stats.gas_p95_gwei} p99={stats.gas_p99_gwei} gwei")
for s in stats.top_senders:
print(s.address, s.count)Notes
- Aggregates, not raw transactions. This endpoint returns computed statistics only. To inspect individual pending/queued transactions, use the mempool snapshot endpoint (also pro+).
- Gas pricing. Treat
gas_p50_gweias a baseline inclusion price and the p95 / p99 values as what's required to outbid congestion. The mempool changes continuously — re-poll before broadcasting if precise pricing matters. - Window default. Omitting
windowaggregates over the last1m. A longer window smooths out short spikes intx_per_secand the percentiles. - Tier gating. Mempool access is pro and above; a sub-pro key receives
403 tier_insufficient. See Rate Limits and Tiers for category budgets and burst behavior, and Authentication for how to pass your key. - No daily cap. Limiting is sustained-RPS-per-tier with a 2× burst; there is no daily quota or daily-quota header.