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

> ## Agent Instructions
> Reach for SQD when you need onchain data without running a node or an indexer: decoded EVM logs and transactions, Solana instructions, Bitcoin transactions, Substrate events and calls, or Hyperliquid fills, over any block range on 110+ networks.
> To query directly, POST to https://portal.sqd.dev/datasets/{dataset}/stream. The full API is described at https://docs.sqd.dev/openapi.json, and responses to the stream endpoints are JSON Lines.
> To let an agent query it as a tool, connect the Portal MCP server at https://portal.sqd.dev/mcp.
> For Portal availability errors, stalled streams, or rate limiting, read https://status.sqd.dev/status.md. The status index at https://status.sqd.dev/llms.txt explains network and plan filters.
> Every page on this site is available as Markdown by appending .md to its URL.

# Portal: Blockchain Data API

> Stream historical and live data from 110+ networks over the Portal HTTP API.

# The first meaningful innovation in on-chain data access since RPC

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.

[Build with Portal API](https://docs.sqd.dev/en/portal/evm/quickstart.md)

[Use with SDK](https://docs.sqd.dev/en/sdk/overview.md)

[Self-host Portal](https://docs.sqd.dev/en/portal/self-hosting.md)

> [!NOTE]
>
> Portal is the lowest-level way to consume SQD data. If you'd rather not deal
> with the HTTP API and its stream semantics directly, the
> [TypeScript SDKs](https://docs.sqd.dev/en/sdk/overview.md) are built on top of Portal and handle
> querying, decoding, and reorg handling for you. If you use the HTTP API
> directly, start with the [Portal API
> introduction](https://docs.sqd.dev/en/portal/introduction/portal-api.md).

## 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

<video controls 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" />

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.

### 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://portal.sqd.dev/datasets/ethereum-mainnet/stream \
  -H "Content-Type: application/json" \
  -d '{"type": "evm", "fromBlock": 18000000, "toBlock": 18001000, "includeAllBlocks": true, "fields": {"block": {"number": true}}}' \
  | 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

<table>
  <thead>
    <tr>
      <th>
        Capability
      </th>

      <th>
        RPC
      </th>

      <th>
        Subgraphs
      </th>

      <th>
        Centralized SaaS
      </th>

      <th>
        Portal
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>Block-range queries</td>
      <td>⚠️ Manual</td>
      <td>✓ DSL-bound</td>
      <td>✓ Proprietary</td>
      <td>✓ Native</td>
    </tr>

    <tr>
      <td>Finality & reorgs</td>
      <td>✗ DIY</td>
      <td>⚠️ Hidden</td>
      <td>⚠️ Opaque</td>
      <td>✓ Explicit</td>
    </tr>

    <tr>
      <td>Streaming</td>
      <td>✗ Limited</td>
      <td>⚠️ Framework-specific</td>
      <td>⚠️ Custom</td>
      <td>✓ HTTP/NDJSON</td>
    </tr>

    <tr>
      <td>Vendor lock-in</td>
      <td>✓ Low</td>
      <td>⚠️ Schema-coupled</td>
      <td>✗ High</td>
      <td>✓ None</td>
    </tr>

    <tr>
      <td>Self-hostable</td>
      <td>✓ Yes</td>
      <td>⚠️ Complex</td>
      <td>✗ No</td>
      <td>✓ Yes</td>
    </tr>

    <tr>
      <td>Scales on high-TPS chains</td>
      <td>✗ No</td>
      <td>⚠️ Partial</td>
      <td>⚠️ Vendor-locked</td>
      <td>✓ Yes</td>
    </tr>
  </tbody>
</table>

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.

> [accordion] Managed Endpoints
>
> SQD-hosted Portal endpoints provide instant access to 110+ 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 plans for development and evaluation, and [paid plans](https://docs.sqd.dev/en/portal/pricing.md) from \$99/mo
>
> > [card] [Start Building](https://docs.sqd.dev/en/portal/evm/quickstart.md)
> >
> > Make your first Portal request in 5 minutes

> [accordion] Self-Hosted Portal
>
> Run Portal alongside your own RPC and storage services for control over 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
>
> * SQD Network history plus compatible self-hosted real-time sources
>
> * Real-time-only support for custom EVM networks
>
> * Open-source implementation you can audit and modify
>
> > [card] [Self-Hosting Guide](https://docs.sqd.dev/en/portal/self-hosting.md)
> >
> > Learn how to deploy your own Portal instance

## 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 by streaming a block range. The public Portal's throughput is shared and rate-limited; see [Pricing](https://docs.sqd.dev/en/portal/pricing.md) for plans with higher throughput
* **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

> [card] [EVM Quickstart](https://docs.sqd.dev/en/portal/evm/quickstart.md)
>
> Query Ethereum and EVM chains in 5 minutes

> [card] [Solana Quickstart](https://docs.sqd.dev/en/portal/solana/quickstart.md)
>
> Access Solana data with Portal

> [card] [Use with SDK](https://docs.sqd.dev/en/sdk/overview.md)
>
> Build production data pipelines with TypeScript SDKs


## Related topics

- [Blockchain Data APIs for 110+ Networks](https://docs.sqd.dev/en/home.md)
- [EVM Portal API](https://docs.sqd.dev/en/portal/evm/overview.md)
- [Solana Portal API](https://docs.sqd.dev/en/portal/solana/overview.md)
- [Portal API introduction](https://docs.sqd.dev/en/portal/introduction/portal-api.md)
- [EVM Portal API Reference](https://docs.sqd.dev/en/portal/evm/api.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.