GetPeers
Retrieves a list of known peers with optional filtering.
Request
GET /nxt?requestType=getPeers
All endpoints use port 22024 by default.
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
active | boolean | Only return active (non-NON_CONNECTED) peers (default: false) | No |
state | string | Filter by peer state: CONNECTED, NON_CONNECTED, DISCONNECTED, CONNECTING | No |
service | string | Filter by service (repeatable: BLOCKS, TRANSACTIONS, etc.) | No |
includePeerInfo | boolean | Include full peer info objects instead of just host strings (default: false) | No |
version | string | Filter by version prefix | No |
includeNewer | boolean | Include newer versions than specified (default: false) | No |
connect | boolean | Attempt to connect to all returned peers (default: false) | No |
adminPassword | string | Admin password (required if connect=true) | No |
Response
{
"peers": [
{
"address": "192.168.1.100",
"port": 22025,
"state": 1,
"announcedAddress": "192.168.1.100:22025",
"shareAddress": true,
"downloadedVolume": 1024000,
"uploadedVolume": 512000,
"application": "Shamwari",
"version": "1.0.0",
"platform": "Linux",
"apiPort": 22024,
"apiSSLPort": 0,
"blacklisted": false,
"lastUpdated": 1700000000,
"lastConnectAttempt": 1700000000,
"inbound": false,
"services": ["BLOCKS", "TRANSACTIONS"],
"blockchainState": "UP_TO_DATE"
}
],
"errorCode": 0,
"errorDescription": ""
}
Example
curl "http://localhost:22024/nxt?requestType=getPeers&active=true&includePeerInfo=true&service=BLOCKS"