> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqd.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# SQD Portal

> Stream historical and live blockchain data via the SQD Portal API — HTTP-native, reorg-safe, constant memory, free public endpoints across 225+ chains.

<div className="relative rounded-2xl border border-slate-200 dark:border-slate-700 shadow-xl overflow-hidden my-8">
  <div className="relative z-10 bg-gradient-to-br from-slate-50 via-gray-50 to-slate-100 dark:from-gray-900 dark:via-gray-900 dark:to-slate-900 p-8 sm:p-10 lg:p-12">
    <div className="max-w-4xl mx-auto text-center">
      <h1 className="text-3xl sm:text-4xl lg:text-5xl font-bold text-gray-900 dark:text-white mb-5 leading-tight">
        The first meaningful innovation in on-chain data access since RPC
      </h1>

      <p className="text-lg sm:text-xl text-gray-700 dark:text-gray-300 mb-8 leading-relaxed">
        RPC was built for transactions, not data extraction. SQD Portal is an
        HTTP interface designed for data pipelines, query arbitrary block ranges,
        handle reorgs natively, and stream terabytes with constant memory usage.
      </p>

      <div className="flex gap-4 justify-center flex-wrap">
        <a href="/en/portal/evm/quickstart" className="inline-flex items-center px-8 py-4 bg-slate-700 hover:bg-slate-800 dark:bg-slate-600 dark:hover:bg-slate-700 text-white font-semibold rounded-lg shadow-md hover:shadow-lg transition-all duration-200">
          Build with Portal API

          <svg className="w-5 h-5 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
          </svg>
        </a>

        <a href="/en/sdk/overview" className="inline-flex items-center px-8 py-4 border border-slate-300 dark:border-slate-600 hover:border-slate-400 dark:hover:border-slate-500 bg-white dark:bg-gray-900 text-gray-900 dark:text-white font-semibold rounded-lg shadow-md hover:shadow-lg transition-all duration-200">
          Use with SDK
        </a>

        <a href="/en/portal/self-hosting" className="inline-flex items-center px-8 py-4 border border-slate-300 dark:border-slate-600 hover:border-slate-400 dark:hover:border-slate-500 bg-white dark:bg-gray-900 text-gray-900 dark:text-white font-semibold rounded-lg shadow-md hover:shadow-lg transition-all duration-200">
          Self-host Portal
        </a>
      </div>
    </div>
  </div>
</div>

## The Problem with RPC

Modern blockchain data engineering faces a fundamental challenge: RPC was designed for wallets and transaction submission, not for extracting and processing large volumes of historical data.

Traditional RPC-based approaches struggle with:

* **Backfill failures**: Extracting even a single wallet's history can timeout on high-history chains like BSC or Solana
* **Manual pagination**: Block-by-block iteration breaks down on high-TPS chains where throughput exceeds what sequential requests can handle
* **DIY reorg handling**: You're responsible for detecting and compensating for chain reorganizations
* **Limited scalability**: Teams resort to centralized data warehouses with vendor lock-in just to query their own data

Portal solves these problems with an HTTP interface purpose-built for data extraction at scale.

## How Portal Works

<Frame>
  <video controls className="w-full aspect-video rounded-xl" src="https://mintcdn.com/sqd-2119b3c3/HEGo3IkwhuFAmNOe/videos/portal-diagram.mp4?fit=max&auto=format&n=HEGo3IkwhuFAmNOe&q=85&s=4a60c6f42a8e67006bb7754d7b2da946" aria-label="Portal architecture diagram showing data flow from blockchain nodes through Portal API to data pipelines" data-path="videos/portal-diagram.mp4" />
</Frame>

Portal sits between blockchain nodes and your data pipeline, providing an HTTP API optimized for high-throughput data extraction. It handles the complexity of pagination, finality tracking, and reorg compensation so you don't have to.

## Core Capabilities

### Arbitrary block ranges

Query any block range in a single HTTP request, no manual pagination or block-by-block iteration. Essential for backfills and historical analysis on any chain.

```http theme={"system"}
POST /stream
fromBlock: 18000000
toBlock: 18100000
```

Portal handles the pagination internally and streams results back to you efficiently, even for ranges spanning millions of blocks.

### Native finalization awareness

Portal tracks chain-specific finality rules and communicates reorgs as structured rollback events in the stream. Use `/finalized-stream` for production-safe ingestion that automatically handles chain reorganizations.

<Tip>
  Portal handles reorg detection and compensation automatically, no need to
  implement your own rollback logic.
</Tip>

### HTTP streaming responses

All Portal endpoints return newline-delimited JSON (NDJSON), enabling constant-memory processing of massive block ranges. Process terabytes of data without loading everything into RAM.

```bash theme={"system"}
curl --compressed -X POST https://v2.archive.subsquid.io/network/ethereum-mainnet/stream \
  -H "Content-Type: application/json" \
  -d '{"fromBlock": 18000000, "toBlock": 18001000}' \
  | while IFS= read -r line; do
      echo "$line" | jq '.header.number'
    done
```

### Deployment flexibility

Portal is an interface specification, not a single implementation. Use managed SQD endpoints, self-host alongside your own nodes, or connect to the decentralized SQD Network, your code stays the same.

## Portal vs Alternatives

<div className="overflow-x-auto my-8">
  <table className="w-full text-sm border-collapse">
    <thead>
      <tr className="border-b-2 border-slate-300 dark:border-slate-600">
        <th className="text-left p-3 font-semibold text-gray-900 dark:text-white">
          Capability
        </th>

        <th className="text-left p-3 font-semibold text-gray-900 dark:text-white">
          RPC
        </th>

        <th className="text-left p-3 font-semibold text-gray-900 dark:text-white">
          Subgraphs
        </th>

        <th className="text-left p-3 font-semibold text-gray-900 dark:text-white">
          Centralized SaaS
        </th>

        <th className="text-left p-3 font-semibold text-gray-900 dark:text-white">
          Portal
        </th>
      </tr>
    </thead>

    <tbody className="text-gray-700 dark:text-gray-400">
      <tr className="border-b border-slate-200 dark:border-slate-700">
        <td className="p-3">Block-range queries</td>
        <td className="p-3">⚠️ Manual</td>
        <td className="p-3">✓ DSL-bound</td>
        <td className="p-3">✓ Proprietary</td>
        <td className="p-3 font-semibold text-green-600">✓ Native</td>
      </tr>

      <tr className="border-b border-slate-200 dark:border-slate-700">
        <td className="p-3">Finality & reorgs</td>
        <td className="p-3">✗ DIY</td>
        <td className="p-3">⚠️ Hidden</td>
        <td className="p-3">⚠️ Opaque</td>
        <td className="p-3 font-semibold text-green-600">✓ Explicit</td>
      </tr>

      <tr className="border-b border-slate-200 dark:border-slate-700">
        <td className="p-3">Streaming</td>
        <td className="p-3">✗ Limited</td>
        <td className="p-3">⚠️ Framework-specific</td>
        <td className="p-3">⚠️ Custom</td>
        <td className="p-3 font-semibold text-green-600">✓ HTTP/NDJSON</td>
      </tr>

      <tr className="border-b border-slate-200 dark:border-slate-700">
        <td className="p-3">Vendor lock-in</td>
        <td className="p-3 text-green-600">✓ Low</td>
        <td className="p-3">⚠️ Schema-coupled</td>
        <td className="p-3 text-red-600">✗ High</td>
        <td className="p-3 font-semibold text-green-600">✓ None</td>
      </tr>

      <tr className="border-b border-slate-200 dark:border-slate-700">
        <td className="p-3">Self-hostable</td>
        <td className="p-3 text-green-600">✓ Yes</td>
        <td className="p-3">⚠️ Complex</td>
        <td className="p-3 text-red-600">✗ No</td>
        <td className="p-3 font-semibold text-green-600">✓ Yes</td>
      </tr>

      <tr>
        <td className="p-3">Scales on high-TPS chains</td>
        <td className="p-3 text-red-600">✗ No</td>
        <td className="p-3">⚠️ Partial</td>
        <td className="p-3">⚠️ Vendor-locked</td>
        <td className="p-3 font-semibold text-green-600">✓ Yes</td>
      </tr>
    </tbody>
  </table>
</div>

Portal provides the raw data extraction layer that works with any processing framework or storage backend, giving you complete control over your data pipeline.

## Deployment Options

Choose how you want to run Portal based on your requirements, all options use the same API interface.

<AccordionGroup>
  <Accordion title="Managed Endpoints" icon="cloud">
    SQD-hosted Portal endpoints provide instant access to 200+ networks with zero setup.

    **Best for**: Getting started quickly, production apps without infrastructure overhead, and teams who want to focus on building rather than operations.

    **Key benefits**:

    * Instant access, no infrastructure to manage
    * Production-ready with high availability
    * Free tier available for development

    <Card title="Start Building" icon="rocket" href="/en/portal/evm/quickstart">
      Make your first Portal request in 5 minutes
    </Card>
  </Accordion>

  <Accordion title="Self-Hosted Portal" icon="server">
    Run Portal alongside your own nodes for complete sovereignty over your data access.

    **Best for**: Private or custom networks, teams with strict data sovereignty requirements, and maximum control over infrastructure.

    **Key benefits**:

    * Complete control over data access
    * No external dependencies
    * Works with any EVM or Solana chain
    * Open-source implementation you can audit and modify

    <Card title="Self-Hosting Guide" icon="server" href="/en/portal/self-hosting">
      Learn how to deploy your own Portal instance
    </Card>
  </Accordion>
</AccordionGroup>

## Use Cases

Portal excels at scenarios where RPC falls short:

* **Full contract history extraction**: Query all events for a contract across its entire lifetime
* **Wallet transaction history**: Retrieve complete transaction history for any address, even on high-volume chains
* **Historical backfills**: Synchronize years of blockchain history without timeouts or rate limits
* **High-TPS monitoring**: Keep up with fast chains like Solana where block-by-block RPC polling can't keep pace
* **Multi-chain indexing**: Build data pipelines that span multiple networks using a consistent interface

## Next Steps

<CardGroup cols={3}>
  <Card title="EVM Quickstart" icon="play" href="/en/portal/evm/quickstart">
    Query Ethereum and EVM chains in 5 minutes
  </Card>

  <Card title="Solana Quickstart" icon="play" href="/en/portal/solana/quickstart">
    Access Solana data with Portal
  </Card>

  <Card title="Use with SDK" icon="code" href="/en/sdk/overview">
    Build production data pipelines with TypeScript SDKs
  </Card>
</CardGroup>
