גשו למשאב מידע דרך API מקוון עם תמיכה בשאילתות מורכבות. Further information in the main CKAN Data API and DataStore documentation.
ה-API של המידע יכול להתקבל באמצעות הפעולות הבאות של API פעולות של CKAN.
צרו | https://lincolnshire.ckan.io/he/api/3/action/datastore_create |
---|---|
הוסיפו/עדכנו | https://lincolnshire.ckan.io/he/api/3/action/datastore_upsert |
שאילתה | https://lincolnshire.ckan.io/he/api/3/action/datastore_search |
שאילתה (באמצעות SQL) | https://lincolnshire.ckan.io/he/api/3/action/datastore_search_sql |
בקשת ajax (JSONP) ל-API מידע באמצעות jQuery.
var data = { resource_id: '1157d68e-d7f6-4ae2-b099-ad7322d81acd', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'https://lincolnshire.ckan.io/he/api/3/action/datastore_search', data: data, dataType: 'jsonp', success: function(data) { alert('Total results found: ' + data.result.total) } });
import urllib url = 'https://lincolnshire.ckan.io/he/api/3/action/datastore_search?resource_id=1157d68e-d7f6-4ae2-b099-ad7322d81acd&limit=5&q=title:jones' fileobj = urllib.urlopen(url) print fileobj.read()