# 시세 캔들 조회 (Weeks)

<mark style="color:blue;">`GET`</mark> `https://{dashboard-domain}/v1.0/db/coin/candle/weeks`

#### Query Parameters

| Name                                           | Type   | Description                                                                                       |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------- |
| coin\_symbol<mark style="color:red;">\*</mark> | string | 코인 심볼 (ex. BTC-ONIT)                                                                              |
| count<mark style="color:red;">\*</mark>        | string | 캔들 개수(최대 200개까지 요청 가능)                                                                            |
| to<mark style="color:red;">\*</mark>           | string | 마지막 캔들 시각 (exclusive). 포맷 : `yyyy-MM-dd'T'HH:mm:ss'Z'` or `yyyy-MM-dd HH:mm:ss`. 비워서 요청시 가장 최근 캔들 |

{% tabs %}
{% tab title="200: OK 성공" %}

```javascript
{
    "return": 0,
    "message": "success",
    "value": [
        {
            "market": "BTC-ONIT",
            "candle_date_time_utc": "2022-01-10T00:00:00",
            "candle_date_time_kst": "2022-01-10T09:00:00",
            "opening_price": 0.00000629,
            "high_price": 0.00000715,
            "low_price": 0.00000588,
            "trade_price": 0.00000642,
            "timestamp": 1642043056349,
            "candle_acc_trade_price": 1287.39480992,
            "candle_acc_trade_volume": 198850493.09747958,
            "first_day_of_period": "2022-01-10"
        },
        {
            "market": "BTC-ONIT",
            "candle_date_time_utc": "2022-01-03T00:00:00",
            "candle_date_time_kst": "2022-01-03T09:00:00",
            "opening_price": 0.00000473,
            "high_price": 0.00000646,
            "low_price": 0.00000451,
            "trade_price": 0.00000629,
            "timestamp": 1641772771963,
            "candle_acc_trade_price": 1580.81886792,
            "candle_acc_trade_volume": 287335260.4086428,
            "first_day_of_period": "2022-01-03"
        },
        {
            "market": "BTC-ONIT",
            "candle_date_time_utc": "2021-12-27T00:00:00",
            "candle_date_time_kst": "2021-12-27T09:00:00",
            "opening_price": 0.00000443,
            "high_price": 0.00000494,
            "low_price": 0.00000413,
            "trade_price": 0.00000473,
            "timestamp": 1641167980046,
            "candle_acc_trade_price": 972.29997176,
            "candle_acc_trade_volume": 219554550.1534774,
            "first_day_of_period": "2021-12-27"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Example Curl" %}

```
curl --location --request GET 'https://{dashboard-domain}/v1.0/db/coin/candle/weeks?coin_symbol=BTC-ONIT&count=3&to=2022-01-12T04:29:00Z'
```

{% endtab %}

{% tab title="Response Value" %}

<table><thead><tr><th width="247.13953488372093">key</th><th>data type</th><th>desc.</th></tr></thead><tbody><tr><td>market</td><td>string</td><td>마켓명</td></tr><tr><td>candle_date_time_utc</td><td>string</td><td>캔들 기준 시각(UTC 기준)</td></tr><tr><td>candle_date_time_kst</td><td>string</td><td>캔들 기준 시각(KST 기준)</td></tr><tr><td>opening_price</td><td>float64</td><td>시가</td></tr><tr><td>high_price</td><td>float64</td><td>고가</td></tr><tr><td>low_price</td><td>float64</td><td>저가</td></tr><tr><td>trade_price</td><td>float64</td><td>종가</td></tr><tr><td>timestamp</td><td>int64</td><td>마지막 틱이 저장된 시각</td></tr><tr><td>candle_acc_trade_price</td><td>float64</td><td>누적 거래 금액</td></tr><tr><td>candle_acc_trade_volume</td><td>float64</td><td>누적 거래량</td></tr><tr><td>first_day_of_period</td><td>string</td><td>캔들 기간의 가장 첫 날</td></tr></tbody></table>
{% endtab %}

{% tab title="Result Code" %}

| return        | message                      | desc.                     |
| ------------- | ---------------------------- | ------------------------- |
| 0             | success                      | 성공                        |
| 12001         | Empty coin symbol            | 코인 심볼이 비어있음               |
| 12004         | Empty Count                  | Count가 비어있음               |
| 12005         | Empty To                     | To가 비어있음                  |
| 13004         | Upbit Candle Weeks API Error | 업비트 CandleWeeks 조회 API 에러 |
| {% endtab %}  |                              |                           |
| {% endtabs %} |                              |                           |
