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

# Common

## &#x20;获得当前的流量

<mark style="color:blue;">`GET`</mark> `/traffic`

获得实时的上下行 (Byte)

{% tabs %}
{% tab title="200
返回一个 Chunk Stream，每秒推送一个 JSON，up 为上行 down 为下行
" %}

```javascript
{
    "up": 200,
    "down": 300
}
```

{% endtab %}
{% endtabs %}

## &#x20;获得实时日志

<mark style="color:blue;">`GET`</mark> `/logs`

获得一个实时的日志流

#### Query Parameters

| Name  | Type   | Description                              |
| ----- | ------ | ---------------------------------------- |
| level | string | 日志等级 (error \| warning \| info \| debug) |

{% tabs %}
{% tab title="200
type 有四种：info | warning | error | debug
" %}

```javascript
{
    "type": "info",
    "payload": "google.com match GEOIP using DIRECT"
}
```

{% endtab %}
{% endtabs %}
