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

เข้าถึงทรัพยากรข้อมูลผ่าน API ของเว็บด้วยภาษาสอบถามที่ทรงพลัง

Danh sách API »
สร้าง https://opendata.quangngai.gov.vn/th/api/3/action/datastore_create
ปรับปรุง/เพิ่ม https://opendata.quangngai.gov.vn/th/api/3/action/datastore_upsert
เรียกดูข้อมูล https://opendata.quangngai.gov.vn/th/api/3/action/datastore_search
เรียกดูข้อมูล (ผ่าน SQL) https://opendata.quangngai.gov.vn/th/api/3/action/datastore_search_sql
Ví dụ truy vấn API »
ตัวอย่างเรียกข้อมูล (5 ผลลัพธ์แรก)

https://opendata.quangngai.gov.vn/th/api/3/action/datastore_search?resource_id=c14f886e-31ea-44f6-a6ce-5686160ffe4a&limit=5

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

https://opendata.quangngai.gov.vn/th/api/3/action/datastore_search?resource_id=c14f886e-31ea-44f6-a6ce-5686160ffe4a&q=jones

ตัวอย่างเรียกข้อมูล (โดยการใช้คำสั่ง SQL)

https://opendata.quangngai.gov.vn/th/api/3/action/datastore_search_sql?sql=SELECT * from "c14f886e-31ea-44f6-a6ce-5686160ffe4a" WHERE title LIKE 'jones'

ตัวอย่าง: Javascript »

คำขอแบบ ajax (JSONP) พื้นฐาน เพื่อร้องขอข้อมูลผ่าน API โดยใช้ jQuery

        var data = {
          resource_id: 'c14f886e-31ea-44f6-a6ce-5686160ffe4a', // the resource id
          limit: 5, // get 5 results
          q: 'jones' // query for 'jones'
        };
        $.ajax({
          url: 'https://opendata.quangngai.gov.vn/th/api/3/action/datastore_search',
          data: data,
          dataType: 'jsonp',
          success: function(data) {
            alert('Total results found: ' + data.result.total)
          }
        });
ตัวอย่าง: Python »
      import urllib
      url = 'https://opendata.quangngai.gov.vn/th/api/3/action/datastore_search?resource_id=c14f886e-31ea-44f6-a6ce-5686160ffe4a&limit=5&q=title:jones'  
      fileobj = urllib.urlopen(url)
      print fileobj.read()