API Reference
기상청 중기예보
기상청 중기기온예보 응답을 일자별 forecast 배열 구조로 정규화합니다.
기상청 중기예보
taMin3~taMax10 형태의 펼쳐진 필드를 dayOffset 기반 배열로 재구성해 소비하기 쉽게 제공합니다.
엔드포인트
GET /v1/kma-mid-forecast
Upstream
- Base URL:
https://apis.data.go.kr/1360000/MidFcstInfoService - Path:
/getMidTa
요청 파라미터
| 파라미터 | 타입 | 필수 | 기본값 | 설명 |
|---|---|---|---|---|
regionId | string | ❌ | 11B10101 | 예보구역 코드 (11B10101=서울) |
tmFc | string | ❌ | - | 발표시각 (YYYYMMDDHHmm, 기본: 오늘 0600) |
요청 예시
{
"regionId": "11B10101",
"tmFc": "202503220600"
}응답 스키마
아래 스키마는 adapter의 Zod output schema에서 직접 생성됩니다.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"regionId": {
"type": "string"
},
"forecasts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"dayOffset": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "발표 기준 며칠 후 (3~10)"
},
"minTemp": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "최저 기온 (°C)"
},
"maxTemp": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "최고 기온 (°C)"
},
"minTempLow": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "최저 기온 하한 (°C)"
},
"minTempHigh": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "최저 기온 상한 (°C)"
},
"maxTempLow": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "최고 기온 하한 (°C)"
},
"maxTempHigh": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "최고 기온 상한 (°C)"
}
},
"required": [
"dayOffset",
"minTemp",
"maxTemp",
"minTempLow",
"minTempHigh",
"maxTempLow",
"maxTempHigh"
],
"additionalProperties": false
}
}
},
"required": [
"regionId",
"forecasts"
],
"additionalProperties": false
}응답 예시
{
"data": {
"regionId": "11B10101",
"forecasts": [
{
"dayOffset": 3,
"minTemp": 8,
"maxTemp": 18,
"minTempLow": 7,
"minTempHigh": 10,
"maxTempLow": 17,
"maxTempHigh": 20
},
{
"dayOffset": 4,
"minTemp": 9,
"maxTemp": 19,
"minTempLow": 8,
"minTempHigh": 11,
"maxTempLow": 18,
"maxTempHigh": 21
},
{
"dayOffset": 5,
"minTemp": 10,
"maxTemp": 20,
"minTempLow": 9,
"minTempHigh": 12,
"maxTempLow": 18,
"maxTempHigh": 22
},
{
"dayOffset": 6,
"minTemp": 8,
"maxTemp": 17,
"minTempLow": 7,
"minTempHigh": 10,
"maxTempLow": 15,
"maxTempHigh": 19
},
{
"dayOffset": 7,
"minTemp": 7,
"maxTemp": 16,
"minTempLow": 6,
"minTempHigh": 9,
"maxTempLow": 14,
"maxTempHigh": 18
},
{
"dayOffset": 8,
"minTemp": 9,
"maxTemp": 18,
"minTempLow": 8,
"minTempHigh": 11,
"maxTempLow": 16,
"maxTempHigh": 20
},
{
"dayOffset": 9,
"minTemp": 10,
"maxTemp": 19,
"minTempLow": 9,
"minTempHigh": 12,
"maxTempLow": 17,
"maxTempHigh": 21
},
{
"dayOffset": 10,
"minTemp": 9,
"maxTemp": 18,
"minTempLow": null,
"minTempHigh": null,
"maxTempLow": null,
"maxTempHigh": null
}
]
},
"pagination": null,
"meta": {
"source": "kma-mid-forecast",
"fetchedAt": "2026-03-24T00:00:00.000Z"
}
}정규화 사항
- response.body.items.item envelope을 언랩한 뒤 regId와 예보 필드를 추출합니다.
- taMin/taMax 및 low/high 범위 값을 모두 number 타입으로 정규화합니다.
- 존재하는 일자만 dayOffset 기준 forecasts 배열에 포함합니다.
- 요청 파라미터 regionId는 upstream regId로 변환되고 dataType/page 파라미터가 자동 주입됩니다.