# Current

&#x20;Virtual Host, Application, Stream에 대한 통계를 제공합니다.

## Get Virtual Host 통계

> **Request**

<details>

<summary><mark style="color:blue;">GET</mark> /v2/stats/current/vhosts/{vhost}</summary>

**Header**

```http
Authorization: Basic {credentials}

# Authorization
    Credentials for HTTP Basic Authentication created with <AccessToken>
```

</details>

> **Responses**

<details>

<summary><mark style="color:blue;">200</mark> Ok</summary>

The request has succeeded

**Header**

```
Content-Type: application/json
```

**Body**

```json
{
    "message": "OK",
    "response": {
        "createdTime": "2025-06-17T18:31:31.787+09:00",
        "lastUpdatedTime": "2025-06-17T18:31:31.787+09:00",
        "providers": {
            "avgThroughputIn": 0,
            "connections": {
                "file": 0,
                "mpegts": 0,
                "multiplex": 0,
                "ovt": 0,
                "rtmp": 0,
                "rtsp": 0,
                "rtsppull": 0,
                "scheduled": 0,
                "srt": 0,
                "webrtc": 0
            },
            "lastRecvTime": "2025-06-17T18:31:31.787+09:00",
            "lastThroughputIn": 0,
            "maxThroughputIn": 0,
            "totalBytesIn": 0
        },
        "publishers": {
            "avgThroughputOut": 0,
            "connections": {
                "file": 0,
                "hlsv3": 0,
                "llhls": 0,
                "ovt": 0,
                "push": 0,
                "srt": 0,
                "thumbnail": 0,
                "webrtc": 0
            },
            "lastSentTime": "2025-06-17T18:31:31.787+09:00",
            "lastThroughputOut": 0,
            "maxThroughputOut": 0,
            "maxTotalConnectionTime": "2025-06-17T18:31:31.787+09:00",
            "maxTotalConnections": 0,
            "totalBytesOut": 0,
            "totalConnections": 0
        }
    },
    "statusCode": 200
}
```

</details>

<details>

<summary><mark style="color:red;">401</mark> Unauthorized</summary>

Authentication required

**Header**

```http
WWW-Authenticate: Basic realm=”OvenMediaEngine”
```

**Body**

```json
{
    "message": "[HTTP] Authorization header is required to call API (401)",
    "statusCode": 401
}
```

</details>

<details>

<summary><mark style="color:red;">404</mark> Not Found</summary>

The given vhost name could not be found.

**Body**

```json
{
    "message": "[HTTP] Could not find the virtual host: [default1] (404)",
    "statusCode": 404
}
```

</details>

## Get Application 통계

> **Request**

<details>

<summary><mark style="color:blue;">GET</mark> /v2/stats/current/vhosts/{vhost}/apps/{app}</summary>

**Header**

```http
Authorization: Basic {credentials}

# Authorization
    Credentials for HTTP Basic Authentication created with <AccessToken>
```

</details>

> **Responses**

<details>

<summary><mark style="color:blue;">200</mark> Ok</summary>

The request has succeeded

**Header**

```
Content-Type: application/json
```

**Body**

```json
{
    "message": "OK",
    "response": {
        "createdTime": "2025-06-17T18:31:31.788+09:00",
        "lastUpdatedTime": "2025-06-17T18:31:31.788+09:00",
        "providers": {
            "avgThroughputIn": 0,
            "connections": {
                "file": 0,
                "mpegts": 0,
                "multiplex": 0,
                "ovt": 0,
                "rtmp": 0,
                "rtsp": 0,
                "rtsppull": 0,
                "scheduled": 0,
                "srt": 0,
                "webrtc": 0
            },
            "lastRecvTime": "2025-06-17T18:31:31.788+09:00",
            "lastThroughputIn": 0,
            "maxThroughputIn": 0,
            "totalBytesIn": 0
        },
        "publishers": {
            "avgThroughputOut": 0,
            "connections": {
                "file": 0,
                "hlsv3": 0,
                "llhls": 0,
                "ovt": 0,
                "push": 0,
                "srt": 0,
                "thumbnail": 0,
                "webrtc": 0
            },
            "lastSentTime": "2025-06-17T18:31:31.788+09:00",
            "lastThroughputOut": 0,
            "maxThroughputOut": 0,
            "maxTotalConnectionTime": "2025-06-17T18:31:31.788+09:00",
            "maxTotalConnections": 0,
            "totalBytesOut": 0,
            "totalConnections": 0
        }
    },
    "statusCode": 200
}
```

</details>

<details>

<summary><mark style="color:red;">401</mark> Unauthorized</summary>

Authentication required

**Header**

```http
WWW-Authenticate: Basic realm=”OvenMediaEngine”
```

**Body**

```json
{
    "message": "[HTTP] Authorization header is required to call API (401)",
    "statusCode": 401
}
```

</details>

<details>

<summary><mark style="color:red;">404</mark> Not Found</summary>

The given vhost or application name could not be found.

**Body**

```json
{
    "message": "[HTTP] Could not find the application: [default/app1] (404)",
    "statusCode": 404
}
```

</details>

## Get Stream 통계

> **Request**

<details>

<summary><mark style="color:blue;">GET</mark> /v2/stats/current/vhosts/{vhost}/apps/{app}/streams/{stream}</summary>

**Header**

```http
Authorization: Basic {credentials}

# Authorization
    Credentials for HTTP Basic Authentication created with <AccessToken>
```

</details>

> **Responses**

<details>

<summary><mark style="color:blue;">200</mark> Ok</summary>

The request has succeeded

**Header**

```
Content-Type: application/json
```

**Body**

```json
{
    "message": "OK",
    "response": {
        "createdTime": "2025-06-17T18:33:21.697+09:00",
        "lastUpdatedTime": "2025-06-17T18:33:24.459+09:00",
        "providers": {
            "avgThroughputIn": 2664424,
            "connections": {
                "file": 0,
                "mpegts": 0,
                "multiplex": 0,
                "ovt": 0,
                "rtmp": 0,
                "rtsp": 0,
                "rtsppull": 0,
                "scheduled": 0,
                "srt": 0,
                "webrtc": 1
            },
            "lastRecvTime": "2025-06-17T18:33:24.459+09:00",
            "lastThroughputIn": 333053,
            "maxThroughputIn": 2664424,
            "totalBytesIn": 855296
        },
        "publishers": {
            "avgThroughputOut": 0,
            "connections": {
                "file": 0,
                "hlsv3": 0,
                "llhls": 0,
                "ovt": 0,
                "push": 0,
                "srt": 0,
                "thumbnail": 0,
                "webrtc": 0
            },
            "lastSentTime": "2025-06-17T18:33:21.697+09:00",
            "lastThroughputOut": 0,
            "maxThroughputOut": 0,
            "maxTotalConnectionTime": "2025-06-17T18:33:21.697+09:00",
            "maxTotalConnections": 0,
            "totalBytesOut": 0,
            "totalConnections": 0
        }
    },
    "statusCode": 200
}
```

</details>

<details>

<summary><mark style="color:red;">401</mark> Unauthorized</summary>

Authentication required

**Header**

```http
WWW-Authenticate: Basic realm=”OvenMediaEngine”
```

**Body**

```json
{
    "message": "[HTTP] Authorization header is required to call API (401)",
    "statusCode": 401
}
```

</details>

<details>

<summary><mark style="color:red;">404</mark> Not Found</summary>

The given vhost or application or stream name could not be found.

**Body**

```json
{
    "message": "[HTTP] Could not find the stream: [default/#default#app/stream] (404)",
    "statusCode": 404
}
```

</details>
