{"id":11131,"date":"2021-05-26T13:06:32","date_gmt":"2021-05-26T04:06:32","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=11131"},"modified":"2021-05-26T17:13:25","modified_gmt":"2021-05-26T08:13:25","slug":"openapi%eb%a5%bc-%ec%9d%b4%ec%9a%a9%ed%95%9c-%ed%98%84%ec%9e%ac-%ea%b8%b0%ec%83%81%ea%b8%b0%ec%98%a8-%eb%93%b1-%ec%a0%95%eb%b3%b4-%ec%96%bb%ea%b8%b0","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=11131","title":{"rendered":"OpenAPI\ub97c \uc774\uc6a9\ud55c \ud604\uc7ac \uae30\uc0c1(\uae30\uc628, \uac15\uc218\ub7c9, \ubc14\ub78c\uc131\ubd84, \uc2b5\ub3c4, \uac15\uc218\ud615\ud0dc, \ud48d\ud5a5, \ud48d\uc18d) \uc815\ubcf4 \uc5bb\uae30"},"content":{"rendered":"<p>\uacf5\uacf5\ub370\uc774\ud130\ud3ec\ud138(data.go.kr)\uc5d0\uc11c &#8220;\ub3d9\ub124\uc608\ubcf4&#8221;\ub85c \uac80\uc0c9\ud558\uba74 \uc544\ub798\uc640 \uac19\uc740 \uacb0\uacfc \uc911 \uae30\uc0c1\uccad_\ub3d9\ub124\uc608\ubcf4 \uc870\ud68c\uc11c\ube44\uc2a4\uc5d0 \ub300\ud55c \ud65c\uc6a9\uc2e0\uccad \ubc84\ud2bc\uc744 \ud074\ub9ad\ud558\uc5ec OpenAPI \uc0ac\uc6a9 \uc2e0\uccad\uc744 \ud569\ub2c8\ub2e4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2021\/05\/weather_openapi.png\" alt=\"\" width=\"1836\" height=\"346\" class=\"aligncenter size-full wp-image-11134\" \/><\/p>\n<p>\uc800 \uac19\uc740 \uacbd\uc6b0 \uace0\ub9d9\uac8c\ub3c4 \uc0ac\uc6a9 \uc2e0\uccad \ud6c4 \uc989\uc2dc \uc0ac\uc6a9\ud560 \uc218 \uc788\uc5c8\ub294\ub370\uc694. \ub9c8\uc774\ud398\uc774\uc9c0\uc5d0\uc11c \uc624\ud508API\uc758 \uac1c\ubc1c\uacc4\uc815\uc744 \ud074\ub9ad\ud558\uba74 \uc55e\uc11c \uc2e0\uccad\ud55c \uc11c\ube44\uc2a4\uac00 \ud45c\uc2dc\ub429\ub2c8\ub2e4. \ud45c\uc2dc\ub418\ub294 \uc11c\ube44\uc2a4 \uc911 \uc55e\uc11c \uc2e0\uccad\ud55c \uc11c\ube44\uc2a4\uc758 \uc81c\ubaa9\uc744 \ud074\ub9ad\ud558\uba74 \uc774 \uc911 \ucd08\ub2e8\uae30\uc2e4\ud669\uc870\ud68c\uc758 \ud655\uc778 \ubc84\ud2bc\uc744 \ud074\ub9ad\ud558\uba74 \uc544\ub798\uc640 \uac19\uc740 \ud654\uba74\uc774 \ud45c\uc2dc\ub429\ub2c8\ub2e4. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2021\/05\/weather_openapi2.png\" alt=\"\" width=\"1488\" height=\"804\" class=\"aligncenter size-full wp-image-11136\" \/><\/p>\n<p>\ud604\uc7ac\uc758 \uae30\uc0c1 \uc815\ubcf4\ub97c \uc5bb\uc744 \ubaa9\uc801\uc774\ubbc0\ub85c \uc704\uc758 \uc11c\ube44\uc2a4 \uc911\uc5d0\uc11c \ucd08\ub2e8\uae30\uc2e4\ud669\uc870\ud68c\uc5d0 \ub300\ud55c \ubbf8\ub9ac\ubcf4\uae30\uc758 \ud655\uc778 \ubc84\ud2bc\uc744 \ud074\ub9ad\ud558\uba74 \ub2e4\uc74c\uacfc \uac19\uc774 \ud14c\uc2a4\ud2b8\ud574 \ubcfc \uc218 \uc788\ub294 UI\uac00 \ud45c\uc2dc\ub429\ub2c8\ub2e4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2021\/05\/weather_openapi3.png\" alt=\"\" width=\"1494\" height=\"1002\" class=\"aligncenter size-full wp-image-11139\" \/><\/p>\n<p>\uc11c\ube44\uc2a4 \ud0a4\uc640 \ub0a0\uc9dc, \uc2dc\uac04, \uc704\uce58\uac12(\uc704\uc758 \uacbd\uc6b0 nx\uc640 ny\ub85c \uc9c0\uc815\ud558\uba70 \uad11\uc9c4\uad6c \ud654\uc591\ub3d9)\uc744 \uc785\ub825\ud558\uace0 \ubbf8\ub9ac\ubcf4\uae30 \ubc84\ud2bc\uc744 \ud074\ub9ad\ud558\uba74 \uc544\ub798\uc758 \uacb0\uacfc\uac00 \ud45c\uc2dc\ub429\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"xml\">\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<response>\r\n   <header>\r\n      <resultCode>00<\/resultCode>\r\n      <resultMsg>NORMAL_SERVICE<\/resultMsg>\r\n   <\/header>\r\n   <body>\r\n      <dataType>XML<\/dataType>\r\n      <items>\r\n         <item>\r\n            <baseDate>20210526<\/baseDate>\r\n            <baseTime>1200<\/baseTime>\r\n            <category>PTY<\/category>\r\n            <nx>61<\/nx>\r\n            <ny>126<\/ny>\r\n            <obsrValue>0<\/obsrValue>\r\n         <\/item>\r\n         <item>\r\n            <baseDate>20210526<\/baseDate>\r\n            <baseTime>1200<\/baseTime>\r\n            <category>REH<\/category>\r\n            <nx>61<\/nx>\r\n            <ny>126<\/ny>\r\n            <obsrValue>37<\/obsrValue>\r\n         <\/item>\r\n         <item>\r\n            <baseDate>20210526<\/baseDate>\r\n            <baseTime>1200<\/baseTime>\r\n            <category>RN1<\/category>\r\n            <nx>61<\/nx>\r\n            <ny>126<\/ny>\r\n            <obsrValue>0<\/obsrValue>\r\n         <\/item>\r\n         <item>\r\n            <baseDate>20210526<\/baseDate>\r\n            <baseTime>1200<\/baseTime>\r\n            <category>T1H<\/category>\r\n            <nx>61<\/nx>\r\n            <ny>126<\/ny>\r\n            <obsrValue>22.6<\/obsrValue>\r\n         <\/item>\r\n         <item>\r\n            <baseDate>20210526<\/baseDate>\r\n            <baseTime>1200<\/baseTime>\r\n            <category>UUU<\/category>\r\n            <nx>61<\/nx>\r\n            <ny>126<\/ny>\r\n            <obsrValue>1.9<\/obsrValue>\r\n         <\/item>\r\n         <item>\r\n            <baseDate>20210526<\/baseDate>\r\n            <baseTime>1200<\/baseTime>\r\n            <category>VEC<\/category>\r\n            <nx>61<\/nx>\r\n            <ny>126<\/ny>\r\n            <obsrValue>210<\/obsrValue>\r\n         <\/item>\r\n         <item>\r\n            <baseDate>20210526<\/baseDate>\r\n            <baseTime>1200<\/baseTime>\r\n            <category>VVV<\/category>\r\n            <nx>61<\/nx>\r\n            <ny>126<\/ny>\r\n            <obsrValue>3.3<\/obsrValue>\r\n         <\/item>\r\n         <item>\r\n            <baseDate>20210526<\/baseDate>\r\n            <baseTime>1200<\/baseTime>\r\n            <category>WSD<\/category>\r\n            <nx>61<\/nx>\r\n            <ny>126<\/ny>\r\n            <obsrValue>3.8<\/obsrValue>\r\n         <\/item>\r\n      <\/items>\r\n      <numOfRows>10<\/numOfRows>\r\n      <pageNo>1<\/pageNo>\r\n      <totalCount>8<\/totalCount>\r\n   <\/body>\r\n<\/response>\r\n<\/pre>\n<p>\ucd1d 8\uac1c\uc758 \uc815\ubcf4\uac00 \ud45c\uc2dc\ub429\ub2c8\ub2e4. category \ud0dc\uadf8\ub97c \ud1b5\ud574 \uc5b4\ub5a4 \uc885\ub958\uc778\uc9c0 \ud655\uc778\ud560 \uc218 \uc788\uc73c\uba70 T1H(\uae30\uc628 \u2103), RN1(1\uc2dc\uac04 \uac15\uc218\ub7c9 mm), UUU(\ub3d9\uc11c\ubc14\ub78c\uc131\ubd84 m\/s), VVV(\ub0a8\ubd81\ubc14\ub78c\uc131\ubd84 m\/s), REH(\uc2b5\ub3c4 %), PTY(\uac15\uc218\ud615\ud0dc), VEC(\ud48d\ud5a5 deg), WSD(\ud48d\uc18d m\/s)\uc785\ub2c8\ub2e4. \uac12\uc774 900\uc774\uc0c1 -900\uc774\ud558\uc77c \uacbd\uc6b0 \ub204\ub77d\ub41c \uac12\uc73c\ub85c \ud310\ub2e8\ud574\uc57c \ud569\ub2c8\ub2e4. \uc544\uc6b8\ub7ec \uc815\ubcf4 \uc911 \uac15\uc218\ud615\ud0dc\ub294 \ucf54\ub4dc\uac12\uc73c\ub85c \uac12\uc5d0 \ub300\ud55c \uc758\ubbf8\ub294 \uc5c6\uc74c(0), \ube44(1), \ube44\/\ub208(2), \ub208(3), \uc18c\ub098\uae30(4), \ube57\ubc29\uc6b8(5), \ube57\ubc29\uc6b8\/\ub208\ub0a0\ub9bc(6), \ub208\ub0a0\ub9bc(7)\uc785\ub2c8\ub2e4.<\/p>\n<p>\ucd08\ub2e8\uae30\uc2e4\ud589 \uc815\ubcf4\ub294 10\ubd84 \ub2e8\uc704\ub85c \uc5c5\ub370\uc774\ud2b8 \ub41c\ub2e4\uace0 \ud569\ub2c8\ub2e4. \uadf8\ub9ac\uace0 \uad00\uce21\uc9c0\uc810\uc740 nx\uc640 ny\ub85c \uc9c0\uc815\ud558\ub294\ub370 \uc774 \uac12\uc740 \uc77c\ubc18\uc801\uc778 \uacbd\uc704\ub3c4\uac12\uc774 \uc544\ub2cc \uc774 \uc11c\ube44\uc2a4\ub97c \uc704\ud55c \uae30\uc900 \uaca9\uc790 \ubc88\ud638\uc785\ub2c8\ub2e4. \ud574\ub2f9 \uc11c\ube44\uc2a4\uc5d0 \ub300\ud55c \uc5d1\uc140 \ubb38\uc11c\ub97c \ud1b5\ud574\uc11c \uac01 \ud589\uc815\uad6c\uc5ed\uc5d0 \ub300\ud55c nx\uc640 ny\ub97c \ud30c\uc545\ud560 \uc218 \uc788\ub3c4 \uc788\uace0 \uacbd\uc704\ub3c4\ub97c \ud1b5\ud574 \ubcc0\ud658\ud560 \uc218 \uc788\ub294 C\uc5b8\uc5b4 \ucf54\ub4dc\ub97c \ubb38\uc11c\ub97c \ud1b5\ud574 \uc81c\uacf5\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc774 \uae00\uc740 \ud604\uc7ac \uae30\uc0c1 \uc815\ubcf4\ub97c \ud30c\uc545\ud558\uae30 \uc704\ud574 \ud544\uc694\ud55c \ucd5c\uc18c\ud55c\uc758 \ub0b4\uc6a9\uc744 \uc124\uba85\ud558\uace0 \uc788\uc73c\ubbc0\ub85c \uc804\uccb4\uc801\uc778 \ub0b4\uc6a9 \ud30c\uc545\uc774 \ud544\uc694\ud560 \uacbd\uc6b0 \ud574\ub2f9 \uc11c\ube44\uc2a4\uc5d0 \ub300\ud55c \ud65c\uc6a9\uac00\uc774\ub4dc \ubb38\uc11c\ub97c \ucc38\uace0\ud558\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.<\/p>\n<p>\uc544\ub798\uc758 \ucf54\ub4dc\ub294 \uc704\uc758 \uc11c\ube44\uc2a4\ub97c \uc2e4\uc81c \uc2dc\uc2a4\ud15c\uc5d0 \ubc18\uc601\ud560 \ub54c \ubc1c\uc0dd\ud558\ub294 CORS \ubb38\uc81c\ub97c \ud53c\ud558\uae30 \uc704\ud55c \ud504\ub85d\uc2dc(Proxy) \uc11c\ubc84\ub97c \uc0ac\uc6a9\ud574 \ud638\ucd9c\ud558\ub294 \ucf54\ub4dc\uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\">\r\nlet proxy = \"http:\/\/111.111.111.111\/Xr\";\r\nlet urlHeader = \"http:\/\/apis.data.go.kr\/1360000\/VilageFcstInfoService\/getUltraSrtNcst\";\r\nlet queryString = \"serviceKey=__ENCODED_KEY__&pageNo=1&numOfRows=10&dataType=XML&base_date=20210526&base_time=0600&nx=18&ny=1\";\r\nqueryString = encodeURI(queryString);\r\nurl = proxy + \"?reqPrx|\" + urlHeader + \"|\" + queryString;\r\n\r\nconst xhr = new XMLHttpRequest();\r\nxhr.open(\"GET\", url);\r\n        \r\nxhr.onreadystatechange = function (evt) {\r\n    if (xhr.readyState === 4) {\r\n        if (xhr.status === 200) {\r\n            console.log(xhr.responseText);\r\n        } else {\r\n            throw new Error(\"Error\");\r\n        }\r\n    }\r\n};\r\n\r\nxhr.send(null);\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\uacf5\uacf5\ub370\uc774\ud130\ud3ec\ud138(data.go.kr)\uc5d0\uc11c &#8220;\ub3d9\ub124\uc608\ubcf4&#8221;\ub85c \uac80\uc0c9\ud558\uba74 \uc544\ub798\uc640 \uac19\uc740 \uacb0\uacfc \uc911 \uae30\uc0c1\uccad_\ub3d9\ub124\uc608\ubcf4 \uc870\ud68c\uc11c\ube44\uc2a4\uc5d0 \ub300\ud55c \ud65c\uc6a9\uc2e0\uccad \ubc84\ud2bc\uc744 \ud074\ub9ad\ud558\uc5ec OpenAPI \uc0ac\uc6a9 \uc2e0\uccad\uc744 \ud569\ub2c8\ub2e4. \uc800 \uac19\uc740 \uacbd\uc6b0 \uace0\ub9d9\uac8c\ub3c4 \uc0ac\uc6a9 \uc2e0\uccad \ud6c4 \uc989\uc2dc \uc0ac\uc6a9\ud560 \uc218 \uc788\uc5c8\ub294\ub370\uc694. \ub9c8\uc774\ud398\uc774\uc9c0\uc5d0\uc11c \uc624\ud508API\uc758 \uac1c\ubc1c\uacc4\uc815\uc744 \ud074\ub9ad\ud558\uba74 \uc55e\uc11c \uc2e0\uccad\ud55c \uc11c\ube44\uc2a4\uac00 \ud45c\uc2dc\ub429\ub2c8\ub2e4. \ud45c\uc2dc\ub418\ub294 \uc11c\ube44\uc2a4 \uc911 \uc55e\uc11c \uc2e0\uccad\ud55c \uc11c\ube44\uc2a4\uc758 \uc81c\ubaa9\uc744 \ud074\ub9ad\ud558\uba74 \uc774 \uc911 \ucd08\ub2e8\uae30\uc2e4\ud669\uc870\ud68c\uc758 \ud655\uc778 \ubc84\ud2bc\uc744 \ud074\ub9ad\ud558\uba74 \uc544\ub798\uc640 \uac19\uc740 \ud654\uba74\uc774 \ud45c\uc2dc\ub429\ub2c8\ub2e4. \ud604\uc7ac\uc758 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=11131\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;OpenAPI\ub97c \uc774\uc6a9\ud55c \ud604\uc7ac \uae30\uc0c1(\uae30\uc628, \uac15\uc218\ub7c9, \ubc14\ub78c\uc131\ubd84, \uc2b5\ub3c4, \uac15\uc218\ud615\ud0dc, \ud48d\ud5a5, \ud48d\uc18d) \uc815\ubcf4 \uc5bb\uae30&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-11131","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/11131","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11131"}],"version-history":[{"count":15,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/11131\/revisions"}],"predecessor-version":[{"id":11152,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/11131\/revisions\/11152"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11131"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}