WebSocket RPC

Starknet WebSocket RPC

Stream Starknet data in real time over a WebSocket connection instead of polling. Every SwiftNodes plan includes a Starknet WebSocket endpoint alongside HTTP, with flat-rate pricing and no KYC.

Endpoint

wss://rpc.swiftnodes.io/ws/starknet?key=YOUR_API_KEY

The HTTP endpoint for Starknet is https://rpc.swiftnodes.io/rpc/starknet?key=YOUR_API_KEY. One API key works for both, and across all 75+ supported chains.

Subscribe to Starknet in real time

const ws = new WebSocket("wss://rpc.swiftnodes.io/ws/starknet?key=YOUR_API_KEY");

ws.onopen = () => ws.send(JSON.stringify({
  jsonrpc: "2.0", id: 1, method: "starknet_subscribeNewHeads", params: {},
}));

ws.onmessage = (msg) => {
  const j = JSON.parse(msg.data);
  if (j.method) console.log("new Starknet block", j.params.result.block_number);
};

What you can subscribe to

  • New block headers (starknet_subscribeNewHeads): the subscription our checks open on this chain

Free keys get one WebSocket connection with new-block subscriptions only. Every other subscription listed here needs a paid plan, which also raises the connection limit.

Starknet is a Layer 2 (STARK validity rollup on Ethereum), with ~Variable block production; not a fixed EVM-style interval block times and soft confirmation on starknet within seconds to minutes; hard finality once the stark proof is verified on ethereum l1 finality. That cadence sets how frequently new-block subscriptions fire.

Frequently asked questions

Does SwiftNodes support Starknet WebSocket?

Yes. Every Starknet plan includes a WebSocket (wss://) endpoint alongside HTTP, with no separate add-on. Connect to wss://rpc.swiftnodes.io/ws/starknet?key=<key> and open subscriptions immediately.

What is the Starknet WebSocket URL?

wss://rpc.swiftnodes.io/ws/starknet?key=YOUR_API_KEY — replace YOUR_API_KEY with the key from your dashboard. The matching HTTP endpoint is https://rpc.swiftnodes.io/rpc/starknet?key=YOUR_API_KEY.

Is there a message rate limit on the WebSocket?

Yes — WebSocket throughput scales with your plan (1 msg/s on Free up to 250 msg/s on Pro), with concurrent-connection limits per plan. The free plan allows one connection with new-block subscriptions only; log and pending-transaction subscriptions need a paid plan. Within those limits, subscriptions stream in real time.

See the full Starknet RPC page for chain details, or the WebSocket docs for the complete method list.

Get a Starknet endpoint free

HTTP + WebSocket, flat-rate, pay with crypto or card, no KYC. Live in 30 seconds.

Get your API key