Uptimes

Request

This endpoint returns the uptime in milliseconds for one or more partner nodes (partner_node_id[]) across a specified time window.

Endpoint

GET /api/v1/uptimes

URL:

https://stats.api.datagram.network/api/v1/uptimes

Query Parameters

Field
Type
Required
Description
Example

secret

string

✅ Yes

Unique secret token identifying partner.

"pt_sec_abc123XYZ!*"

partner_node_id[]

string[]

✅ Yes

Retrieve uptime for multiple partner node IDs (up to 5 maximum at a time.

["node_123", "node_456"]

started_at

integer

❌ No

Start time in Unix timestamp (milliseconds).

1678901234567

ended_at

integer

❌ No

End time in Unix timestamp (milliseconds).

1678912345678

- If started_at or ended_at are not provided, the API will return the total uptime of the specified partner_node_id. - The maximum allowed time range between started_at and ended_at is 14 days (1209600000 ms). - All timestamps will be rounded down to the nearest hour.

Example: 1752727252516 (2025-07-17T04:40:52.516Z) will be rounded down to 1752724800000 (2025-07-17T04:00:00Z).

Authentication

Use a valid organization token in the request header:

Authorization: Bearer <organization-token>

Example Request

GET /api/v1/uptimes&partner_node_id[]=dg-node-1&partner_node_id[]=dg-node-2&started_at=1741251728393&ended_at=1741252994872 HTTP/1.1
Host: stats.api.datagram.network
Authorization: <organization token>print(response.json())

Responses

The request was successful and uptime data was retrieved for the specified partner nodes.

Response Body

Field
Type
Description
Example

uptime

integer

Total uptime in Unix timestamp (ms).

86400000

partner_node_id

string

Retrieve uptime for a single partner node ID.

"partner_12345"

Example Response

{
  "data": [
    {
      "uptime": 1888888,
      "partner_node_id": "partner_12345"
    },
      {
      "uptime": 1999999,
      "partner_node_id": "partner_67890"
    }
  ]
}

Last updated