Pristup resursima podataka kroz web API uz široku podršku upita. Further information in the main CKAN Data API and DataStore documentation.
API-ju podataka je moguće pristupiti korištenjem CKAN API akcija
Kreiraj | https://gdcatalognhic.nha.co.th/hr/api/3/action/datastore_create |
---|---|
Ažuriraj / Umetni | https://gdcatalognhic.nha.co.th/hr/api/3/action/datastore_upsert |
Upit | https://gdcatalognhic.nha.co.th/hr/api/3/action/datastore_search |
Jednostavan ajax (JSONP) upit prema API-ju podataka korištenjem jQuery.
var data = { resource_id: '0fe6fafc-758f-46ba-b7bd-4e3d1dcbe58b', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'https://gdcatalognhic.nha.co.th/hr/api/3/action/datastore_search', data: data, dataType: 'jsonp', success: function(data) { alert('Total results found: ' + data.result.total) } });
import urllib url = 'https://gdcatalognhic.nha.co.th/hr/api/3/action/datastore_search?limit=5&resource_id=0fe6fafc-758f-46ba-b7bd-4e3d1dcbe58b&q=title:jones' fileobj = urllib.urlopen(url) print fileobj.read()