CKAN dane API

Uzyskaj dostęp do danych zasobu za pośrednictwem interfejsu API z zaawansowaną obsługą zapytań. Further information in the main CKAN Data API and DataStore documentation.

Endpoints »

Dostęp do API danych można uzyskać za pośrednictwem interfejsu API akcji CKAN.

Stwórz https://otwartedane.lublin.eu/pl/api/3/action/datastore_create
Aktualizuj / Wstaw https://otwartedane.lublin.eu/pl/api/3/action/datastore_upsert
Kwerenda https://otwartedane.lublin.eu/pl/api/3/action/datastore_search
Kwerenda (przez SQL) https://otwartedane.lublin.eu/pl/api/3/action/datastore_search_sql
Kwerendowanie »
Przykład kwerendy (5 pierwszych wyników)

https://otwartedane.lublin.eu/pl/api/3/action/datastore_search?resource_id=2ea8e9f9-e4a3-41c1-92e4-e0f3f9396b61&limit=5

Przykład kwerendy (wyniki zawierające „jones”)

https://otwartedane.lublin.eu/pl/api/3/action/datastore_search?q=jones&resource_id=2ea8e9f9-e4a3-41c1-92e4-e0f3f9396b61

Przykład kwerendy (za pomocą instrukcji SQL)

https://otwartedane.lublin.eu/pl/api/3/action/datastore_search_sql?sql=SELECT * from "2ea8e9f9-e4a3-41c1-92e4-e0f3f9396b61" WHERE title LIKE 'jones'

Przykład: Javascript »

Proste żądanie AJAX (JSONP) do interfejsu danych API przy użyciu jQuery.

        var data = {
          resource_id: '2ea8e9f9-e4a3-41c1-92e4-e0f3f9396b61', // the resource id
          limit: 5, // get 5 results
          q: 'jones' // query for 'jones'
        };
        $.ajax({
          url: 'https://otwartedane.lublin.eu/pl/api/3/action/datastore_search',
          data: data,
          dataType: 'jsonp',
          success: function(data) {
            alert('Total results found: ' + data.result.total)
          }
        });
Przykład: Python »
      import urllib
      url = 'https://otwartedane.lublin.eu/pl/api/3/action/datastore_search?resource_id=2ea8e9f9-e4a3-41c1-92e4-e0f3f9396b61&limit=5&q=title:jones'  
      fileobj = urllib.urlopen(url)
      print fileobj.read()