เอกสาร API อ้างอิง

GlobMaps
เอกสาร API อ้างอิง

Climate Intelligence API ระดับโปรดักชัน ข้อมูลภัยแล้งจริง (ERA5/SPEI) ระบบเฝ้าระวังโรค และข้อมูลซัพพลายเชน — ทั้งหมดด้วย API key เดียว

ขอเข้าใช้งานล่วงหน้าดูราคา

การยืนยันตัวตน

ทุก endpoint ต้องระบุ X-API-Key header — รับคีย์ได้จาก GlobMaps Dashboard

X-API-Key: <your_api_key>
Content-Type: application/json(POST only)

Base URL

PRODUCTION
https://api.globmaps.com

ต้องใช้ X-API-Key — limit ตามแผน

DASHBOARD API
https://app.globmaps.com/api

ยืนยันตัวตนด้วย Session ใช้ใน Dashboard UI

มาตราความรุนแรงภัยแล้ง (USDM / EU CDI)

LevelDescriptionScoreSPEI-1
🟡 D0แห้งผิดปกติ≥40-0.5 to -0.8
🟠 D1ภัยแล้งปานกลาง≥50-0.8 to -1.3
🔴 D2ภัยแล้งรุนแรง≥65-1.3 to -1.6
🚨 D3ภัยแล้งขั้นวิกฤต≥80-1.6 to -2.0
D4ภัยแล้งขั้นวิกฤตสูงสุด≥95< -2.0

ระดับความเสี่ยง

ต่ำ
029
ปานกลาง
3059
สูง
6079
วิกฤต
80100

Risk Score API

คะแนนความเสี่ยงแบบรวมสำหรับพิกัดใดก็ได้ ภัยแล้งใช้ข้อมูลจริง ERA5/SPEI ประเภทอื่นใช้ live feeds รวม

POST/api/risk-map/scoreREAL DATA

ดึงคะแนนความเสี่ยงแบบรวมสำหรับพิกัดใดก็ได้ รองรับภัยแล้ง (ข้อมูลจริง ERA5/SPEI), น้ำท่วม, ไฟป่า, คลื่นความร้อน และพายุ

Request Body
latnumberreq
ละติจูด (-90 ถึง 90)
lngnumberreq
ลองจิจูด (-180 ถึง 180)
riskTypestringreq
ประเภทความเสี่ยง
includeHistoricalbooleanopt
รวมข้อมูลประวัติศาสตร์ (ค่าเริ่มต้น: false)
timeframestringopt
กรอบเวลา (ค่าเริ่มต้น: 30d)
ตัวอย่าง Request
curl -X POST "https://api.globmaps.com/api/risk-map/score" \
  -H "X-API-Key: <your_api_key>" \
  -H "Content-Type: application/json" \
  -d '{
  "lat": 13.7563,
  "lng": 100.5018,
  "riskType": "drought",
  "timeframe": "30d"
}'
ตัวอย่าง Response
{
  "success": true,
  "data": {
    "location": { "lat": 13.7563, "lng": 100.5018 },
    "riskType": "drought",
    "riskScore": 67,
    "riskLevel": "high",
    "summary": "Drought severity: D2 (SPEI-1: -1.42). 3.2km from nearest grid point.",
    "details": {
      "currentConditions": {
        "spei1": -1.42, "spei3": -1.18, "spei6": -0.91, "spei12": -0.54,
        "severity": "D2", "distanceKm": 3.2, "month": "2026-04"
      }
    },
    "dataSources": ["ERA5 Climate Reanalysis", "GlobMaps Drought Pipeline"],
    "timestamp": "2026-05-10T08:00:00Z"
  }
}
POST/api/risk-map/score?format=geojson

เหมือนด้านบนแต่ส่งคืนในรูปแบบ GeoJSON Feature — พร้อมใช้งานใน QGIS, ArcGIS, Mapbox และ Kepler.gl

ตัวอย่าง Request
curl -X POST "https://api.globmaps.com/api/risk-map/score" \
  -H "X-API-Key: <your_api_key>" \
  -H "Content-Type: application/json" \
  -d '{
  "lat": 13.7563,
  "lng": 100.5018,
  "riskType": "drought"
}'
ตัวอย่าง Response
{
  "type": "Feature",
  "geometry": { "type": "Point", "coordinates": [100.5018, 13.7563] },
  "properties": {
    "riskType": "drought",
    "riskScore": 67,
    "riskLevel": "high",
    "summary": "Drought severity: D2 (SPEI-1: -1.42).",
    "spei1": -1.42, "spei3": -1.18,
    "dataSources": ["ERA5 Climate Reanalysis", "GlobMaps Drought Pipeline"],
    "timestamp": "2026-05-10T08:00:00Z"
  }
}

Drought APIs

ข้อมูลภัยแล้ง SPEI/SPI ครบถ้วนขับเคลื่อนด้วยข้อมูล ERA5 รองรับคำขอระดับ grid และระดับจังหวัด

GET/api/risk-map/droughtREAL DATA

ดึงดัชนีภัยแล้ง (SPEI-1/3/6/12, SPI-1, MCDI) สำหรับพิกัดใดก็ได้ ส่งคืน grid point ที่ใกล้ที่สุดพร้อมรายละเอียดภูมิอากาศครบถ้วน

Query Parameters
latnumberreq
ละติจูด
lngnumberreq
ลองจิจูด
monthstringopt
รูปแบบ YYYY-MM (ค่าเริ่มต้น: ล่าสุด)
ตัวอย่าง Request
curl "https://api.globmaps.com/api/risk-map/drought?lat=13.7563&lng=100.5018" \
  -H "X-API-Key: <your_api_key>"
ตัวอย่าง Response
{
  "success": true,
  "data": {
    "location": {
      "requestedLat": 13.7563, "requestedLng": 100.5018,
      "gridId": "THA_1234", "gridLat": 13.75, "gridLng": 100.50,
      "distanceKm": 0.8, "country": "THA"
    },
    "period": {
      "month": "2026-04",
      "climatologyBaseline": "1991-2020"
    },
    "drought": {
      "score": 67, "level": "high",
      "indices": { "spei1": -1.42, "spei3": -1.18, "spei6": -0.91, "spei12": -0.54, "spi1": -1.31, "mcdi": -1.05 },
      "severity": { "spei1": "D2" }
    }
  }
}
GET/api/risk-map/drought/provinceREAL DATA

ดึงข้อมูลภัยแล้งตามชื่อจังหวัด รองรับ 77 จังหวัดของไทย (country=THA)

Query Parameters
namestringreq
ชื่อจังหวัด (เช่น Bangkok, Chiang Mai)
countrystringopt
รหัสประเทศ ISO (ค่าเริ่มต้น: THA)
monthstringopt
รูปแบบ YYYY-MM (ค่าเริ่มต้น: ล่าสุด)
ตัวอย่าง Request
curl "https://api.globmaps.com/api/risk-map/drought/province?name=Chiang+Mai&country=THA" \
  -H "X-API-Key: <your_api_key>"
ตัวอย่าง Response
GET /api/risk-map/drought/province?name=Chiang+Mai&country=THA

{
  "success": true,
  "data": {
    "province": "Chiang Mai",
    "country": "THA",
    "month": "2026-04",
    "score": 72,
    "level": "high",
    "indices": { "spei1": -1.61, "spei3": -1.32, "spei6": -1.08 },
    "severity": { "spei1": "D3" }
  }
}

Batch API

ประมวลผลหลายตำแหน่งในคำขอเดียว ผลลัพธ์ GeoJSON พร้อมใช้ใน GIS tools

POST/api/risk-map/batchREAL DATA

ประมวลผลได้สูงสุด 100 ตำแหน่งในคำขอเดียว ส่งคืนดัชนีภัยแล้งสำหรับแต่ละพิกัด รองรับ JSON และ GeoJSON FeatureCollection

Request Body
locationsarrayreq
อาร์เรย์ {id?, lat, lng} — สูงสุด 100
riskTypestringreq
drought (รองรับเฉพาะประเภทนี้ในขณะนี้)
formatstringopt
json · geojson (ค่าเริ่มต้น: json)
ตัวอย่าง Request
curl -X POST "https://api.globmaps.com/api/risk-map/batch" \
  -H "X-API-Key: <your_api_key>" \
  -H "Content-Type: application/json" \
  -d '{
  "riskType": "drought",
  "format": "json",
  "locations": [
    { "id": "bkk",  "lat": 13.7563, "lng": 100.5018 },
    { "id": "cnx",  "lat": 18.7883, "lng": 98.9853  },
    { "id": "hkt",  "lat": 7.8804,  "lng": 98.3923  }
  ]
}'
ตัวอย่าง Response
{
  "success": true,
  "data": {
    "count": 3,
    "riskType": "drought",
    "results": [
      { "id": "bkk", "lat": 13.7563, "lng": 100.5018, "riskScore": 67, "riskLevel": "high",   "severity": "D2", "spei1": -1.42 },
      { "id": "cnx", "lat": 18.7883, "lng": 98.9853,  "riskScore": 78, "riskLevel": "high",   "severity": "D3", "spei1": -1.68 },
      { "id": "hkt", "lat": 7.8804,  "lng": 98.3923,  "riskScore": 22, "riskLevel": "low",    "severity": null, "spei1":  0.31 }
    ],
    "timestamp": "2026-05-10T08:00:00Z"
  }
}

Outbreak Radar API

ข้อมูลเชิงลึกการเฝ้าระวังโรคขับเคลื่อนด้วย WHO EIOS, CDC FluNet, ProMED และ HealthMap

POST/api/outbreak-radar/query

ข้อมูลเชิงลึกการเฝ้าระวังโรคสำหรับพิกัดใดก็ได้ ขับเคลื่อนด้วยข้อมูล WHO EIOS, CDC FluNet, ProMED และ HealthMap

Request Body
latnumberreq
ละติจูด
lngnumberreq
ลองจิจูด
diseaseTypestringreq
ประเภทโรค
timeframestringopt
กรอบเวลา (ค่าเริ่มต้น: 30d)
ตัวอย่าง Request
curl -X POST "https://api.globmaps.com/api/outbreak-radar/query" \
  -H "X-API-Key: <your_api_key>" \
  -H "Content-Type: application/json" \
  -d '{
  "lat": 13.7563,
  "lng": 100.5018,
  "diseaseType": "dengue",
  "timeframe": "30d"
}'
ตัวอย่าง Response
{
  "success": true,
  "data": {
    "location": { "lat": 13.7563, "lng": 100.5018 },
    "diseaseType": "dengue",
    "riskScore": 78,
    "riskLevel": "high",
    "outbreakStatus": "warning",
    "activeClusters": 3,
    "caseEstimate": 1240,
    "trend": "increasing",
    "summary": "Elevated dengue activity confirmed in Bangkok metro area.",
    "details": {
      "intelligence": "WHO EIOS monitoring confirms elevated dengue activity...",
      "keyFindings": [
        "Risk score: 78/100 based on WHO EIOS + CDC FluNet",
        "3 active clusters within 100km radius",
        "Trend: increasing — 30-day rolling average"
      ]
    },
    "dataSources": ["WHO EIOS", "CDC FluNet", "ProMED", "HealthMap", "ECDC"],
    "timestamp": "2026-05-10T08:00:00Z"
  }
}

Supply Chain Intelligence API

ข้อมูลความแออัดท่าเรือ การติดตามเรือ ความล่าช้า ETA และการหยุดชะงักทางการค้าจาก AIS และ UN Comtrade

POST/api/supply-chain/query

ข้อมูลความแออัดท่าเรือ จำนวนเรือ ความล่าช้า ETA และการหยุดชะงักทางการค้า ระบุพิกัดหรือรหัส UN/LOCODE

Request Body
latnumberopt
ละติจูด — จำเป็นถ้าไม่ระบุ portCode
lngnumberopt
ลองจิจูด — จำเป็นถ้าไม่ระบุ portCode
portCodestringopt
รหัส UN/LOCODE (เช่น THLCH, SGSIN)
queryTypestringreq
ประเภทคำถาม
ตัวอย่าง Request
curl -X POST "https://api.globmaps.com/api/supply-chain/query" \
  -H "X-API-Key: <your_api_key>" \
  -H "Content-Type: application/json" \
  -d '{
  "portCode": "THLCH",
  "queryType": "congestion"
}'
ตัวอย่าง Response
{
  "success": true,
  "data": {
    "port": { "code": "THLCH", "name": "Laem Chabang" },
    "queryType": "congestion",
    "congestionIndex": 54,
    "vesselCount": 18,
    "avgDwellDays": 3.2,
    "etaDelayHours": 14,
    "disruptionRisk": "medium",
    "summary": "Moderate congestion at Laem Chabang — above baseline threshold.",
    "details": {
      "keyFindings": [
        "Congestion index: 54/100 — above baseline of 40",
        "18 vessels at anchor — 4 bulk carriers, 9 container ships, 5 tankers",
        "ETA delay: +14 hours average vs scheduled arrival"
      ]
    },
    "dataSources": ["AIS Real-time (MarineTraffic)", "VesselsValue", "UN Comtrade"],
    "timestamp": "2026-05-10T08:00:00Z"
  }
}

รหัสข้อผิดพลาด

400VALIDATION_ERRORMissing or invalid request parameters
401INVALID_API_KEYMissing, invalid, or expired API key
404NOT_FOUNDNo data available for this location
429RATE_LIMIT_EXCEEDEDRequest quota exceeded for your plan
500INTERNAL_ERRORUnexpected server error