# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://clash.gitbook.io/doc/restful-api/common.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
