CKAN Data API

Access resource data via a web API with powerful query support. Further information in the main CKAN Data API and DataStore documentation.

נקודות קצה »

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

צרו https://jaljulye.datacity.org.il/he/api/3/action/datastore_create
הוסיפו/עדכנו https://jaljulye.datacity.org.il/he/api/3/action/datastore_upsert
שאילתה https://jaljulye.datacity.org.il/he/api/3/action/datastore_search
שאילתה (באמצעות SQL) https://jaljulye.datacity.org.il/he/api/3/action/datastore_search_sql
ביצוע שאילתה »
דוגמה לשאילתה (5 התוצאות הראשונות)

https://jaljulye.datacity.org.il/he/api/3/action/datastore_search?resource_id=ab113951-195d-4c3d-a848-332b282bbf74&limit=5

דוגמה לשאילתה (תוצאות שכוללות 'jones')

https://jaljulye.datacity.org.il/he/api/3/action/datastore_search?q=jones&resource_id=ab113951-195d-4c3d-a848-332b282bbf74

דוגמה לשאילתה (באמצעות מידע SQL)

https://jaljulye.datacity.org.il/he/api/3/action/datastore_search_sql?sql=SELECT * from "ab113951-195d-4c3d-a848-332b282bbf74" WHERE title LIKE 'jones'

דוגמה: ג'אווה סקריפט »

A simple ajax (JSONP) request to the data API using jQuery.

        var data = {
          resource_id: 'ab113951-195d-4c3d-a848-332b282bbf74', // the resource id
          limit: 5, // get 5 results
          q: 'jones' // query for 'jones'
        };
        $.ajax({
          url: 'https://jaljulye.datacity.org.il/he/api/3/action/datastore_search',
          data: data,
          dataType: 'jsonp',
          success: function(data) {
            alert('Total results found: ' + data.result.total)
          }
        });
לדוגמא: פייתון »
      import urllib
      url = 'https://jaljulye.datacity.org.il/he/api/3/action/datastore_search?resource_id=ab113951-195d-4c3d-a848-332b282bbf74&limit=5&q=title:jones'  
      fileobj = urllib.urlopen(url)
      print fileobj.read()