CKAN Data API

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://datosabiertos.bogota.gov.co/de/api/3/action/datastore_create
Aktualisieren / Einfügen https://datosabiertos.bogota.gov.co/de/api/3/action/datastore_upsert
Abfrage https://datosabiertos.bogota.gov.co/de/api/3/action/datastore_search

Abfragebeispiel (erste 5 Ergebnisse)

https://datosabiertos.bogota.gov.co/de/api/3/action/datastore_search?resource_id=f6e46b8f-906b-4f2c-af8b-f8fe7b8b150e&limit=5

Abfragebeispiel (Ergebnisse die 'jones' enthalten)

https://datosabiertos.bogota.gov.co/de/api/3/action/datastore_search?resource_id=f6e46b8f-906b-4f2c-af8b-f8fe7b8b150e&q=jones

Eine einfache AJAX (JSONP) Abfrage des Data API mit jQuery.

          var data = {
            resource_id: 'f6e46b8f-906b-4f2c-af8b-f8fe7b8b150e', // the resource id
            limit: 5, // get 5 results
            q: 'jones' // query for 'jones'
          };
          $.ajax({
            url: 'https://datosabiertos.bogota.gov.co/de/api/3/action/datastore_search',
            data: data,
            dataType: 'jsonp',
            success: function(data) {
              alert('Total results found: ' + data.result.total)
            }
          });
        import urllib.request
        url = 'https://datosabiertos.bogota.gov.co/de/api/3/action/datastore_search?resource_id=f6e46b8f-906b-4f2c-af8b-f8fe7b8b150e&limit=5&q=title:jones'  
        fileobj = urllib.request.urlopen(url)
        print(fileobj.read())