Pristupi podacima resursa putem veb API-ja za moćnom podrškom za upite. Further information in the main CKAN Data API and DataStore documentation.
The Data API can be accessed via the following actions of the CKAN action API.
Kreiraj | https://sac.gdcatalog.go.th/sr_Latn/api/3/action/datastore_create |
---|---|
Ažuriraj / Ubaci | https://sac.gdcatalog.go.th/sr_Latn/api/3/action/datastore_upsert |
Upit | https://sac.gdcatalog.go.th/sr_Latn/api/3/action/datastore_search |
Jednostavan ajax (JSONP) zahtev za API podatke koristeći jQuery.
var data = { resource_id: 'c0b05360-7db5-421e-b3c8-9e196c04d3a9', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'https://sac.gdcatalog.go.th/sr_Latn/api/3/action/datastore_search', data: data, dataType: 'jsonp', success: function(data) { alert('Total results found: ' + data.result.total) } });
import urllib url = 'https://sac.gdcatalog.go.th/sr_Latn/api/3/action/datastore_search?limit=5&resource_id=c0b05360-7db5-421e-b3c8-9e196c04d3a9&q=title:jones' fileobj = urllib.urlopen(url) print fileobj.read()