Zugriff auf Ressourcen per Web-Schnittstelle mit umfangreichen Suchmöglichkeiten. Further information in the main CKAN Data API and DataStore documentation.
Die Daten-Schnittstelle (Data-API) kann über folgende Schnittstellenbefehle der CKAN Action API erreicht werden.
Erstellen | https://catalog.citydata.in.th/de/api/3/action/datastore_create |
---|---|
Aktualisieren / Einfügen | https://catalog.citydata.in.th/de/api/3/action/datastore_upsert |
Abfrage | https://catalog.citydata.in.th/de/api/3/action/datastore_search |
Abfrage (mit SQL) | https://catalog.citydata.in.th/de/api/3/action/datastore_search_sql |
https://catalog.citydata.in.th/de/api/3/action/datastore_search?resource_id=16e603f7-54de-4e45-9c7d-f79952415f29&limit=5
https://catalog.citydata.in.th/de/api/3/action/datastore_search?q=jones&resource_id=16e603f7-54de-4e45-9c7d-f79952415f29
https://catalog.citydata.in.th/de/api/3/action/datastore_search_sql?sql=SELECT * from "16e603f7-54de-4e45-9c7d-f79952415f29" WHERE title LIKE 'jones'
Eine einfache AJAX (JSONP) Abfrage des Data API mit jQuery.
var data = { resource_id: '16e603f7-54de-4e45-9c7d-f79952415f29', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'https://catalog.citydata.in.th/de/api/3/action/datastore_search', data: data, dataType: 'jsonp', success: function(data) { alert('Total results found: ' + data.result.total) } });
import urllib url = 'https://catalog.citydata.in.th/de/api/3/action/datastore_search?resource_id=16e603f7-54de-4e45-9c7d-f79952415f29&limit=5&q=title:jones' fileobj = urllib.urlopen(url) print fileobj.read()