Server-Sent Events stream for NEAR blocks. Free hosted service with automatic catch-up, resume support, and finality guarantees.
curl -N https://live.near.tools
const eventSource = new EventSource("https://live.near.tools")
eventSource.addEventListener("block", (event) => {
const block = JSON.parse(event.data)
console.log("Block", event.lastEventId, block)
})
eventSource.addEventListener("ping", (event) => {
console.log("Keep-alive ping")
})
curl -N "https://live.near.tools?from_height=170727400"
Server-Sent Events endpoint for live NEAR block data as blocks are finalized.
Resume from any block height with built-in ring buffer for fast catch-up.
Only streams finalized blocks, ensuring data consistency and reliability.
Efficiently handles multiple new blocks per poll with smart batching.
Built for reliability with exponential backoff, retries, and structured logging.
Open source and easy to deploy with Docker or build from source.
GET /
Server-Sent Events endpoint for real-time block streaming.
from_height
(optional) -
Resume stream from block height (exclusive)
event: block
id: 170727400
data: {"block_height":170727400,"block_hash":"...","prev_block_hash":"...",...}
event: block
id: 170727401
data: {"block_height":170727401,...}
GET /healthz
Health check endpoint. Returns "ok" as JSON.
docker pull ghcr.io/r-near/near-stream:latest
docker run -d \
-p 8080:8080 \
-e RUST_LOG=info \
ghcr.io/r-near/near-stream:latest
cargo build --release
RUST_LOG=info cargo run --release