パワフルなクエリサポートがあるweb APIを通してリソースデータにアクセス. より詳しい情報は main CKAN Data API and DataStore documentationを参照してください。
Data APIはCKAN action APIの次のようなアクションを通してアクセスすることができます。
作成 | https://plymouth.thedata.place/ja/api/3/action/datastore_create |
---|---|
更新 / 挿入 | https://plymouth.thedata.place/ja/api/3/action/datastore_upsert |
クエリ | https://plymouth.thedata.place/ja/api/3/action/datastore_search |
jQueryを使用したdata APIへの単純なajax (JSONP) リクエスト
var data = { resource_id: 'c542047a-d2f5-4874-8ab3-cab02af0c773', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'https://plymouth.thedata.place/ja/api/3/action/datastore_search', data: data, dataType: 'jsonp', success: function(data) { alert('Total results found: ' + data.result.total) } });
import urllib.request url = 'https://plymouth.thedata.place/ja/api/3/action/datastore_search?resource_id=c542047a-d2f5-4874-8ab3-cab02af0c773&limit=5&q=title:jones' fileobj = urllib.request.urlopen(url) print(fileobj.read())