Skip to main content
GET
/
net_info
net_info
curl --request GET \
  --url https://rpc.cosmos.directory/cosmoshub/net_info
import requests

url = "https://rpc.cosmos.directory/cosmoshub/net_info"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://rpc.cosmos.directory/cosmoshub/net_info', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://rpc.cosmos.directory/cosmoshub/net_info",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

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

func main() {

	url := "https://rpc.cosmos.directory/cosmoshub/net_info"

	req, _ := http.NewRequest("GET", url, nil)

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

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

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://rpc.cosmos.directory/cosmoshub/net_info")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://rpc.cosmos.directory/cosmoshub/net_info")

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

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
{
  "id": 0,
  "jsonrpc": "2.0",
  "result": {
    "listening": true,
    "listeners": [
      "Listener(@)"
    ],
    "n_peers": "1",
    "peers": [
      {
        "node_info": {
          "protocol_version": {
            "p2p": "7",
            "block": "10",
            "app": "0"
          },
          "id": "5576458aef205977e18fd50b274e9b5d9014525a",
          "listen_addr": "tcp:0.0.0.0:26656",
          "network": "cosmoshub-2",
          "version": "0.32.1",
          "channels": "4020212223303800",
          "moniker": "moniker-node",
          "other": {
            "tx_index": "on",
            "rpc_address": "tcp:0.0.0.0:26657"
          }
        },
        "is_outbound": true,
        "connection_status": {
          "Duration": "168901057956119",
          "SendMonitor": {
            "Active": true,
            "Start": "2019-07-31T14:31:28.66Z",
            "Duration": "168901060000000",
            "Idle": "168901040000000",
            "Bytes": "5",
            "Samples": "1",
            "InstRate": "0",
            "CurRate": "0",
            "AvgRate": "0",
            "PeakRate": "0",
            "BytesRem": "0",
            "TimeRem": "0",
            "Progress": 0
          },
          "RecvMonitor": {
            "Active": true,
            "Start": "2019-07-31T14:31:28.66Z",
            "Duration": "168901060000000",
            "Idle": "168901040000000",
            "Bytes": "5",
            "Samples": "1",
            "InstRate": "0",
            "CurRate": "0",
            "AvgRate": "0",
            "PeakRate": "0",
            "BytesRem": "0",
            "TimeRem": "0",
            "Progress": 0
          },
          "Channels": [
            {
              "ID": 48,
              "SendQueueCapacity": "1",
              "SendQueueSize": "0",
              "Priority": "5",
              "RecentlySent": "0"
            }
          ]
        },
        "remote_ip": "95.179.155.35"
      }
    ]
  }
}
{
  "id": 0,
  "jsonrpc": "2.0",
  "error": "Description of failure"
}

Response

empty answer

NetInfo Response

id
integer
Example:

0

jsonrpc
string
Example:

"2.0"

result
object