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=e9ebab00-e02b-4f7c-a72c-3ae294ef83ae&limit=5

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

https://otwartedane.lublin.eu/pl/api/3/action/datastore_search?q=jones&resource_id=e9ebab00-e02b-4f7c-a72c-3ae294ef83ae

Przykład kwerendy (za pomocą instrukcji SQL)

https://otwartedane.lublin.eu/pl/api/3/action/datastore_search_sql?sql=SELECT * from "e9ebab00-e02b-4f7c-a72c-3ae294ef83ae" WHERE title LIKE 'jones'

Przykład: Javascript »

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

        var data = {
          resource_id: 'e9ebab00-e02b-4f7c-a72c-3ae294ef83ae', // 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=e9ebab00-e02b-4f7c-a72c-3ae294ef83ae&limit=5&q=title:jones'  
      fileobj = urllib.urlopen(url)
      print fileobj.read()