Giao diện người sử dụng dữ liệu CKAN

Truy cập vào tài nguyên dữ liệu qua một web API với đây đủ hỗ trợ truy vấn.. Further information in the main CKAN Data API and DataStore documentation.

Giao diện người sử dụng dữ liệu có thể truy cập thông qua hoạt động theo dõi giao diện người sử dụng CKAN

Tạo https://ckan.himdataportal.com/vi/api/3/action/datastore_create
Cậ nhật/Chèn https://ckan.himdataportal.com/vi/api/3/action/datastore_upsert
Truy vấn https://ckan.himdataportal.com/vi/api/3/action/datastore_search
Truy vấn (thông qua ngôn ngữ truy vấn mang tính cấu trúc) https://ckan.himdataportal.com/vi/api/3/action/datastore_search_sql

Ví dụ câu hỏi (5 kết quả đầu tiên)

https://ckan.himdataportal.com/vi/api/3/action/datastore_search?resource_id=c380d1e4-bb56-41bc-9b4d-71633ac28f5b&limit=5

Ví dụ câu hỏi (kết quả có chứa "jones")

https://ckan.himdataportal.com/vi/api/3/action/datastore_search?resource_id=c380d1e4-bb56-41bc-9b4d-71633ac28f5b&q=jones

Ví dụ câu hỏi (bằng xác nhận SQL)

https://ckan.himdataportal.com/vi/api/3/action/datastore_search_sql?sql=SELECT * from "c380d1e4-bb56-41bc-9b4d-71633ac28f5b" WHERE title LIKE 'jones'

Một yêu cầu (JSONP) đơn giản đối với dữ liệu API sử dụng jQuery

          var data = {
            resource_id: 'c380d1e4-bb56-41bc-9b4d-71633ac28f5b', // the resource id
            limit: 5, // get 5 results
            q: 'jones' // query for 'jones'
          };
          $.ajax({
            url: 'https://ckan.himdataportal.com/vi/api/3/action/datastore_search',
            data: data,
            dataType: 'jsonp',
            success: function(data) {
              alert('Total results found: ' + data.result.total)
            }
          });
        import urllib.request
        url = 'https://ckan.himdataportal.com/vi/api/3/action/datastore_search?resource_id=c380d1e4-bb56-41bc-9b4d-71633ac28f5b&limit=5&q=title:jones'  
        fileobj = urllib.request.urlopen(url)
        print(fileobj.read())