# net_listening - Celo

> Example code for the net_listening JSON-RPC method. Complete guide on how to use net_listening JSON-RPC in GetBlock Web3 documentation.

This method returns `true` if the client is actively listening for network connections on the Celo network.

## Parameters

* None

## Request Example

#### cURL

#### curl

```bash
curl -X POST https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/ \
-H "Content-Type: application/json" \
-d '{
  "jsonrpc": "2.0",
  "id": "getblock.io",
  "method": "net_listening",
  "params": []
}'
```

#### JavaScript (Axios)

#### index.js

```javascript
const axios = require('axios');

const url = 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/';

const payload = {
  jsonrpc: '2.0',
  id: 'getblock.io',
  method: 'net_listening',
  params: []
};

axios.post(url, payload, {
  headers: { 'Content-Type': 'application/json' }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));
```

#### Python

#### example.py

```python
import requests
import json

url = "https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/"

payload = {
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "method": "net_listening",
    "params": []
}

response = requests.post(url, headers={"Content-Type": "application/json"}, json=payload)
print(response.json())
```

## Response Example

```json
{
  "jsonrpc": "2.0",
  "id": "getblock.io",
  "result": true
}
```

## Response Definition

| Field | Type | Description |
| --- | --- | --- |
| result | boolean | `true` if listening |

## Use Cases

* Check node connectivity
* Health monitoring
* Network diagnostics

## Error Handling

| Error Code | Description |
| --- | --- |
| -32603 | Internal error |
