{"id":5189,"date":"2016-11-04T13:36:32","date_gmt":"2016-11-04T04:36:32","guid":{"rendered":"https:\/\/gunmagisgeek.com\/wordpress\/?p=5189"},"modified":"2016-11-04T18:45:02","modified_gmt":"2016-11-04T09:45:02","slug":"post-5189","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/d3v4\/5189","title":{"rendered":"RESAS-API\u3092\u4f7f\u3063\u3066\u307f\u305f\u3002"},"content":{"rendered":"<p>RESAS(\u5730\u57df\u7d4c\u6e08\u5206\u6790\u30b7\u30b9\u30c6\u30e0)\u306b\u63b2\u8f09\u3057\u3066\u3044\u308b\u30c7\u30fc\u30bf\u3092\u30d7\u30ed\u30b0\u30e9\u30e0\u304b\u3089\u53d6\u5f97\u3067\u304d\u308bAPI\u304c\u300111\u67081\u65e5\u516c\u958b\u3055\u308c\u307e\u3057\u305f\u3002\u4eca\u9031\u672b\u304b\u3089\u958b\u50ac\u3055\u308c\u308b\u300cRESAS API \u30cf\u30c3\u30ab\u30bd\u30f3\u300d\u306b\u53c2\u52a0\u3059\u308b\u306e\u3067\u3001\u4e88\u7fd2\u304c\u3066\u3089\u5c11\u3057\u89e6\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"https:\/\/opendata.resas-portal.go.jp\/\">RESAS-API &#8211; \u5730\u57df\u7d4c\u6e08\u5206\u6790\u30b7\u30b9\u30c6\u30e0\uff08RESAS\uff09\u306eAPI\u63d0\u4f9b\u60c5\u5831<\/a><br \/>\n<a href=\"https:\/\/eventdots.jp\/event\/603597\">\u6771\u4eac\u3067\u8003\u3048\u308b\u5730\u65b9\u5275\u751f\uff01RESAS API \u30cf\u30c3\u30ab\u30bd\u30f3 &#8211; dots. [\u30c9\u30c3\u30c4]<\/a><\/p>\n<h2>D3\u304b\u3089API\u3092\u4f7f\u3046<\/h2>\n<p>RESAS-API\u3092\u5229\u7528\u3059\u308b\u306b\u306f\u30ea\u30af\u30a8\u30b9\u30c8\u30d8\u30c3\u30c0\u306bAPI-KEY\u3092\u542b\u3081\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\nD3.js\u3067\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u30ab\u30b9\u30bf\u30e0\u30d8\u30c3\u30c0\u3092\u542b\u3080\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:js decode:true \" >var url = \"https:\/\/opendata.resas-portal.go.jp\/api\/v1-rc.1\/oldCities?prefCode=2&amp;cityCode=02201\"\r\nd3.request(url)\r\n    .header(\"X-API-KEY\", \"\u3053\u3053\u306bAPI-KEY\u3092\u8a18\u8ff0\")\r\n    .mimeType(\"application\/json\")\r\n    .response(function(xhr) { return JSON.parse(xhr.responseText) })\r\n    .get(callback)\r\n    \r\nfunction callback(json){\r\n    console.log(json)\r\n}<\/pre>\n<h2>Tester<\/h2>\n<p>\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u7528\u306b\u30d3\u30e5\u30a2\u30fc\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"http:\/\/shimz.me\/example\/RESAS_API\/viewer\/index.html\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2016\/11\/resasapiviewer0.png\" alt=\"resasapiviewer0\" width=\"590\" height=\"664\" class=\"alignnone size-full wp-image-5191 border\" srcset=\"https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2016\/11\/resasapiviewer0.png 590w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2016\/11\/resasapiviewer0-133x150.png 133w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/shimz.me\/example\/RESAS_API\/viewer\/index.html\">RESAS API TESTER<\/a><\/p>\n<h2>D3\u7528\u30e2\u30b8\u30e5\u30fc\u30eb<\/h2>\n<p>\u30cf\u30c3\u30ab\u30bd\u30f3\u3067\u4f7f\u3046\u304b\u3082\u3068\u601d\u3063\u3066\u4f5c\u6210\u3057\u3066\u307f\u305f\u3082\u306e\u3002<br \/>\n\u30ea\u30af\u30a8\u30b9\u30c8\u6295\u3052\u308b\u3060\u3051\u3060\u3051\u3069\u3001\u3061\u3087\u3053\u3063\u3068\u3060\u3051\u697d\u306b\u306a\u308b\u304b\u3082\u3002<\/p>\n<p><a href=\"https:\/\/gist.github.com\/shimizu\/7e3dfe5a72b8191cab99b6ef66f3c977\">RESAS API module \/ Gist<\/a><\/p>\n<p>\u4f7f\u3044\u65b9\u306f\u4ee5\u4e0b\u3002 <\/p>\n<pre class=\"lang:js decode:true \" >var api = RESASAPI();\r\napi.apikey(\"&lt;RESAS API \u30ad\u30fc\u3092\u8a18\u8ff0&gt;\")\r\n\r\napi.type(\"\u90fd\u9053\u5e9c\u770c\u4e00\u89a7\") \r\n\r\napi.param({\r\n    \"prefCode\":\"11\",\r\n    \"sicCode\":\"E\",\r\n    \"simcCode\":\"20\",\r\n})\r\n\r\nconsole.log(api.url())\r\n\r\napi.on('load', function(data) {\r\n    console.log(data)\r\n})\r\n\r\napi.send()<\/pre>\n<h2>CLI\u7528<\/h2>\n<p>\u30ed\u30fc\u30ab\u30eb\u306b\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u306e\u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3082\u4e00\u5fdc\u3002<\/p>\n<p><a href=\"https:\/\/gist.github.com\/shimizu\/add64a8d254038f500911ab01cf05b6d\">RESAS API CLI \/ Gist<\/a><\/p>\n<pre class=\"lang:sh decode:true \" >node req.js \"https:\/\/opendata.resas-portal.go.jp\/api\/v1-rc.1\/prefectures\" &gt; result.json<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>RESAS(\u5730\u57df\u7d4c\u6e08\u5206\u6790\u30b7\u30b9\u30c6\u30e0)\u306b\u63b2\u8f09\u3057\u3066\u3044\u308b\u30c7&hellip;<\/p>\n","protected":false},"author":1,"featured_media":5191,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69],"tags":[],"class_list":["post-5189","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-d3v4","has-post-thumbnail-archive"],"_links":{"self":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/5189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/comments?post=5189"}],"version-history":[{"count":1,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/5189\/revisions"}],"predecessor-version":[{"id":5223,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/5189\/revisions\/5223"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media\/5191"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=5189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=5189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=5189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}