CKAN Data API

パワフルなクエリサポートがあるweb APIを通してリソースデータにアクセス. Further information in the main CKAN Data API and DataStore documentation.

エンドポイント »

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

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

https://opendata-bc.gov.ua/ja/api/3/action/datastore_search?resource_id=e633ecda-54ec-42b9-b8af-98121479bd3b&limit=5

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

https://opendata-bc.gov.ua/ja/api/3/action/datastore_search?q=jones&resource_id=e633ecda-54ec-42b9-b8af-98121479bd3b

クエリ例 (SQL文使用)

https://opendata-bc.gov.ua/ja/api/3/action/datastore_search_sql?sql=SELECT * from "e633ecda-54ec-42b9-b8af-98121479bd3b" WHERE title LIKE 'jones'

例: Javascript »

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

        var data = {
          resource_id: 'e633ecda-54ec-42b9-b8af-98121479bd3b', // the resource id
          limit: 5, // get 5 results
          q: 'jones' // query for 'jones'
        };
        $.ajax({
          url: 'https://opendata-bc.gov.ua/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-bc.gov.ua/ja/api/3/action/datastore_search?resource_id=e633ecda-54ec-42b9-b8af-98121479bd3b&limit=5&q=title:jones'  
      fileobj = urllib.urlopen(url)
      print fileobj.read()