Opnaðu tilfangsgögn í gegnum nettengt API með öflugum leitarstuðningi. Further information in the main CKAN Data API and DataStore documentation.
Hægt er opna Data API með eftirfarandi aðgerðum CKAN action API.
Stofna | https://catalog.fda.moph.go.th/is/api/3/action/datastore_create |
---|---|
Uppfæra / Færa inn | https://catalog.fda.moph.go.th/is/api/3/action/datastore_upsert |
Fyrirspurn | https://catalog.fda.moph.go.th/is/api/3/action/datastore_search |
Einföld ajax (JSONP) fyrirspurn til data API með jQuery.
var data = { resource_id: '124bd353-1d1a-46f3-b87f-cd99814e8cf2', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'https://catalog.fda.moph.go.th/is/api/3/action/datastore_search', data: data, dataType: 'jsonp', success: function(data) { alert('Total results found: ' + data.result.total) } });
import urllib url = 'https://catalog.fda.moph.go.th/is/api/3/action/datastore_search?limit=5&resource_id=124bd353-1d1a-46f3-b87f-cd99814e8cf2&q=title:jones' fileobj = urllib.urlopen(url) print fileobj.read()