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 | https://data.civis.bz.it/api/action/datastore_create |
---|---|
Aktualisieren / Einfügen | https://data.civis.bz.it/api/action/datastore_upsert |
Abfrage | https://data.civis.bz.it/api/action/datastore_search |
Abfrage (mit SQL) | https://data.civis.bz.it/api/action/datastore_search_sql |
Eine einfache AJAX (JSONP) Abfrage des Data API mit jQuery.
var data = { resource_id: 'cd91e8e3-bdac-40b6-9784-ef764ee4b82a', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'https://data.civis.bz.it/api/action/datastore_search', data: data, dataType: 'jsonp', success: function(data) { alert('Total results found: ' + data.result.total) } });
import urllib url = 'https://data.civis.bz.it/api/action/datastore_search?resource_id=cd91e8e3-bdac-40b6-9784-ef764ee4b82a&limit=5&q=title:jones' fileobj = urllib.urlopen(url) print fileobj.read()