Get aggregate mempool statistics
https://api.triport.io/v1/eth/mempool/stats?window=5mReturns rolling, aggregate statistics over pending Ethereum transactions observed across the execution-layer mesh — throughput, gas-price percentiles, and the busiest senders.
This endpoint summarizes the pending-transaction stream that Triport observes
across its Ethereum execution-layer mesh and returns a compact set of aggregate
metrics for a chosen time window. Unlike
/v1/eth/mempool/snapshot, which returns the
individual pending transactions at one instant, this endpoint returns derived
statistics only — making it cheap to poll for dashboards and alerting.
The figures cover three things: throughput (tx_per_sec, the mean rate of
newly observed pending transactions over the window), the gas-price
distribution (the 50th, 95th, and 99th percentiles of effective gas price, in
gwei), and the top senders (the addresses that broadcast the most pending
transactions during the window, with their counts).
Use the gas-price percentiles to set a competitive maxFeePerGas /
maxPriorityFeePerGas (the gas_p95_gwei / gas_p99_gwei values are useful
ceilings for time-sensitive transactions), tx_per_sec to gauge network
congestion, and top_senders to spot high-frequency bots or active contracts.
Percentiles are expressed in gwei as floating-point numbers, in contrast to
the snapshot endpoint, which reports raw wei as decimal strings.
This is a pro-tier endpoint. Rate limiting is RPS-per-tier with a burst multiplier of 2; there is no daily quota.
Parameters
The only parameter is a query parameter; it is optional.
windowstringoptional1m, 5m, 1h. Defaults to 1m.Response
Response fields
| Field | Type | Description |
|---|---|---|
window | string | The aggregation window the statistics cover. Echoes the requested window (e.g. 5m). |
tx_per_sec | number | Mean rate of newly observed pending transactions across the window. |
gas_p50_gwei | number | Median (50th-percentile) effective gas price of observed pending transactions, in gwei. |
gas_p95_gwei | number | 95th-percentile effective gas price, in gwei. |
gas_p99_gwei | number | 99th-percentile effective gas price, in gwei. |
top_senders | array | The most active sending addresses during the window, ordered by count (descending). |
top_senders[].address | string | Sender address (0x-prefixed, 20 bytes). |
top_senders[].count | integer | Number of pending transactions observed from this sender during the window. |
Errors
| Code | Meaning | When it happens |
|---|---|---|
401 | Missing or invalid API key | No Authorization header, or the bearer token is not a valid Triport API key (unauthorized), or the trial/subscription has lapsed (trial_expired / subscription_expired). |
403 | Forbidden | The key's plan is below the pro tier required for mempool endpoints (tier_insufficient). |
429 | Rate limit exceeded | The per-tier RPS limit was exceeded (rate_limited). Honor the Retry-After header before retrying. |
See errors for the full error envelope and retry guidance.
Examples
JavaScript (fetch)
const res = await fetch(
"https://api.triport.io/v1/eth/mempool/stats?window=5m",
{ headers: { Authorization: `Bearer ${process.env.TRIPORT_API_KEY}` } }
);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const stats = await res.json();
console.log(`${stats.tx_per_sec.toFixed(1)} tx/s · p95 ${stats.gas_p95_gwei} gwei`);TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const stats = await triport.eth.mempool.stats({ window: "5m" });
console.log(`throughput: ${stats.txPerSec} tx/s`);
console.log(`gas p50/p95/p99 (gwei):`, stats.gasP50Gwei, stats.gasP95Gwei, stats.gasP99Gwei);
for (const sender of stats.topSenders) {
console.log(sender.address, sender.count);
}Python (triport-sdk)
import os
from triport import Triport
client = Triport(api_key=os.environ["TRIPORT_API_KEY"])
stats = client.eth.mempool.stats(window="5m")
print(f"throughput: {stats.tx_per_sec} tx/s")
print(f"gas p50/p95/p99 (gwei):", stats.gas_p50_gwei, stats.gas_p95_gwei, stats.gas_p99_gwei)
for sender in stats.top_senders:
print(sender.address, sender.count)Notes
- Gas percentiles are in gwei, as numbers — ready to display or compare
directly. This differs from
/v1/eth/mempool/snapshot, where per-transaction fees are reported as raw wei decimal strings. - Choose
windowto match your cadence.1m(the default) reacts quickly to congestion spikes;1hsmooths out short-lived noise. Valid values are1m,5m, and1h. top_sendersis bounded. It lists the busiest addresses for the window, not every sender; use it to identify dominant traffic, not for exhaustive accounting.- No daily quota. Rate limiting is RPS-per-tier with a burst multiplier of
2; a
429 rate_limitedresponse means you should back off and retry after theRetry-Afterinterval. - For the individual pending transactions behind these statistics, use
/v1/eth/mempool/snapshot.