CKAN Data API

Pristupi podacima resursa putem veb API-ja za moćnom podrškom za upite. Further information in the main CKAN Data API and DataStore documentation.

Krajnje tačke »

The Data API can be accessed via the following actions of the CKAN action API.

Upit https://1f8zn7l3f0.execute-api.ap-northeast-1.amazonaws.com/master/ckan/api/3/action/datastore_search
Postavljanje upita »
Primer upita (prvih 5 rezultata)

https://1f8zn7l3f0.execute-api.ap-northeast-1.amazonaws.com/master/ckan/api/3/action/datastore_search?resource_id=0c9dc13c-b9d4-40a2-8ad2-c1c97cf4eb76&limit=5

Primer upita (rezultati koji sadrže 'jones')

https://1f8zn7l3f0.execute-api.ap-northeast-1.amazonaws.com/master/ckan/api/3/action/datastore_search?resource_id=0c9dc13c-b9d4-40a2-8ad2-c1c97cf4eb76&limit=5

Primer: Javascript »

Jednostavan ajax (JSONP) zahtev za API podatke koristeći jQuery.

        var data = {
          resource_id: '0c9dc13c-b9d4-40a2-8ad2-c1c97cf4eb76', // the resource id
          limit: 5, // get 5 results
          q: 'jones' // query for 'jones'
        };
        $.ajax({
          url: 'https://1f8zn7l3f0.execute-api.ap-northeast-1.amazonaws.com/master/ckan/api/3/action/datastore_search',
          data: data,
          dataType: 'jsonp',
          success: function(data) {
            alert('Total results found: ' + data.result.total)
          }
        });
Primer: Python »
      import urllib
      url = 'https://1f8zn7l3f0.execute-api.ap-northeast-1.amazonaws.com/ja/api/3/action/datastore_search?resource_id=0c9dc13c-b9d4-40a2-8ad2-c1c97cf4eb76&limit=5&q=title:jones'  
      fileobj = urllib.urlopen(url)
      print fileobj.read()