Өндөр түвшний хайлт хийх боломж бүхий веб API-н тусламжтайгаар нөөц өгөгдөлд хандана. Further information in the main CKAN Data API and DataStore documentation.
API-н өгөгдөлд CKAN болон API-н үйлдлээр дамжиж хандах боломжтой.
Үүсгэх | https://lincolnshire.ckan.io/mn_MN/api/3/action/datastore_create |
---|---|
Шинэчлэх/ Оруулах | https://lincolnshire.ckan.io/mn_MN/api/3/action/datastore_upsert |
Хүсэлт | https://lincolnshire.ckan.io/mn_MN/api/3/action/datastore_search |
Хүсэлт (SQL - ээр) | https://lincolnshire.ckan.io/mn_MN/api/3/action/datastore_search_sql |
jQuery ашиглан өгөгдлийн API-д хандах энгийн ajax хүсэлт (JSONP).
var data = { resource_id: 'd78aa995-41d8-4a1f-9d41-0bf3e8527d9b', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'https://lincolnshire.ckan.io/mn_MN/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/mn_MN/api/3/action/datastore_search?resource_id=d78aa995-41d8-4a1f-9d41-0bf3e8527d9b&limit=5&q=title:jones' fileobj = urllib.urlopen(url) print fileobj.read()