> For the complete documentation index, see [llms.txt](https://sheita.gitbook.io/sysmonitoring/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sheita.gitbook.io/sysmonitoring/api/ping.md).

# /ping

#### `/api/ping`

### Overview

The `/api/ping` endpoint returns the current network latency (ping) in the form of a JSON response.

### Endpoint

```bash
GET /api/ping
```

### Example

```js
fetch('/api/ping')
  .then(response => response.json())
  .then(data => {
    console.log(`Ping: ${data.ping}ms`);
  });
```

### Response

The response will return a JSON object containing the `ping` value:

```json
{
  "ping": 25
}
```

### Description

* **`/api/ping`** provides the current network latency (ping) in milliseconds (ms).
* It uses the `getPing()` function internally to fetch the data.
* The result is returned as an integer representing the network latency in milliseconds.
