APIについて
山口県オープンデータカタログサイトでは、公開しているデータの情報をAPIで取得することができます。
本ページでは、代表的なAPIの使用方法を記載しています。
詳細は以下のサイトを参照してください。
CKAN API Guide
https://docs.ckan.org/en/2.9/api/
代表的なAPI
・データセットID一覧
・データセット詳細
・データセット検索
・リソース更新
・最近更新されたデータセット一覧
データセットID一覧
API
package_list
メソッド
GET
エンドポイント
https://yamaguchi-opendata.jp/ckan/api/3/action/package_list
パラメタ
名前 | 説明 |
limit |
検索結果の取得数 |
offset |
検索結果の取得位置 |
レスポンス
{
"help": "https://yamaguchi-opendata.jp/ckan/api/3/action/help_show?name=package_list",
"success": true,
"result": [
"00001",
"00002",
"00003",
"00004",
"00005"
}
データセット詳細
API
package_show
メソッド
GET
エンドポイント
https://yamaguchi-opendata.jp/ckan/api/3/action/package_show
パラメタ
名前 | 説明 |
id |
データセットID [例:18800jyuutakutyakkoukosuu] |
レスポンス
{
"help": "https://yamaguchi-opendata.jp/ckan/api/3/action/help_show?name=package_show",
"success": true,
"result": {
"license_title": "Creative Commons Attribution",
"maintainer": "山口県建築指導課",
"relationships_as_object": [
],
"private": false,
"maintainer_email": "",
"num_tags": 1,
"id": "c9d58c6b-3ae1-4a89-8b9b-856dbb787df1",
"metadata_created": "2023-06-15T04:50:35.511505",
"metadata_modified": "2024-07-10T08:50:56.869604",
"author": "",
"author_email": "",
"state": "active",
"version": "",
"creator_user_id": "b2c68b3a-fd3d-40c4-b7f0-a911eddd8cb2",
"type": "dataset",
"resources": [
{
"mimetype": null,
"cache_url": null,
"hash": "",
"description": "令和5年4月分から令和6年3月分までの月毎の住宅着工戸数のデータ及び令和5年度の住宅着工戸数の集計データがあります。",
"name": "令和5年度山口県新設住宅着工戸数",
"format": "XLSX",
"url": "https://yamaguchi-opendata.jp/ckan/dataset/c9d58c6b-3ae1-4a89-8b9b-856dbb787df1/resource/5d59c546-af90-447c-9ecd-46e7e0b9269d/download/5.xlsx",
"cache_last_updated": null,
"package_id": "c9d58c6b-3ae1-4a89-8b9b-856dbb787df1",
"created": "2023-06-15T04:56:47.482036",
"state": "active",
"mimetype_inner": null,
"last_modified": "2024-05-09T06:20:22.814200",
"position": 0,
"revision_id": "f205e374-c8e8-4adb-9374-d1cabb72746f",
"url_type": "upload",
"id": "5d59c546-af90-447c-9ecd-46e7e0b9269d",
"resource_type": null,
"size": null
},
{
"mimetype": null,
"cache_url": null,
"hash": "",
"description": "令和6年4月分からの月毎の住宅着工戸数のデータがあります。",
"name": "令和6年度山口県新設住宅着工戸数",
"format": "XLSX",
"url": "https://yamaguchi-opendata.jp/ckan/dataset/c9d58c6b-3ae1-4a89-8b9b-856dbb787df1/resource/8ad90d7a-f840-4467-af83-cbe021f15340/download/6.xlsx",
"cache_last_updated": null,
"package_id": "c9d58c6b-3ae1-4a89-8b9b-856dbb787df1",
"created": "2024-06-05T01:18:18.385300",
"state": "active",
"mimetype_inner": null,
"last_modified": "2024-07-10T08:50:56.745101",
"position": 1,
"revision_id": "a06868e3-44ed-4dcb-9ae4-105ae6ad9ddb",
"url_type": "upload",
"id": "8ad90d7a-f840-4467-af83-cbe021f15340",
"resource_type": null,
"size": null
}
],
"num_resources": 2,
"tags": [
{
"vocabulary_id": null,
"state": "active",
"display_name": "統計",
"id": "486bcb9e-ae30-49c7-8013-36605c53f153",
"name": "統計"
}
],
"groups": [
],
"license_id": "cc-by",
"relationships_as_subject": [
],
"organization": {
"description": "",
"created": "2019-05-27T14:59:38.472171",
"title": "山口県",
"name": "35000",
"is_organization": true,
"state": "active",
"image_url": "",
"revision_id": "af3eb3ed-7586-48ce-a56b-f31abf88a8ba",
"type": "organization",
"id": "28286db3-e08d-48b1-b480-89b8d93842f7",
"approval_status": "approved"
},
"name": "18800jyuutakutyakkoukosuu",
"isopen": true,
"url": "https://www.pref.yamaguchi.lg.jp/soshiki/134/24211.html",
"notes": " 山口県では、政府統計の総合窓口(e-Stat)(http://www.e-stat.go.jp/<外部リンク>)の住宅着工統計を利用し、県内市町ごとに集計した結果を「山口県新設住宅着工戸数」として公表しています。\r\n\r\n 令和4年度以前分については県建築指導課のウェブサイト(https://www.pref.yamaguchi.lg.jp/soshiki/134/24211.html)をご参照下さい。\r\n",
"owner_org": "28286db3-e08d-48b1-b480-89b8d93842f7",
"extras": [
],
"license_url": "https://creativecommons.org/licenses/by/4.0/deed.ja",
"title": "【山口県】山口県新設住宅着工戸数について",
"revision_id": "03b87a07-db12-4176-82d6-e1101219cc25"
}
}
データセット検索
API
package_search
メソッド
GET
エンドポイント
https://yamaguchi-opendata.jp/ckan/api/3/action/package_search
パラメタ
名前 | 説明 |
q |
検索キーワード |
sort |
検索結果の表示順 [例: metadata_modified desc] 最終更新日の降順 [例:title_string asc] データセット名の昇順 [例:title_string desc] データセット名の降順 |
レスポンス
{
"help": "https://yamaguchi-opendata.jp/ckan/api/3/action/help_show?name=package_search",
"success": true,
"result": {
"count": 2,
"sort": "score desc, metadata_modified desc",
"facets": {
},
"results": [
{
"license_title": "Creative Commons Attribution",
"maintainer": "企画政策課",
"relationships_as_object": [
],
"private": false,
"maintainer_email": "",
"num_tags": 2,
"id": "525e7730-32e8-4067-991a-ff92def42ca4",
"metadata_created": "2023-12-13T01:38:41.749513",
"metadata_modified": "2024-02-08T01:28:04.901643",
"author": "下松市",
"author_email": "",
"state": "active",
"version": "2022",
"creator_user_id": "6bb14e43-0a58-4f0f-b7d0-39bc8fb54bdd",
"type": "dataset",
"resources": [
{
"mimetype": null,
"cache_url": null,
"hash": "",
"description": "下松市の統計情報をまとめた「統計くだまつ2022」全データ",
"name": "統計くだまつ2022",
"format": "XLSX",
"url": "https://yamaguchi-opendata.jp/ckan/dataset/525e7730-32e8-4067-991a-ff92def42ca4/resource/24370a87-3da8-4cad-aec3-d12657d0e621/download/stkdmt2022.xlsx",
"cache_last_updated": null,
"package_id": "525e7730-32e8-4067-991a-ff92def42ca4",
"created": "2023-12-13T01:39:56.621658",
"state": "active",
"mimetype_inner": null,
"last_modified": "2023-12-13T01:39:56.557745",
"position": 0,
"revision_id": "25842eb5-7482-4032-b7c3-7639e869f1d4",
"url_type": "upload",
"id": "24370a87-3da8-4cad-aec3-d12657d0e621",
"resource_type": null,
"size": null
}
],
"num_resources": 1,
"tags": [
{
"vocabulary_id": null,
"state": "active",
"display_name": "下松市",
"id": "745d1e5a-84a0-4e1e-946a-ccb076aa4c49",
"name": "下松市"
},
{
"vocabulary_id": null,
"state": "active",
"display_name": "統計",
"id": "486bcb9e-ae30-49c7-8013-36605c53f153",
"name": "統計"
}
],
"groups": [
{
"display_name": "統計",
"description": "",
"image_display_url": "https://yamaguchi-opendata.jp/ckan/uploads/group/2019-05-27-073536.626757icon150cat11on.png",
"title": "統計",
"id": "249ff95d-dd3a-4dfc-b5da-2e35d618e59f",
"name": "c011"
},
{
"display_name": "行政",
"description": "",
"image_display_url": "https://yamaguchi-opendata.jp/ckan/uploads/group/2019-05-27-073517.006372icon150cat10on.png",
"title": "行政",
"id": "c5d98509-22ad-421c-8949-700f5113ea45",
"name": "c010"
}
],
"license_id": "cc-by",
"relationships_as_subject": [
],
"organization": {
"description": "「星ふるまちくだまつ」\r\nhttps://www.city.kudamatsu.lg.jp/",
"created": "2019-05-27T15:01:57.096047",
"title": "下松市",
"name": "35207",
"is_organization": true,
"state": "active",
"image_url": "2024-02-07-005414.968556sisyou1.gif",
"revision_id": "f2df6980-4020-4e9d-996d-1af27959f921",
"type": "organization",
"id": "4746a3e4-b726-43a2-b849-7ce25178283e",
"approval_status": "approved"
},
"name": "352071_stkdmt",
"isopen": true,
"url": "https://www.city.kudamatsu.lg.jp/jyouhou/toukei.html",
"notes": "下松市の統計情報をまとめた「統計くだまつ」全データ",
"owner_org": "4746a3e4-b726-43a2-b849-7ce25178283e",
"extras": [
],
"license_url": "https://creativecommons.org/licenses/by/4.0/deed.ja",
"title": "【下松市】統計くだまつ",
"revision_id": "e582436d-6e2a-454f-bc59-1cacdd0c38bf"
},
{
"license_title": "Creative Commons Attribution",
"maintainer": "山口県市町課",
"relationships_as_object": [
],
"private": false,
"maintainer_email": "",
"num_tags": 1,
"id": "43819db8-ca53-4212-86b4-4f4286d207af",
"metadata_created": "2019-09-17T10:34:07.984763",
"metadata_modified": "2022-03-01T05:48:53.674391",
"author": "",
"author_email": "",
"state": "active",
"version": "",
"creator_user_id": "2c56c343-4efd-4ea6-9823-0b7a5ff989d5",
"type": "dataset",
"resources": [
{
"mimetype": null,
"cache_url": null,
"hash": "",
"description": "毎月末の県内市町の人口及び世帯数です。",
"name": "住民基本台帳人口(毎月末時点)",
"format": "HTML",
"url": "https://www.pref.yamaguchi.lg.jp/cms/a12400/juki-jinko/20070228001.html",
"cache_last_updated": null,
"package_id": "43819db8-ca53-4212-86b4-4f4286d207af",
"created": "2019-09-17T10:35:42.701292",
"state": "active",
"mimetype_inner": null,
"last_modified": null,
"position": 0,
"revision_id": "8a28efa1-7544-4d94-90a0-551481d211eb",
"url_type": null,
"id": "ad01f226-adf6-43d0-be31-8646375e7886",
"resource_type": null,
"size": null
},
{
"mimetype": null,
"cache_url": null,
"hash": "",
"description": "住民基本台帳年報に基づく人口、人口動態及び世帯数に関する統計情報です。",
"name": "地域・年齢別人口(令和3年1月1日時点)",
"format": "CSV",
"url": "https://yamaguchi-opendata.jp/ckan/dataset/43819db8-ca53-4212-86b4-4f4286d207af/resource/82bf065e-0737-46f0-a681-e919d77aeaef/download/350001_population.csv",
"cache_last_updated": null,
"package_id": "43819db8-ca53-4212-86b4-4f4286d207af",
"created": "2022-02-21T12:15:45.436313",
"state": "active",
"mimetype_inner": null,
"last_modified": "2022-02-21T12:15:45.403738",
"position": 1,
"revision_id": "6b1787ce-f037-4b79-819f-3534eb0a6920",
"url_type": "upload",
"id": "82bf065e-0737-46f0-a681-e919d77aeaef",
"resource_type": null,
"size": null
}
],
"num_resources": 2,
"tags": [
{
"vocabulary_id": null,
"state": "active",
"display_name": "人口",
"id": "1c7359b8-1277-4234-b4c0-95fb47fe73a5",
"name": "人口"
}
],
"groups": [
{
"display_name": "統計",
"description": "",
"image_display_url": "https://yamaguchi-opendata.jp/ckan/uploads/group/2019-05-27-073536.626757icon150cat11on.png",
"title": "統計",
"id": "249ff95d-dd3a-4dfc-b5da-2e35d618e59f",
"name": "c011"
}
],
"license_id": "cc-by",
"relationships_as_subject": [
],
"organization": {
"description": "",
"created": "2019-05-27T14:59:38.472171",
"title": "山口県",
"name": "35000",
"is_organization": true,
"state": "active",
"image_url": "",
"revision_id": "af3eb3ed-7586-48ce-a56b-f31abf88a8ba",
"type": "organization",
"id": "28286db3-e08d-48b1-b480-89b8d93842f7",
"approval_status": "approved"
},
"name": "juuminkihondaichou",
"isopen": true,
"url": "",
"notes": "山口県内の地域・年齢別人口です。\r\n住民基本台帳年報に基づく人口、人口動態及び世帯数について、県下市町ごとの集計値を掲載しています。\r\n\r\n(令和3年1月1日時点)\r\n\r\n<補足事項>\r\n\r\n住民基本台帳人口とは、住民基本台帳法(昭和42年法律第81号)に基づき、市町村に備えてある住民基本台帳に記録されている住民の人口です。",
"owner_org": "28286db3-e08d-48b1-b480-89b8d93842f7",
"extras": [
],
"license_url": "https://creativecommons.org/licenses/by/4.0/deed.ja",
"title": "【山口県】地域・年齢別人口",
"revision_id": "bae999a3-4380-4a64-a837-122416ff78c6"
}
],
"search_facets": {
}
}
}
リソース検索
API
resource_search
メソッド
GET
エンドポイント
https://yamaguchi-opendata.jp/ckan/api/3/action/resource_search
パラメタ
名前 | 説明 |
query |
検索キーワード [例:name:食品] リソース名に食品が含まれる |
レスポンス
{
"help": "https://yamaguchi-opendata.jp/ckan/api/3/action/help_show?name=resource_search",
"success": true,
"result": {
"count": 2,
"results": [
{
"mimetype": null,
"cache_url": null,
"state": "active",
"hash": "",
"description": "https://www.pref.yamaguchi.lg.jp/soshiki/39/19471.html",
"format": "",
"url": "",
"created": "2024-06-05T08:33:44.515498",
"cache_last_updated": null,
"package_id": "26e7b4d2-38b6-4dd9-ac94-a46790e31ca9",
"mimetype_inner": null,
"last_modified": null,
"position": 0,
"revision_id": "3dc7f170-7e9c-4d6b-9563-ab3b7c722ea8",
"size": null,
"url_type": null,
"id": "58e3e196-8159-4525-aa88-ff2a704ad9dd",
"resource_type": null,
"name": "食品営業許可・届出一覧"
},
{
"mimetype": null,
"cache_url": null,
"state": "active",
"hash": "",
"description": "",
"format": "HTML",
"url": "https://yamaguchi-opendata.jp/ckan/dataset/food-business",
"created": "2024-05-30T01:24:54.664782",
"cache_last_updated": null,
"package_id": "45cd8553-614b-441d-ba61-5c779120360f",
"mimetype_inner": null,
"last_modified": null,
"position": 0,
"revision_id": "a9347487-3f56-49fc-86bd-d4343cf731ae",
"size": null,
"url_type": null,
"id": "05b83ebe-f431-45a6-9678-96e97a872e47",
"resource_type": null,
"name": "【山口県】食品営業許可施設情報一覧"
}}
最近更新されたデータセット一覧
API
current_package_list_with_resources
メソッド
GET
エンドポイント
https://yamaguchi-opendata.jp/ckan/api/3/action/current_package_list_with_resources
パラメタ
名前 | 説明 |
limit |
検索結果の取得数 |
offset |
検索結果の取得位置 |
レスポンス
{
"help": "https://yamaguchi-opendata.jp/ckan/api/3/action/help_show?name=current_package_list_with_resources",
"success": true,
"result": [
{
"license_title": "Creative Commons Attribution",
"maintainer": "山口県警察本部地域企画課",
"relationships_as_object": [
],
"private": false,
"maintainer_email": "",
"num_tags": 1,
"id": "513e4ec1-62c0-45d3-88fc-e34dc9dfdf15",
"metadata_created": "2023-10-04T00:47:29.594203",
"metadata_modified": "2024-07-11T08:45:04.426937",
"author": "山口県警察本部地域企画課",
"author_email": "",
"state": "active",
"version": "",
"creator_user_id": "733a7b76-e22b-4b55-889a-887727b2dde2",
"type": "dataset",
"resources": [
{
"mimetype": null,
"cache_url": null,
"hash": "",
"description": " 令和5年中に警察に寄せられた「熊の目撃情報」及び「熊の痕跡発見情報」をもとに作成したものです。\r\n 熊の出没場所付近において、重点的にパトロールをしていますが、付近を行動する際は、十分に注意してください。\r\n 山口県内における熊の目撃情報に関して、他機関が公表している件数、場所等と異なる場合があります。",
"name": "YPくまっぷ(2023)",
"format": "CSV",
"url": "https://yamaguchi-opendata.jp/ckan/dataset/513e4ec1-62c0-45d3-88fc-e34dc9dfdf15/resource/717fffbb-665f-48a1-9119-dcdb9921589f/download/-04011230.csv",
"cache_last_updated": null,
"package_id": "513e4ec1-62c0-45d3-88fc-e34dc9dfdf15",
"created": "2023-10-04T00:53:52.232719",
"state": "active",
"mimetype_inner": null,
"last_modified": "2024-01-04T00:54:23.387887",
"position": 0,
"revision_id": "c313cf35-bf57-439f-b7a5-11d2664bfafb",
"url_type": "upload",
"id": "717fffbb-665f-48a1-9119-dcdb9921589f",
"resource_type": null,
"size": null
}
],
"num_resources": 1,
"tags": [
{
"vocabulary_id": null,
"state": "active",
"display_name": "位置情報",
"id": "0300b122-f3ca-4309-832b-663033c946ab",
"name": "位置情報"
}
],
"groups": [
{
"display_name": "防災・防犯",
"description": "",
"image_display_url": "https://yamaguchi-opendata.jp/ckan/uploads/group/2019-05-27-073557.863653icon150cat12on.png",
"title": "防災・防犯",
"id": "aa6519f6-1993-4655-8df4-e0b4568019dc",
"name": "c012"
}
],
"license_id": "cc-by",
"relationships_as_subject": [
],
"organization": {
"description": "",
"created": "2019-05-27T14:59:38.472171",
"title": "山口県",
"name": "35000",
"is_organization": true,
"state": "active",
"image_url": "",
"revision_id": "af3eb3ed-7586-48ce-a56b-f31abf88a8ba",
"type": "organization",
"id": "28286db3-e08d-48b1-b480-89b8d93842f7",
"approval_status": "approved"
},
"name": "bear2023",
"isopen": true,
"url": "",
"notes": "令和5年中に警察に寄せられた「熊の目撃情報」及び「熊の痕跡発見情報」です。",
"owner_org": "28286db3-e08d-48b1-b480-89b8d93842f7",
"extras": [
],
"license_url": "https://creativecommons.org/licenses/by/4.0/deed.ja",
"title": "熊の目撃情報(山口県警察認知のもの)",
"revision_id": "4ccc98fd-4a54-4d6e-b5f4-eed66f35661e"
}
}