Open Data Gateway
Saraburi Energy Hub API

ระบบศูนย์กลางข้อมูล Open Data API

บริการข้อมูลสารสนเทศและตู้ชาร์จไฟฟ้า EV ในจังหวัดสระบุรี เพื่อการนำข้อมูลไปประยุกต์ใช้งานวิเคราะห์หรือพัฒนาโปรแกรมต่อยอด

CORS Enabled (*)No Auth Required

API Endpoint ทั้งหมด

GET/api/public/stations

ดึงรายการสถานีบริการพลังงานทั้งหมดในจังหวัดสระบุรี ครอบคลุมข้อมูลแบรนด์ ประเภทสถานี ละติจูด ลองจิจูด ประเภทพลังงาน และรายละเอียดตู้ชาร์จไฟฟ้า EV อย่างครบถ้วน

Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
Cache-Control: public, max-age=3600 (แคช 1 ชม.)

คำอธิบายฟิลด์ข้อมูล (Data Schema)

ฟิลด์ข้อมูล (Field)ประเภท (Type)รายละเอียดคำอธิบาย (Description)
idstring (UUID)รหัส ID อ้างอิงของสถานีในระบบ
namestringชื่อสถานีบริการพลังงาน (เช่น ปตท. สาขาแก่งคอย)
amphoestringอำเภอที่ตั้งของสถานี (เช่น เมืองสระบุรี, แก่งคอย)
tambonstringตำบลที่ตั้งของสถานี
latitudenumberพิกัดทางภูมิศาสตร์ ละติจูด (Latitude)
longitudenumberพิกัดทางภูมิศาสตร์ ลองจิจูด (Longitude)
energy_typesarray[string]ประเภทเชื้อเพลิง/พลังงาน ได้แก่ `OIL`, `LPG`, `NGV`, `EV`
has_ev_chargerbooleanมีตู้ชาร์จ/เครื่องชาร์จรถยนต์ไฟฟ้าให้บริการ (true/false)
chargersarray[object]รายการตู้ชาร์จ ประกอบด้วย: ประเภทหัวจ่าย, ขนาดกำลังไฟ (kW), และจำนวนหัวชาร์จ
brandobjectข้อมูลแบรนด์ปั๊ม (ชื่อแบรนด์, ชื่อย่อ, ลิงก์โลโก้)
station_typeobjectประเภทบริการของสถานี (ปั๊มน้ำมัน/สถานีบริการ หรือ ศูนย์ชาร์จ EV ล้วน)

ตัวอย่างการเรียกใช้งาน (Code Samples)

JavaScript (Fetch API)
fetch('https://energy.saraburidev.org/api/public/stations')
  .then(response => response.json())
  .then(json => {
    console.log("พบสถานีบริการทั้งหมด: " + json.metadata.total_records + " สถานี");
    console.log(json.data); // รายชื่อสถานีพร้อมข้อมูลตู้ชาร์จ EV
  })
  .catch(err => console.error("Error fetching data:", err));
Python (Requests)
import requests

url = "https://energy.saraburidev.org/api/public/stations"
response = requests.get(url)

if response.status_code == 200:
    json_data = response.json()
    print(f"Total: {json_data['metadata']['total_records']} records")
    for station in json_data['data']:
        print(station['name'], "EV Charger:", station['has_ev_charger'])

รูปแบบ JSON ผลลัพธ์ (Response JSON)

{
  "metadata": {
    "title": "ข้อมูลสถานีบริการพลังงาน จังหวัดสระบุรี",
    "description": "ข้อมูลตำแหน่งสถานีบริการน้ำมัน ก๊าซ LPG/NGV และสถานีชาร์จ EV",
    "publisher": "สำนักงานพลังงานจังหวัดสระบุรี",
    "format": "JSON",
    "total_records": 1
  },
  "data": [
    {
      "id": "5c8c44d7-cc96-466d-b8f8-840ceae2de12",
      "name": "บริษัท โสภาแก๊สออยล์ เทรดดิ้ง จำกัด",
      "station_type": {
        "name": "ปั๊มพลังงาน",
        "icon": "⛽"
      },
      "brand": {
        "name": "ปตท. / PTT",
        "short_name": "PTT",
        "logo_url": "/brands/logo_ptt.png"
      },
      "energy_types": [
        "OIL",
        "EV"
      ],
      "latitude": 14.5407588674883,
      "longitude": 100.926654083827,
      "tambon": "ตะกุด",
      "amphoe": "เมืองสระบุรี",
      "address_details": "ริมถนนมิตรภาพ",
      "has_ev_charger": true,
      "chargers": [
        {
          "charger_type": "CCS2",
          "power_kw": 120.0,
          "plug_count": 2
        },
        {
          "charger_type": "AC Type 2",
          "power_kw": 22.0,
          "plug_count": 1
        }
      ],
      "image_url": "https://...",
      "created_at": "2026-07-14T01:33:00.000Z",
      "updated_at": "2026-07-14T01:33:00.000Z"
    }
  ]
}