CKAN Data API

เข้าถึงทรัพยากรข้อมูลผ่าน API ของเว็บด้วยภาษาสอบถามที่ทรงพลัง. 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://data.pattaya.go.th/th/api/3/action/datastore_create
ปรับปรุง / เพิ่ม https://data.pattaya.go.th/th/api/3/action/datastore_upsert
เรียกดูข้อมูล https://data.pattaya.go.th/th/api/3/action/datastore_search
กำลังเรียกข้อมูล » (จำกัดผลลัพธ์ 10,000 เรคคอร์ด)
ตัวอย่างเรียกข้อมูล (5 ผลลัพธ์แรก)

https://data.pattaya.go.th/th/api/3/action/datastore_search?resource_id=637e3f68-1e22-4684-b35a-ca2bf2bada5e&limit=5

ตัวอย่างเรียกข้อมูล (ผลลัพธ์มีคำว่า 'jones')

https://data.pattaya.go.th/th/api/3/action/datastore_search?resource_id=637e3f68-1e22-4684-b35a-ca2bf2bada5e&q=jones

Example: Javascript »

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

        var data = {
          resource_id: '637e3f68-1e22-4684-b35a-ca2bf2bada5e', // the resource id
          limit: 5, // get 5 results
          q: 'jones' // query for 'jones'
        };
        $.ajax({
          url: 'https://data.pattaya.go.th/th/api/3/action/datastore_search',
          data: data,
          dataType: 'jsonp',
          success: function(data) {
            alert('Total results found: ' + data.result.total)
          }
        });
Example: Python »
      import urllib
      url = 'https://data.pattaya.go.th/th/api/3/action/datastore_search?resource_id=637e3f68-1e22-4684-b35a-ca2bf2bada5e&limit=5&q=title:jones'  
      fileobj = urllib.urlopen(url)
      print fileobj.read()