Subscription API Overview
Getting Started
The primary way to use the Subscription API or WebSockets is through standard JSON-RPC methods. See the Using JSON-RPC Requests section below to get started.
Subscription API Endpoints
For a full list of Subscription API endpoints and supported chains see the Subscription API Endpoints doc. Below are the subscription endpoints available and the corresponding docs for each of them.
Note: alchemy_minedTransactions and alchemy_pendingTransactions are only
supported on the following: Ethereum, Arbitrum, Polygon and Optimism.
What are WebSockets and how do they differ from HTTP?
WebSockets is a bidirectional communication protocol that maintains a network connection between a server and a client. Unlike HTTP, with WebSockets clients don’t need to continuously make requests when they want information.
Instead, an open WebSocket connection can push network updates to clients by allowing them to subscribe to certain network states, such as new transactions or blocks being added to the blockchain.
Using JSON-RPC Requests to Access WebSockets
The eth_subscribe and eth_unsubscribe JSON-RPC methods allow you to access WebSockets.
To begin, open a WebSocket using the WebSocket URL for your app. You can find your app’s WebSocket URL by opening the app’s page in your dashboard and clicking “View Key”.
Note that your app’s URL for WebSockets is different from its URL for HTTP requests, but both can be found in the app’s “Network” tab.

Next, install a command line tool for making WebSocket requests such as wscat. Using wscat, you can send requests as follows:
Don’t Use HTTP Methods Over WebSockets!
Though it’s currently possible to send all your HTTP requests over Websockets, we discourage our developers from doing so. Instead, you should only send eth_subscribe and eth_unsubscribe requests to WebSockets.
This is for several reasons:
- You won’t receive HTTP status codes in WebSockets responses, which can be useful and actionable.
 - Because individual HTTP requests are load-balanced in our infrastructure to the fastest possible server, you’ll add additional latency by sending JSON-RPC requests over WebSockets.
 - WebSockets client-side handling has many tricky edge cases and silent failure modes, which can make your dApp less stable.
 
WebSocket Limits
The following limits apply for WebSocket connections:
- There is a limit of 100 WebSocket connections for the FREE tier and 2,000 WebSocket connections for all other tiers, with a maximum of 50,000 connections per instance.
 - No limits on the number of parallel WebSocket subscriptions per WebSocket connection.
 - The maximum size of a JSON-RPC 
batchrequest that can be sent over a WebSocket connection is 1000