Dostęp do zbiorów danych poprzez API ze wsparciem wyszukiwania.. Dalsze informacje w w dokumentacji CKAN Data API oraz DataStore.
Zbiory danych są dostępne poprzez API z użyciem następujących metod:
Utwórz | https://otwartedane.gdynia.pl/api/action/datastore_create |
---|---|
Aktualizuj / Wstaw | https://otwartedane.gdynia.pl/api/action/datastore_upsert |
Zapytanie | https://otwartedane.gdynia.pl/api/action/datastore_search |
Zapytanie (przez SQL) | https://otwartedane.gdynia.pl/api/action/datastore_search_sql |
Proste zapytanie o dane ajax (JSONP) przy użyciu jQuery.
var data = { resource_id: '4e64844a-aceb-4a93-a0e5-ff0da61ec6b8', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'https://otwartedane.gdynia.pl/api/action/datastore_search', data: data, dataType: 'jsonp', success: function(data) { alert('Total results found: ' + data.result.total) } });
import urllib url = 'https://otwartedane.gdynia.pl/api/action/datastore_search?resource_id=4e64844a-aceb-4a93-a0e5-ff0da61ec6b8&limit=5&q=title:jones' fileobj = urllib.urlopen(url) print fileobj.read()