גישה למשאב מידע דרך API מקוון עם תמיכה בשאילתות מורכבות. יש מידע נוסף בתיעוד של API הנתונים של CKAN ושל ה־DataStore (מאגר נתונים).
אפשר לגשת ל־API של הנתונים דרך הפעולות הבאות של API הפעולות של CKAN.
יצירה | https://satudata.probolinggokab.go.id/he/api/3/action/datastore_create |
---|---|
הוספה / עדכון | https://satudata.probolinggokab.go.id/he/api/3/action/datastore_upsert |
שאילתה | https://satudata.probolinggokab.go.id/he/api/3/action/datastore_search |
שאילתה (באמצעות SQL) | https://satudata.probolinggokab.go.id/he/api/3/action/datastore_search_sql |
בקשת ajax (JSONP) פשוטה ל־API של הנתונים באמצעות jQuery.
var data = { resource_id: 'aee340f4-fe33-4898-ade2-9b8e305a3345', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'https://satudata.probolinggokab.go.id/he/api/3/action/datastore_search', data: data, dataType: 'jsonp', success: function(data) { alert('Total results found: ' + data.result.total) } });
import urllib url = 'https://satudata.probolinggokab.go.id/he/api/3/action/datastore_search?resource_id=aee340f4-fe33-4898-ade2-9b8e305a3345&limit=5&q=title:jones' fileobj = urllib.urlopen(url) print fileobj.read()