Өндөр түвшний хайлт хийх боломж бүхий веб API-н тусламжтайгаар нөөц өгөгдөлд хандана. Further information in the main CKAN Data API and DataStore documentation.
API-н өгөгдөлд CKAN болон API-н үйлдлээр дамжиж хандах боломжтой.
Үүсгэх | https://ckan.hoda.jp/mn_MN/api/3/action/datastore_create |
---|---|
Шинэчлэх/ Оруулах | https://ckan.hoda.jp/mn_MN/api/3/action/datastore_upsert |
Хүсэлт | https://ckan.hoda.jp/mn_MN/api/3/action/datastore_search |
Хүсэлт (SQL - ээр) | https://ckan.hoda.jp/mn_MN/api/3/action/datastore_search_sql |
https://ckan.hoda.jp/mn_MN/api/3/action/datastore_search?resource_id=cdb2b97c-16d2-4575-853d-e35b4fef7a98&limit=5
https://ckan.hoda.jp/mn_MN/api/3/action/datastore_search?resource_id=cdb2b97c-16d2-4575-853d-e35b4fef7a98&q=jones
https://ckan.hoda.jp/mn_MN/api/3/action/datastore_search_sql?sql=SELECT * from "cdb2b97c-16d2-4575-853d-e35b4fef7a98" WHERE title LIKE 'jones'
jQuery ашиглан өгөгдлийн API-д хандах энгийн ajax хүсэлт (JSONP).
var data = { resource_id: 'cdb2b97c-16d2-4575-853d-e35b4fef7a98', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'https://ckan.hoda.jp/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://ckan.hoda.jp/mn_MN/api/3/action/datastore_search?resource_id=cdb2b97c-16d2-4575-853d-e35b4fef7a98&limit=5&q=title:jones' fileobj = urllib.urlopen(url) print fileobj.read()