CKAN Data API

パワフルなクエリサポートがあるweb APIを通してリソースデータにアクセス. より詳しい情報は main CKAN Data API and DataStore documentationを参照してください。

エンドポイント »

Data APIはCKAN action APIの次のようなアクションを通してアクセスすることができます。

作成 https://opendata.ugr.es/ja/api/3/action/datastore_create
更新 / 挿入 https://opendata.ugr.es/ja/api/3/action/datastore_upsert
クエリ https://opendata.ugr.es/ja/api/3/action/datastore_search
クエリ (SQL使用) https://opendata.ugr.es/ja/api/3/action/datastore_search_sql
クエリ »
クエリ例 (最初の5件)

https://opendata.ugr.es/ja/api/3/action/datastore_search?resource_id=3df8755c-7706-4328-b498-31465f4edd0a&limit=5

クエリ例 ('jones'を含む結果)

https://opendata.ugr.es/ja/api/3/action/datastore_search?resource_id=3df8755c-7706-4328-b498-31465f4edd0a&q=jones

クエリ例 (SQL文使用)

https://opendata.ugr.es/ja/api/3/action/datastore_search_sql?sql=SELECT * from "3df8755c-7706-4328-b498-31465f4edd0a" WHERE title LIKE 'jones'

例: Javascript »

jQueryを使用したdata APIへの単純なajax (JSONP) リクエスト

        var data = {
          resource_id: '3df8755c-7706-4328-b498-31465f4edd0a', // the resource id
          limit: 5, // get 5 results
          q: 'jones' // query for 'jones'
        };
        $.ajax({
          url: 'https://opendata.ugr.es/ja/api/3/action/datastore_search',
          data: data,
          dataType: 'jsonp',
          success: function(data) {
            alert('Total results found: ' + data.result.total)
          }
        });
例: Python »
      import urllib
      url = 'https://opendata.ugr.es/ja/api/3/action/datastore_search?resource_id=3df8755c-7706-4328-b498-31465f4edd0a&limit=5&q=title:jones'  
      fileobj = urllib.urlopen(url)
      print fileobj.read()