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

# Analysis

## 실시간 검색어 반환

<mark style="color:blue;">`GET`</mark> `https://soojle.io/get_search_realtime`

실시간 검색어 순위를 반환한다.

{% tabs %}
{% tab title="200 " %}

```javascript
1. 성공
{
    result = "success",
    search_realtime = <list>
        [
            <list>
            [
                "검색어", "빈도수"
            ]
        ]
}
```

{% endtab %}
{% endtabs %}

## 시간별 사용자 접근 log 반환

<mark style="color:blue;">`GET`</mark> `https://soojle.io/get_log_date/<int:months>/<int:days>/<int:hours>/<int:limit>`

각 Path Parameter에는 limit을 동반하여 한개만 사용 가능합니다.\
예시) get\_log\_date/4/0/0/100 = 최근 4개월 간의 기록을 100개 가져온다.\
예시) get\_log\_date/0/3/0/100 = 최근 3일 간의 기록을 100개 가져온다.

#### Path Parameters

| Name   | Type   | Description  |
| ------ | ------ | ------------ |
| months | string | 달 (최대 6개월)   |
| days   | string | 일 (최대 7일)    |
| hours  | string | 시간 (최대 24시간) |
| limit  | string | 최대 X개 반환     |

#### Headers

| Name          | Type   | Description          |
| ------------- | ------ | -------------------- |
| Authorization | string | "Bearer " + \<Token> |

{% tabs %}
{% tab title="200 " %}

```javascript
1. 성공
{
    result = "success",
    log = <json_list>
        {
            user_id:<string>
        }
}
```

{% endtab %}
{% endtabs %}

## 특정 사용자 Log 반환

<mark style="color:blue;">`GET`</mark> `https://soojle.io/get_log_user/<string:user_id>/<int:limit>`

#### Path Parameters

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| user\_id | string | 사용자 id      |
| limit    | string | 최대 X개 반환    |

#### Headers

| Name          | Type   | Description          |
| ------------- | ------ | -------------------- |
| Authorization | string | "Bearer " + \<token> |

{% tabs %}
{% tab title="200 " %}

```javascript
1. 성공
{
    result = "success",
    log = <json_list>
        {
            user_id:<string>
        }
}
```

{% endtab %}
{% endtabs %}

## 특정 사용자 + 시간별 Log 반환

<mark style="color:blue;">`GET`</mark> `https://soojle.io/get_log_user_date/<string:user_id>/<int:months>/<int:days>/<int:hours>/<int:limit>`

#### Path Parameters

| Name     | Type   | Description  |
| -------- | ------ | ------------ |
| user\_id | string | 사용자 id       |
| months   | string | 달 (최대 6개월)   |
| days     | string | 일 (최대 7일)    |
| hours    | string | 시간 (최대 24시간) |
| limit    | string | 최대 X개 반환     |

#### Headers

| Name          | Type   | Description          |
| ------------- | ------ | -------------------- |
| Authorization | string | "Bearer " + \<token> |

{% tabs %}
{% tab title="200 " %}

```javascript
1. 성공
{
    result = "success",
    log = <json_list>
        {
            user_id:<string>
        }
}
```

{% endtab %}
{% endtabs %}

## 유사한 단어 추출

<mark style="color:green;">`POST`</mark> `https://soojle.io/get_similarity_words`

연관 검색어 용도

#### Request Body

| Name   | Type   | Description |
| ------ | ------ | ----------- |
| search | string | 검색어         |

{% tabs %}
{% tab title="200 " %}

```javascript
1. 성공
{
    result = "success",
    similarity_word = <json_list>
        {
            word: <list> - key값: 검색어의 Token
            [
                "XXXX": 0.XXXX - key: 단어, value: 유사도
            ]
        }
}
```

{% endtab %}
{% endtabs %}

## 통계 통합 반환

<mark style="color:blue;">`GET`</mark> `https://soojle.io/get_analysis`

{% tabs %}
{% tab title="200 " %}

```javascript
1. 성공
{
    result = "success",
    analysis = <json>
        {
            day_avg_visitor: <int> //하루 평균 방문자
            highest_day_visitor: <int> //하루 최고 방문자
            posts_count: <int> //DB POSTS 총 개수
            search_count: <int> //검색 총 개수
            communication_avg: <int> //총 소통 횟수
            today_visitor: <int> //하루 방문자 수
            total_fav: <int> //총 좋아요 수
            total_view: <int> //총 조회수
            total_visitor: <int> //총 방문자 수
        }
}
```

{% endtab %}
{% endtabs %}

## 날짜별 통계 반환(X일 전 버전)

<mark style="color:blue;">`GET`</mark> `https://soojle.io/get_everyday_analysis_days_ago/<int:days>`

#### Path Parameters

| Name | Type   | Description     |
| ---- | ------ | --------------- |
| days | number | 몇일 전 날짜의 통계를 입력 |

{% tabs %}
{% tab title="200 해당 날짜의 통계들입니다." %}

```javascript
1. 성공
{
    result = "success",
    analysis = <json_list>
        {
            today_visitor: <int> //방문자 수
            today_time_visitor: <array>
            [
                 {
                     time: <int> //00 ~ 23
                     visitor: <int> //방문자 수
                 }   
            ]
            today_view: <int> //이날 포스트들의 조회수
            today_fav: <int< //이날 좋아요 된 수
            today_student_visitor: <array>
            [
                {
                    student_num: <string> //학번
                    count: <int> //방문자 수
                }
            ]
            //당일별 groupby인지라 방문한 학번들만 반환됨.
            //+비로그인자는 guest 로 표시됨.
        }
}
```

{% endtab %}
{% endtabs %}

## 날짜별 통계 반환(특정 날짜 반환형)

<mark style="color:blue;">`GET`</mark> `https://soojle.io/get_everyday_analysis_specific_days/<int:year>/<int:month>/<int:day>`

#### Path Parameters

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| year  | number | 년           |
| month | number | 월           |
| day   | number | 일           |

{% tabs %}
{% tab title="200 해당 날짜의 통계들입니다." %}

```javascript
1. 성공
{
    result = "success",
    analysis = <json>
        {
            today_visitor: <int> //방문자 수
            today_time_visitor: <array>
            [
                 {
                     time: <int> //00 ~ 23
                     visitor: <int> //방문자 수
                 }   
            ]
            today_view: <int> //이날 포스트들의 조회수
            today_fav: <int< //이날 좋아요 된 수
            today_student_visitor: <array>
            [
                {
                    student_num: <string> //학번
                    count: <int> //방문자 수
                }
            ]
            //당일별 groupby인지라 방문한 학번들만 반환됨.
            //+비로그인자는 guest 로 표시됨.
        }
}
```

{% endtab %}
{% endtabs %}

## 디바이스 입력

<mark style="color:blue;">`GET`</mark> `https://soojle.io/insert_device/<string:device>`

#### Path Parameters

| Name   | Type   | Description                                                              |
| ------ | ------ | ------------------------------------------------------------------------ |
| device | number | <p>device\_pc<br>device\_mobile<br>device\_tablet<br>이 셋중 하나를 입력해야함.</p> |

{% tabs %}
{% tab title="200 " %}

```javascript
1. 성공
{
    result = "success"
}
```

{% endtab %}
{% endtabs %}

## 디바이스 통계 반환

<mark style="color:blue;">`GET`</mark> `https://soojle.io/get_device`

{% tabs %}
{% tab title="200 " %}

```javascript
1. 성공
{
    result = "success"
    pc = <int>
    tablet = <int>
    mobile = <int>
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://soojle.gitbook.io/project/backend-api/api/analysis.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.
