Make your first Portal request to access raw EVM blockchain data in under 5 minutes. No setup required, just HTTP requests.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.
What You’ll Build
In this quickstart, you’ll:- Make a simple Portal request using curl (no installation required)
- Query recent Ethereum blocks
- Filter event logs from a smart contract
This guide uses the Public Portal endpoint, which is free and
rate-limited. Perfect for getting started.
Step 1: Your First Request
Let’s query the last 1,000 blocks from Ethereum mainnet. Copy and paste this command:- curl
- TypeScript
- Python
You should see a stream of JSON objects, one per block, showing block numbers,
timestamps, and gas usage.
includeAllBlocks: true tells Portal to return every block in the range.
Without it (the default on EVM), Portal returns only blocks matching your
data filters (logs, transactions, traces, stateDiffs). This request
has no filters, so without includeAllBlocks it would return just the
boundary blocks of the underlying workers, not the full range. See Stream
semantics below.Try it yourself with the interactive query interface below:
Step 2: Understanding the Request
Let’s break down what you just sent:Step 3: Understanding the Response
Portal returns newline-delimited JSON (NDJSON). Each line is a complete JSON object representing one block. WithincludeAllBlocks: true the request above returns 1001 blocks (one per line). The first and last look like this:
This format enables constant-memory streaming of massive ranges. You can
process millions of blocks without loading everything into RAM.
Stream semantics
Two behaviors are easy to miss on your first Portal request. Both are enforced by the API, and clients that ignore them will silently drop data.includeAllBlocks
Portal returns only blocks that match your data filters (logs, transactions, traces, stateDiffs).
- If you set filters (e.g.
logs: [{ address: [...] }]), Portal returns only blocks containing matching items. You rarely needincludeAllBlocks. - If you want every block in the range regardless of filters (for analytics, backfilling a full block table, etc.), set
"includeAllBlocks": true. - Defaults differ by chain:
falseon EVM, Solana, and Substrate;trueon Bitcoin. Check the dataset’s API spec if in doubt.
includeAllBlocks, Portal returns just the worker-range boundary blocks. On EVM that’s typically 2–4 blocks per query. If you see far fewer blocks than expected, this is why.
The stream can end before toBlock
A single HTTP response can be cut short at any point: when a worker’s range ends, when a connection is recycled, or at the dataset’s current head. Clients must treat one response as a batch, not the entire range. To continue:
- Read the last block number (
N) in the response. - Issue a new request with
fromBlock = N + 1(and the sametoBlock, filters, and fields). - Loop until you receive HTTP 204 (range is above dataset height) or you reach your
toBlock.
parentBlockHash on each subsequent request and handle HTTP 409 (reorg). See the full API reference.
Step 4: Filter Event Logs
Track USDC Transfer events:You should see Transfer events from the USDC contract. Portal filtered the
data before sending, saving bandwidth.
What You Learned
In 5 minutes, you:- ✓ Made HTTP requests to Portal
- ✓ Queried arbitrary block ranges
- ✓ Filtered smart contract events
- ✓ Processed newline-delimited JSON responses
Rate Limits
The Public Portal is rate-limited:- 20 requests per 10 seconds
- Perfect for development and testing
Cloud Portal
Production-ready managed access with higher limits
Self-Host Portal
Run your own Portal instance with no rate limits
Next Steps
API Reference
Complete reference with all fields and filters
View Examples
Practical examples for common use cases
Use with SDK
Build type-safe indexers with Portal as the data source
Popular Examples
Query Event Logs
Track smart contract events
Query Transactions
Monitor wallet activity
Track NFT Transfers
Index NFT collection activity
Index DEX Swaps
Build DEX analytics
