Приступи подацима ресурса путем веб АПИ-ја за моћном подршком за упите. Додатне информације на главна CKAN Data API и DataStore документација.
The Data API can be accessed via the following actions of the CKAN action API.
Креирај | https://data.thaihealth.or.th/sr/api/3/action/datastore_create |
---|---|
Ажурирај / Убаци | https://data.thaihealth.or.th/sr/api/3/action/datastore_upsert |
Упит | https://data.thaihealth.or.th/sr/api/3/action/datastore_search |
Једноставан ajax (JSONP) захтев за API податке користећи jQuery.
var data = { resource_id: '1377d7f1-17ee-4093-b9e1-a0c14fc03b02', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'https://data.thaihealth.or.th/sr/api/3/action/datastore_search', data: data, dataType: 'jsonp', success: function(data) { alert('Total results found: ' + data.result.total) } });
import urllib.request url = 'https://data.thaihealth.or.th/sr/api/3/action/datastore_search?resource_id=1377d7f1-17ee-4093-b9e1-a0c14fc03b02&limit=5&q=title:jones' fileobj = urllib.request.urlopen(url) print(fileobj.read())