Приступи подацима ресурса путем веб АПИ-ја за моћном подршком за упите. Додатне информације на главна CKAN Data API и DataStore документација.
The Data API can be accessed via the following actions of the CKAN action API.
Креирај | https://repo.dainst.org/sr/api/3/action/datastore_create |
---|---|
Ажурирај / Убаци | https://repo.dainst.org/sr/api/3/action/datastore_upsert |
Упит | https://repo.dainst.org/sr/api/3/action/datastore_search |
Једноставан ajax (JSONP) захтев за API податке користећи jQuery.
var data = { resource_id: 'dee59421-e97f-45cb-8dc4-dba04ea8ab0b', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'https://repo.dainst.org/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://repo.dainst.org/sr/api/3/action/datastore_search?resource_id=dee59421-e97f-45cb-8dc4-dba04ea8ab0b&limit=5&q=title:jones' fileobj = urllib.request.urlopen(url) print(fileobj.read())