Få tilgang til ressursdata via et web-API med sterk query-støtte. Further information in the main CKAN Data API and DataStore documentation.
Data-APIet kan nås via disse handlingene til CKANs action-API.
Opprett | https://trat.gdcatalog.go.th/nb_NO/api/3/action/datastore_create |
---|---|
Oppdater/legg til | https://trat.gdcatalog.go.th/nb_NO/api/3/action/datastore_upsert |
Spørring | https://trat.gdcatalog.go.th/nb_NO/api/3/action/datastore_search |
En enkelt ajax (JSONP) forespørsel til data-APIet ved bruk av jQuery
var data = { resource_id: '7c86ce97-3cc6-45b8-a012-76c212db011e', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'https://trat.gdcatalog.go.th/nb_NO/api/3/action/datastore_search', data: data, dataType: 'jsonp', success: function(data) { alert('Total results found: ' + data.result.total) } });
import urllib url = 'https://trat.gdcatalog.go.th/nb_NO/api/3/action/datastore_search?limit=5&resource_id=7c86ce97-3cc6-45b8-a012-76c212db011e&q=title:jones' fileobj = urllib.urlopen(url) print fileobj.read()