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: '44ed6e6a-b8a2-494c-950b-0bdba11e8034', // 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=44ed6e6a-b8a2-494c-950b-0bdba11e8034&q=title:jones' fileobj = urllib.urlopen(url) print fileobj.read()