# Layer 1 Network Stats — Real-Time Gas, TPS & Congestion (`gochujang/layer1-network-stats`) Actor

Tracks real-time network statistics for major L1 blockchains: Ethereum, Bitcoin, Solana, Avalanche, Polygon. Gas prices, TPS, mempool depth, network load, and cross-chain cost comparison.

- **URL**: https://apify.com/gochujang/layer1-network-stats.md
- **Developed by:** [Hojun Lee](https://apify.com/gochujang) (community)
- **Categories:** Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 item processeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Layer 1 Network Stats — Real-Time Gas, TPS & Congestion

Track real-time network statistics for major L1 blockchains: **Ethereum, Bitcoin, Solana, Avalanche, Polygon**.

No API keys required. No proxies. Uses only public endpoints.

### What You Get

For each tracked chain:

| Field | Description |
|---|---|
| `chain_name` | Chain identifier |
| `block_height` | Latest confirmed block / slot |
| `avg_block_time_s` | Average block time in seconds |
| `avg_gas_price_gwei` | Current gas price (gwei for EVM chains; sat/vB for Bitcoin) |
| `gas_price_tier` | `low` / `medium` / `high` / `very_high` |
| `tps_estimate` | Estimated transactions per second |
| `pending_tx_count` | Mempool depth (unconfirmed transactions) |
| `network_load` | `idle` / `normal` / `busy` / `congested` |
| `fee_usd_simple_transfer` | Estimated USD cost of a simple transfer at current gas price |
| `relative_cost_score` | 0–100 score vs other tracked chains (100 = cheapest) |
| `native_price_usd` | Native token USD price used for fee calculation |
| `timestamp_utc` | ISO-8601 timestamp of data collection |

When `includeComparison` is enabled, a summary record is appended:

| Field | Description |
|---|---|
| `cheapest_chain` | Chain with lowest USD transfer fee |
| `fastest_chain_by_tps` | Chain with highest TPS |
| `fastest_chain_by_block_time` | Chain with lowest block time |
| `most_congested_chain` | Most congested chain at time of run |

### Input

```json
{
  "chains": ["ethereum", "bitcoin", "solana", "avalanche", "polygon"],
  "includeComparison": true
}
```

| Parameter | Type | Default | Description |
|---|---|---|---|
| `chains` | string\[] | All 5 chains | Chains to track |
| `includeComparison` | boolean | `true` | Append cross-chain comparison record |

### Data Sources

| Chain | Sources |
|---|---|
| Ethereum | Etherscan Gas Oracle (public), Cloudflare ETH RPC |
| Bitcoin | blockchain.info/stats, mempool.space/fees, blockchain.info/q/unconfirmedcount |
| Solana | api.mainnet-beta.solana.com (getRecentPerformanceSamples) |
| Avalanche | api.avax.network/ext/bc/C/rpc |
| Polygon | polygonscan.com Gas Oracle (public), polygon-rpc.com |

Token prices via CoinGecko Simple Price API (no key required).

### Pricing

| Event | Cost |
|---|---|
| Actor start | $0.001 |
| Per chain tracked | $0.005 |

Tracking all 5 chains costs **$0.026** per run.

### Use Cases

- **DeFi routing** — pick the cheapest chain for a transaction before executing
- **Arbitrage timing** — detect congestion windows and time cross-chain moves
- **Dashboard feeds** — power real-time gas/fee widgets
- **Alerting** — detect when a chain transitions to `congested`

### Example Output

```json
[
  {
    "chain_name": "solana",
    "block_height": 283741205,
    "avg_block_time_s": 0.4,
    "avg_gas_price_gwei": 0.005,
    "gas_price_tier": "low",
    "tps_estimate": 2840.5,
    "pending_tx_count": 0,
    "network_load": "normal",
    "fee_usd_simple_transfer": 0.00085,
    "relative_cost_score": 100,
    "native_price_usd": 172.4,
    "timestamp_utc": "2026-09-02T08:31:00.000000+00:00"
  },
  {
    "chain_name": "ethereum",
    "block_height": 20412018,
    "avg_block_time_s": 12.0,
    "avg_gas_price_gwei": 25.3,
    "gas_price_tier": "medium",
    "tps_estimate": 14.2,
    "pending_tx_count": 84200,
    "network_load": "busy",
    "fee_usd_simple_transfer": 1.27,
    "relative_cost_score": 18,
    "native_price_usd": 2400.0,
    "timestamp_utc": "2026-09-02T08:31:00.000000+00:00"
  },
  {
    "type": "cross_chain_comparison",
    "cheapest_chain": "solana",
    "cheapest_fee_usd": 0.00085,
    "fastest_chain_by_tps": "solana",
    "fastest_tps": 2840.5,
    "fastest_chain_by_block_time": "solana",
    "fastest_block_time_s": 0.4,
    "most_congested_chain": "ethereum",
    "timestamp_utc": "2026-09-02T08:31:00.000000+00:00"
  }
]
```

***

### Related actors

- [Multi-Chain Gas Tracker](https://apify.com/gochujang/multichain-gas-tracker) — Granular gas price data across 10+ EVM chains to pair with L1 congestion stats
- [L2 TVL Tracker](https://apify.com/gochujang/l2-tvl-tracker) — Layer 2 TVL to see how L2 adoption correlates with L1 congestion
- [Solana Ecosystem Tracker](https://apify.com/gochujang/solana-ecosystem-tracker) — Full Solana ecosystem health including DEX volume, staking, and TPS context

### Feedback

If this actor helps your blockchain infrastructure research, a review helps others find it: [Leave a review on Apify Store](https://apify.com/gochujang/layer1-network-stats#reviews)

***

**Keywords:** Layer 1 blockchain stats, Ethereum gas price tracker, Bitcoin mempool data, Solana TPS monitor, blockchain network health, L1 gas price comparison, crypto network congestion, cross-chain fee comparison, blockchain TPS data, Avalanche network stats, Polygon gas tracker, ETH gas oracle, blockchain infrastructure analytics

# Actor input Schema

## `chains` (type: `array`):

List of chains to fetch stats for. Supported values: ethereum, bitcoin, solana, avalanche, polygon.

## `includeComparison` (type: `boolean`):

Append a summary record with cheapest\_chain, fastest\_chain, most\_congested\_chain.

## Actor input object example

```json
{
  "chains": [
    "ethereum",
    "bitcoin",
    "solana",
    "avalanche",
    "polygon"
  ],
  "includeComparison": true
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("gochujang/layer1-network-stats").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("gochujang/layer1-network-stats").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call gochujang/layer1-network-stats --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gochujang/layer1-network-stats"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/9Iuek0RKzLciaz0nW/builds/7nBzC0O7oddR2Ocfd/openapi.json
