> For a complete page index, fetch https://docs.conduit.xyz/llms.txt

# eth_subscribe

POST https://rpc.plume.org/YOUR_API_KEY
Content-Type: application/json

WebSocket required: eth\_subscribe is only available over a persistent WebSocket connection (wss\://). Starting **August 4, 2026 at 12:00 PM PST**, WebSocket connections require an authenticated Conduit account — append an API key to your WSS URL; anonymous connections are rejected. It cannot be used over HTTP and will fail against any HTTP endpoint. Use your Conduit WebSocket URL (wss\://rpc-\{chainSlug}.t.conduit.xyz/\{apiKey}) with a WebSocket client such as websockets in Python, the native WebSocket in JavaScript, or gorilla/websocket in Go.

Creates a subscription for real-time events. Supported subscription types include newHeads, logs, newPendingTransactions, and syncing.

⚡ Compute Units: [10 CU](https://docs.conduit.xyz/rpc-nodes/information/compute-units)

Reference: https://docs.conduit.xyz/rpc-nodes/json-rpc-reference/eth-subscribe

## Request

### Body (application/json)

This endpoint expects an object.

- `subscriptionType` (enum, required) — Type of subscription
  - Allowed values: `newHeads`, `logs`, `newPendingTransactions`, `syncing`
- `options` (eth_subscribe_Param_options, optional) — Per-subscription-type options. Shape depends on `subscriptionType`: * `newHeads`: no options accepted. * `logs`: optional filter object `{address?, topics?}` mirroring the `Filter` shape minus `blockHash`/`fromBlock`/`toBlock`. `address` is a single address or array; `topics` is the positional array with single/array/null per position. * `newPendingTransactions`: optional boolean. When `true`, the notification payload includes the full transaction object instead of just the transaction hash. * `syncing`: no options accepted.

## Response

### 200

Opaque subscription ID returned by the server. Pass this to `eth_unsubscribe` to cancel the subscription. Not a numeric quantity — treat as an opaque hex string.

- `string`

## Types

### eth_subscribe_Param_options

### logs options

- `address` (EthSubscribeParamOptionsOneOf0Address, optional)
- `topics` (list of EthSubscribeParamOptionsOneOf0TopicsItems, optional)

### EthSubscribeParamOptionsOneOf0Address

### EthSubscribeParamOptionsOneOf0TopicsItems

## Examples

**Request**

```json
[
  "newHeads"
]
```

**Response**

```json
{
  "id": "1",
  "jsonrpc": "2.0",
  "result": "0x9cef478923ff08bf67fde6c64013158d"
}
```

**SDK Code**

```python
import requests

url = "https://rpc.plume.org/YOUR_API_KEY"

payload = ["newHeads"]
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://rpc.plume.org/YOUR_API_KEY';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '["newHeads"]'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://rpc.plume.org/YOUR_API_KEY"

	payload := strings.NewReader("[\n  \"newHeads\"\n]")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://rpc.plume.org/YOUR_API_KEY")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "[\n  \"newHeads\"\n]"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://rpc.plume.org/YOUR_API_KEY")
  .header("Content-Type", "application/json")
  .body("[\n  \"newHeads\"\n]")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://rpc.plume.org/YOUR_API_KEY', [
  'body' => '[
  "newHeads"
]',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://rpc.plume.org/YOUR_API_KEY");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "[\n  \"newHeads\"\n]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["newHeads"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://rpc.plume.org/YOUR_API_KEY")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```