Приступи подацима ресурса путем веб АПИ-ја за моћном подршком за упите. Додатне информације на главна 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: '7c92b723-bd19-4d7a-a8fb-be3ee3dceb01', // 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=7c92b723-bd19-4d7a-a8fb-be3ee3dceb01&limit=5&q=title:jones' fileobj = urllib.request.urlopen(url) print(fileobj.read())