גשו למשאב מידע דרך API מקוון עם תמיכה בשאילתות מורכבות. Further information in the main CKAN Data API and DataStore documentation.
ה-API של המידע יכול להתקבל באמצעות הפעולות הבאות של API פעולות של CKAN.
צרו | https://ckan.hoda.jp/he/api/3/action/datastore_create |
---|---|
הוסיפו/עדכנו | https://ckan.hoda.jp/he/api/3/action/datastore_upsert |
שאילתה | https://ckan.hoda.jp/he/api/3/action/datastore_search |
שאילתה (באמצעות SQL) | https://ckan.hoda.jp/he/api/3/action/datastore_search_sql |
https://ckan.hoda.jp/he/api/3/action/datastore_search?resource_id=513b2d91-0a3a-441e-b18e-1e4c8595e79b&limit=5
https://ckan.hoda.jp/he/api/3/action/datastore_search?resource_id=513b2d91-0a3a-441e-b18e-1e4c8595e79b&q=jones
https://ckan.hoda.jp/he/api/3/action/datastore_search_sql?sql=SELECT * from "513b2d91-0a3a-441e-b18e-1e4c8595e79b" WHERE title LIKE 'jones'
בקשת ajax (JSONP) ל-API מידע באמצעות jQuery.
var data = { resource_id: '513b2d91-0a3a-441e-b18e-1e4c8595e79b', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'https://ckan.hoda.jp/he/api/3/action/datastore_search', data: data, dataType: 'jsonp', success: function(data) { alert('Total results found: ' + data.result.total) } });
import urllib url = 'https://ckan.hoda.jp/he/api/3/action/datastore_search?resource_id=513b2d91-0a3a-441e-b18e-1e4c8595e79b&limit=5&q=title:jones' fileobj = urllib.urlopen(url) print fileobj.read()