asos_client
KMA ASOS (Automated Synoptic Observing System) API client.
This module provides a client for accessing the Korea Meteorological Administration's ASOS (종관기상관측) API for surface weather observations.
ASOSClient
¶
Client for KMA ASOS API.
The ASOS system collects atmospheric data at standardized times across all observation stations, measuring temperature, precipitation, pressure, humidity, wind direction/speed, solar radiation, sunshine duration, and snow depth.
Source code in python/src/kma_mcp/surface/asos_client.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 | |
close()
¶
get_avg_temp_anomaly(year, page_no=1, num_of_rows=10)
¶
Get average temperature anomaly data (not yet implemented).
Reference: API_ENDPOINT_Surface.md line 127-133
Parameters:
-
year(int) –Year to query
-
page_no(int, default:1) –Page number (default: 1)
-
num_of_rows(int, default:10) –Number of rows per page (default: 10)
Raises:
-
NotImplementedError–This API endpoint is not yet implemented
Source code in python/src/kma_mcp/surface/asos_client.py
get_daily_data(tm, stn=0, disp=0)
¶
Get daily observation data for a single day.
Parameters:
-
tm(str | datetime) –Date in 'YYYYMMDD' format or datetime object
-
stn(int | str, default:0) –Station number (0 for all stations)
-
disp(int, default:0) –Display option (default: 0)
Returns:
Example
client = ASOSClient('your_auth_key') data = client.get_daily_data('20250101')
Source code in python/src/kma_mcp/surface/asos_client.py
get_daily_period(tm1, tm2, stn=0, obs='', mode=0)
¶
Get daily observation data for a time period.
Parameters:
-
tm1(str | datetime) –Start date in 'YYYYMMDD' format or datetime object
-
tm2(str | datetime) –End date in 'YYYYMMDD' format or datetime object
-
stn(int | str, default:0) –Station number (0 for all stations)
-
obs(str, default:'') –Observation element code (empty for all)
-
mode(int, default:0) –Mode option (default: 0)
Returns:
Example
client = ASOSClient('your_auth_key') data = client.get_daily_period('20250101', '20250131')
Source code in python/src/kma_mcp/surface/asos_client.py
get_daily_weather_data(year, month, station, page_no=1, num_of_rows=10)
¶
Get daily weather data for a month (not yet implemented).
Reference: API_ENDPOINT_Surface.md line 204-211
Parameters:
-
year(int) –Year to query
-
month(int) –Month to query
-
station(int) –Station number
-
page_no(int, default:1) –Page number (default: 1)
-
num_of_rows(int, default:10) –Number of rows per page (default: 10)
Raises:
-
NotImplementedError–This API endpoint is not yet implemented
Source code in python/src/kma_mcp/surface/asos_client.py
get_element_data(tm1, tm2, obs, stn=0)
¶
Get specific element observation data for a time period.
Parameters:
-
tm1(str | datetime) –Start time in 'YYYYMMDDHHmm' format or datetime object
-
tm2(str | datetime) –End time in 'YYYYMMDDHHmm' format or datetime object
-
obs(str) –Observation element code
-
stn(int | str, default:0) –Station number (0 for all stations)
Returns:
Example
client = ASOSClient('your_auth_key')
Get temperature data¶
data = client.get_element_data('202501010000', '202501020000', 'TA')
Source code in python/src/kma_mcp/surface/asos_client.py
get_hourly_data(tm, stn=0)
¶
Get hourly observation data for a single time.
Parameters:
-
tm(str | datetime) –Time in 'YYYYMMDDHHmm' format or datetime object
-
stn(int | str, default:0) –Station number (0 for all stations, or specific station number)
Returns:
Example
client = ASOSClient('your_auth_key') data = client.get_hourly_data('202501011200')
Or using datetime¶
from datetime import datetime data = client.get_hourly_data(datetime(2025, 1, 1, 12, 0))
Source code in python/src/kma_mcp/surface/asos_client.py
get_hourly_period(tm1, tm2, stn=0)
¶
Get hourly observation data for a time period.
Parameters:
-
tm1(str | datetime) –Start time in 'YYYYMMDDHHmm' format or datetime object
-
tm2(str | datetime) –End time in 'YYYYMMDDHHmm' format or datetime object (maximum 31 days from tm1)
-
stn(int | str, default:0) –Station number (0 for all stations)
Returns:
Example
client = ASOSClient('your_auth_key') data = client.get_hourly_period('202501010000', '202501020000')
Source code in python/src/kma_mcp/surface/asos_client.py
get_monthly_note(year, month, page_no=1, num_of_rows=10)
¶
Get monthly notes/remarks (not yet implemented).
Reference: API_ENDPOINT_Surface.md line 171-177
Parameters:
-
year(int) –Year to query
-
month(int) –Month to query
-
page_no(int, default:1) –Page number (default: 1)
-
num_of_rows(int, default:10) –Number of rows per page (default: 10)
Raises:
-
NotImplementedError–This API endpoint is not yet implemented
Source code in python/src/kma_mcp/surface/asos_client.py
get_monthly_summary(year, month, page_no=1, num_of_rows=10)
¶
Get monthly summary data (not yet implemented).
Reference: API_ENDPOINT_Surface.md line 187-194
Parameters:
-
year(int) –Year to query
-
month(int) –Month to query
-
page_no(int, default:1) –Page number (default: 1)
-
num_of_rows(int, default:10) –Number of rows per page (default: 10)
Raises:
-
NotImplementedError–This API endpoint is not yet implemented
Source code in python/src/kma_mcp/surface/asos_client.py
get_monthly_summary2(year, month, page_no=1, num_of_rows=10)
¶
Get monthly summary data (version 2) (not yet implemented).
Reference: API_ENDPOINT_Surface.md line 196-202
Parameters:
-
year(int) –Year to query
-
month(int) –Month to query
-
page_no(int, default:1) –Page number (default: 1)
-
num_of_rows(int, default:10) –Number of rows per page (default: 10)
Raises:
-
NotImplementedError–This API endpoint is not yet implemented
Source code in python/src/kma_mcp/surface/asos_client.py
get_normals(norm, tmst, mm1, dd1, mm2=None, dd2=None, stn=0)
¶
Get climate normal values for a period.
Documented endpoint: sfc_norm1.php Reference: API_ENDPOINT_Surface.md line 91-106
Parameters:
-
norm(Literal['D', 'S', 'M', 'Y']) –Normal period type: - 'D': Daily (일) - 'S': 10-day period (순) - 'M': Monthly (월) - 'Y': Yearly (연)
-
tmst(Literal[1991, 2001, 2011, 2021]) –Climate normal period: - 1991: 1961-1990 - 2001: 1971-2000 - 2011: 1981-2010 - 2021: 1991-2020
-
mm1(int) –Start month
-
dd1(int) –Start day (for 'S' type: 100=early, 200=middle, 300=late)
-
mm2(int | None, default:None) –End month (optional, defaults to mm1)
-
dd2(int | None, default:None) –End day (optional, defaults to dd1)
-
stn(int | str, default:0) –Station number (0 for all stations)
Returns:
Example
client = ASOSClient('your_auth_key')
Get daily normals for May 1-2¶
data = client.get_normals('D', 2021, mm1=5, dd1=1, mm2=5, dd2=2)
Get monthly normals for May¶
data = client.get_normals('M', 2021, mm1=5, dd1=1)
Get 10-day period normals (early May)¶
data = client.get_normals('S', 2021, mm1=5, dd1=100)
Source code in python/src/kma_mcp/surface/asos_client.py
get_precipitation_anomaly(year, page_no=1, num_of_rows=10)
¶
Get precipitation anomaly data (not yet implemented).
Reference: API_ENDPOINT_Surface.md line 135-141
Parameters:
-
year(int) –Year to query
-
page_no(int, default:1) –Page number (default: 1)
-
num_of_rows(int, default:10) –Number of rows per page (default: 10)
Raises:
-
NotImplementedError–This API endpoint is not yet implemented
Source code in python/src/kma_mcp/surface/asos_client.py
get_station_list_table(year, month, page_no=1, num_of_rows=10)
¶
Get surface observation station list table (not yet implemented).
Reference: API_ENDPOINT_Surface.md line 179-185
Parameters:
-
year(int) –Year to query
-
month(int) –Month to query
-
page_no(int, default:1) –Page number (default: 1)
-
num_of_rows(int, default:10) –Number of rows per page (default: 10)
Raises:
-
NotImplementedError–This API endpoint is not yet implemented
Source code in python/src/kma_mcp/surface/asos_client.py
get_station_phenomenon_data(year, station, page_no=1, num_of_rows=10)
¶
Get station phenomenon data (not yet implemented).
Reference: API_ENDPOINT_Surface.md line 143-149
Parameters:
-
year(int) –Year to query
-
station(int) –Station number
-
page_no(int, default:1) –Page number (default: 1)
-
num_of_rows(int, default:10) –Number of rows per page (default: 10)
Raises:
-
NotImplementedError–This API endpoint is not yet implemented
Source code in python/src/kma_mcp/surface/asos_client.py
get_station_phenomenon_data2(year, station, page_no=1, num_of_rows=10)
¶
Get station phenomenon data (version 2) (not yet implemented).
Reference: API_ENDPOINT_Surface.md line 151-157
Parameters:
-
year(int) –Year to query
-
station(int) –Station number
-
page_no(int, default:1) –Page number (default: 1)
-
num_of_rows(int, default:10) –Number of rows per page (default: 10)
Raises:
-
NotImplementedError–This API endpoint is not yet implemented
Source code in python/src/kma_mcp/surface/asos_client.py
get_station_phenomenon_data3(year, station, page_no=1, num_of_rows=10)
¶
Get station phenomenon data (version 3) (not yet implemented).
Reference: API_ENDPOINT_Surface.md line 159-165
Parameters:
-
year(int) –Year to query
-
station(int) –Station number
-
page_no(int, default:1) –Page number (default: 1)
-
num_of_rows(int, default:10) –Number of rows per page (default: 10)
Raises:
-
NotImplementedError–This API endpoint is not yet implemented
Source code in python/src/kma_mcp/surface/asos_client.py
get_yearly_climate_stats(stn, mm, dd)
¶
Get yearly climate statistics for a specific date (not yet implemented).
Reference: API_ENDPOINT_Surface.md line 224-229
Parameters:
Raises:
-
NotImplementedError–This API endpoint is not yet implemented
Source code in python/src/kma_mcp/surface/asos_client.py
get_yearly_summary(year, page_no=1, num_of_rows=10)
¶
Get yearly summary data (not yet implemented).
Reference: API_ENDPOINT_Surface.md line 111-117
Parameters:
-
year(int) –Year to query
-
page_no(int, default:1) –Page number (default: 1)
-
num_of_rows(int, default:10) –Number of rows per page (default: 10)
Raises:
-
NotImplementedError–This API endpoint is not yet implemented
Source code in python/src/kma_mcp/surface/asos_client.py
get_yearly_summary2(year, page_no=1, num_of_rows=10)
¶
Get yearly summary data (version 2) (not yet implemented).
Reference: API_ENDPOINT_Surface.md line 119-125
Parameters:
-
year(int) –Year to query
-
page_no(int, default:1) –Page number (default: 1)
-
num_of_rows(int, default:10) –Number of rows per page (default: 10)
Raises:
-
NotImplementedError–This API endpoint is not yet implemented