Zugriff auf Ressourcen per Web-Schnittstelle mit umfangreichen Suchmöglichkeiten. Weiterführende Information in der zentralen CKAN Data API und DataStore Dokumentation.
Die Daten-Schnittstelle (Data-API) kann über folgende Schnittstellenbefehle der CKAN Action API erreicht werden.
Erstellen | http://www.opendataipres.it/de/api/3/action/datastore_create |
---|---|
Aktualisieren / Einfügen | http://www.opendataipres.it/de/api/3/action/datastore_upsert |
Abfrage | http://www.opendataipres.it/de/api/3/action/datastore_search |
Abfrage (mit SQL) | http://www.opendataipres.it/de/api/3/action/datastore_search_sql |
Eine einfache AJAX (JSONP) Abfrage des Data API mit jQuery.
var data = { resource_id: '40955d5f-9e2c-4b70-a5d6-2ee85442acaf', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'http://www.opendataipres.it/de/api/3/action/datastore_search', data: data, dataType: 'jsonp', success: function(data) { alert('Total results found: ' + data.result.total) } });
import urllib url = 'http://www.opendataipres.it/de/api/3/action/datastore_search?resource_id=40955d5f-9e2c-4b70-a5d6-2ee85442acaf&limit=5&q=title:jones' fileobj = urllib.urlopen(url) print fileobj.read()