본문으로 건너뛰기

Create a Stream – Streams REST API

업데이트됨:
Jul 31, 2026

개요

Creates a new stream with a specified blockchain network, dataset type, destination, and optional filter function. Use this endpoint to programmatically set up real-time or historical blockchain data pipelines.

Key capabilities:

  • Start from a specific block (backfills) or latest block (real-time streaming)
  • Choose destination: webhook, S3, Azure Blob Storage, or PostgreSQL
  • Attach a base64-encoded JavaScript filter to transform data before delivery
  • Configure batch sizes, reorg detection, distance-from-tip, and elastic batching
  • Set up multi-destination delivery with extra_destinations
  • Receive email alerts on stream termination

Endpoint

Send a POST request to the following URL with your stream configuration in the request body.

POST https://api.quicknode.com/streams/rest/v1/streams

Request Parameters

매개변수유형Required설명
이름문자열A name for your stream
네트워크문자열Blockchain network (see Supported Chains)
dataset문자열Dataset type (see Data Sources)
region문자열usa_east
dataset_batch_size정수Number of blocks to batch per delivery
elastic_batch_enabled부울Auto-adjust batch size to 1 near chain tip
destination문자열webhook, s3, azure, or postgres
destination_attributes객체Configuration for selected destination
상태문자열active or paused
filter_function문자열아니요Base64-encoded JavaScript filter function
start_range정수아니요Starting block number (omit for latest)
end_range정수아니요Ending block number (omit for continuous)
fix_block_reorgs정수아니요1 to enable reorg detection and re-streaming
keep_distance_from_tip정수아니요Blocks to stay behind chain tip
알림 이메일문자열아니요Email for stream termination alerts
extra_destinations배열아니요Additional destinations (same structure as primary)

Destination Attributes

Configuration options vary based on the selected destination type. Select a tab below to view the required and optional attributes for each destination.

매개변수유형Required설명
url문자열Webhook endpoint URL
compression문자열none or gzip
max_retry정수Max retry attempts
retry_interval_sec정수Seconds between retries
post_timeout_sec정수Request timeout in seconds
headers객체아니요Custom headers as key-value pairs
mtls부울아니요Enable mutual TLS: Quicknode authenticates to your endpoint with its client certificate. Requires an HTTPS URL. See the Webhook destination page for server setup.
ssl_ca_pem문자열아니요CA certificate (PEM) used to verify your endpoint's server certificate when it is signed by a private CA instead of a public one

For mTLS server configuration and how to download the Quicknode CA certificate, see Mutual TLS on the Webhook destination page.

Example Request

curl -X POST "https://api.quicknode.com/streams/rest/v1/streams" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"name": "My Stream",
"network": "ethereum-mainnet",
"dataset": "block",
"filter_function": "ZnVuY3Rpb24gbWFpbihkYXRhKSB7Li4ufQ==",
"region": "usa_east",
"start_range": 100,
"end_range": 200,
"dataset_batch_size": 1,
"destination": "webhook",
"fix_block_reorgs": 0,
"keep_distance_from_tip": 0,
"elastic_batch_enabled": true,
"destination_attributes": {
"url": "https://webhook.site",
"compression": "none",
"headers": { "Authorization": "Bearer token" },
"max_retry": 3,
"retry_interval_sec": 1,
"post_timeout_sec": 10,
"mtls": true
},
"status": "active"
}'

답변

On success, the API returns the created stream object with a unique ID, timestamps, and all configured parameters.

{
"id": "f6ad6459-b5ad-4183-b370-1c1388e47e83",
"name": "My Stream",
"network": "ethereum-mainnet",
"dataset": "block",
"region": "usa_east",
"filter_function": "ZnVuY3Rpb24gbWFpbihkYXRhKSB7Li4ufQ==",
"start_range": 100,
"end_range": 200,
"dataset_batch_size": 1,
"elastic_batch_enabled": true,
"fix_block_reorgs": 0,
"keep_distance_from_tip": 0,
"destination": "webhook",
"destination_attributes": {
"url": "https://webhook.site",
"compression": "none",
"headers": { "Authorization": "Bearer token" },
"max_retry": 3,
"retry_interval_sec": 1,
"post_timeout_sec": 10,
"mtls": true,
"security_token": "qn_xxxxxxxxxxxxxx"
},
"status": "active",
"sequence": 0,
"current_hash": null,
"notification_email": null,
"extra_destinations": [],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}

응답 필드

분야유형설명
id문자열Unique stream identifier (UUID)
이름문자열Stream name
네트워크문자열Blockchain network
dataset문자열Dataset type
region문자열Deployment region
filter_function문자열Base64-encoded filter function (if configured)
start_range정수Starting block number
end_range정수Ending block number (null for continuous)
dataset_batch_size정수Number of blocks per batch
elastic_batch_enabled부울Whether elastic batching is enabled
fix_block_reorgs정수Reorg detection setting (1 = enabled)
keep_distance_from_tip정수Blocks to stay behind chain tip
destination문자열Destination type (webhook, s3, azure, postgres)
destination_attributes객체Destination configuration (varies by type)
상태문자열Stream status (active or paused)
순서정수Last delivered block from the data range
current_hash문자열Hash of the current block being processed
알림 이메일문자열Email for stream termination alerts
extra_destinations배열Additional destinations (if configured)
created_at문자열Stream creation timestamp (ISO 8601)
업데이트 일시문자열Last update timestamp (ISO 8601)

Response Destination Attributes

destination_attributes object in the response varies based on the destination type. Select a tab below to view the fields returned for each destination.

분야유형설명
url문자열Webhook endpoint URL
compression문자열Compression type (none or gzip)
headers객체Custom headers (if configured)
max_retry정수Maximum retry attempts
retry_interval_sec정수Seconds between retries
post_timeout_sec정수Request timeout in seconds
security_token문자열Auto-generated token for validating webhook authenticity
note

Sensitive fields like secret_key (S3), sas_token (Azure), and password (PostgreSQL) are not returned in the response for security reasons.