API Reference

Authenticate every request with an x-api-key: YOUR_API_KEY header. Manage keys in the API Keys tab.

Current Coverage

🇹🇭 Thailand
THA
77 Provinces
🇻🇳 Vietnam
VNM
63 Provinces
🇲🇾 Malaysia
MYS
16 States

Quick Start

curl

# GET — Drought data for a coordinate
curl "https://climate.globmaps.com/api/risk-map/drought?lat=13.7563&lng=100.5018" \
  -H "x-api-key: YOUR_API_KEY"

# GET — Province drought data
curl "https://climate.globmaps.com/api/risk-map/drought/province?country=THA&name=Chiang+Mai" \
  -H "x-api-key: YOUR_API_KEY"

# POST — Risk score
curl -X POST "https://climate.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"}'

python

import requests

BASE = "https://climate.globmaps.com"
HEADERS = {"x-api-key": "YOUR_API_KEY"}

# Grid drought at Bangkok
r = requests.get(f"{BASE}/api/risk-map/drought", headers=HEADERS,
                 params={"lat": 13.7563, "lng": 100.5018})
data = r.json()["data"]
print(data["drought"]["score"], data["drought"]["level"])

# Province query
r = requests.get(f"{BASE}/api/risk-map/drought/province", headers=HEADERS,
                 params={"country": "THA", "name": "Chiang Mai"})
province = r.json()["data"]
print(province["province"], province["mdi"]["severity"])

# Batch — 3 farms
r = requests.post(f"{BASE}/api/risk-map/batch",
    headers={**HEADERS, "Content-Type": "application/json"},
    json={"riskType": "DROUGHT", "points": [
        {"id": "farm-01", "lat": 13.75, "lng": 100.50},
        {"id": "farm-02", "lat": 18.79, "lng": 98.97},
        {"id": "farm-03", "lat": 21.02, "lng": 105.83},
    ]})
for item in r.json()["results"]:
    print(item["id"], item["riskScore"], item["riskLevel"])

js

const BASE = "https://climate.globmaps.com";
const HEADERS = { "x-api-key": "YOUR_API_KEY" };

// Grid drought at Bangkok
const droughtRes = await fetch(
  `${BASE}/api/risk-map/drought?lat=13.7563&lng=100.5018`,
  { headers: HEADERS }
);
const { data } = await droughtRes.json();
console.log(data.drought.score, data.drought.level);

// Province query
const provRes = await fetch(
  `${BASE}/api/risk-map/drought/province?country=THA&name=Chiang+Mai`,
  { headers: HEADERS }
);
const { data: prov } = await provRes.json();
console.log(prov.province, prov.mdi.severity);

// Batch
const batchRes = await fetch(`${BASE}/api/risk-map/batch`, {
  method: "POST",
  headers: { ...HEADERS, "Content-Type": "application/json" },
  body: JSON.stringify({ riskType: "DROUGHT", points: [
    { id: "farm-01", lat: 13.75, lng: 100.50 },
    { id: "farm-02", lat: 18.79, lng:  98.97 },
  ]}),
});
const { results } = await batchRes.json();
results.forEach(r => console.log(r.id, r.riskScore));

Drought API

GET/api/risk-map/drought

Grid-level drought index at a coordinate (nearest ~25 km grid cell). Returns MDI score, severity, and 7-dimension index breakdown.

Parameters

NameTypeRequiredDescription
latnumberrequiredLatitude (-90 to 90)
lngnumberrequiredLongitude (-180 to 180)
monthstringoptionalData month in YYYY-MM format. Defaults to latest available.

Response (200 OK)

{
  "success": true,
  "data": {
    "location": {
      "requestedLat": 13.7563,
      "requestedLng": 100.5018,
      "gridId": "THA_grid_0042",
      "gridLat": 13.75,
      "gridLng": 100.50,
      "distanceKm": 0.8,
      "country": "THA"
    },
    "period": {
      "month": "2026-04",
      "availableMonths": ["2025-05","2025-06","...","2026-04"],
      "climatologyBaseline": "1991-2020"
    },
    "drought": {
      "score": 0.61,
      "level": "moderate",
      "severity": "D1–D2 Moderate Drought",
      "indices": { "spei": 0.58, "spi": 0.63, "vci": 0.55, "tci": 0.67, "vhi": 0.60, "pdsi": 0.59, "sma": 0.64 }
    },
    "confidenceScore": 0.82
  }
}
GET/api/risk-map/drought/province

Province-level drought data. Coverage: Thailand (77 provinces), Vietnam (63 provinces), Malaysia (16 states).

Parameters

NameTypeRequiredDescription
namestringrequiredProvince name (e.g. "Chiang Mai", "Ha Noi", "Johor")
countrystringrequired"THA" | "VNM" | "MYS"
monthstringoptionalData month in YYYY-MM format. Defaults to latest available.

Response (200 OK)

{
  "success": true,
  "data": {
    "province": "Chiang Mai",
    "country": "THA",
    "month": "2026-04",
    "mdi": {
      "score": 0.54,
      "level": "moderate",
      "severity": "D1–D2 Moderate Drought"
    },
    "indices": { "spei": 0.51, "spi": 0.57, "vci": 0.48, "tci": 0.60, "vhi": 0.52, "pdsi": 0.55, "sma": 0.54 }
  }
}
GET/api/risk-map/drought/summary

Country-level drought summary with AI-generated narrative and aggregate statistics.

Parameters

NameTypeRequiredDescription
countrystringrequired"THA" | "VNM" | "MYS"

Response (200 OK)

{
  "success": true,
  "data": {
    "country": "THA",
    "month": "2026-04",
    "summary": {
      "affectedProvinces": 23,
      "totalProvinces": 77,
      "severityBreakdown": { "D0": 8, "D1": 9, "D2": 4, "D3": 2, "D4": 0 },
      "averageMdi": 0.38
    },
    "narrative": "Northern Thailand continues to experience moderate drought conditions..."
  }
}
GET/api/risk-map/drought/confidence

7-dimension forecast confidence scores for each index in the MDI composite.

Parameters

NameTypeRequiredDescription
countrystringrequired"THA" | "VNM" | "MYS"

Response (200 OK)

{
  "success": true,
  "data": {
    "country": "THA",
    "month": "2026-04",
    "confidence": {
      "spei": 0.88, "spi": 0.91, "vci": 0.79,
      "tci": 0.83, "vhi": 0.81, "pdsi": 0.85, "sma": 0.87
    },
    "composite": 0.85
  }
}
GET/api/risk-map/drought/alert

Active drought alerts filtered by severity threshold. Returns provinces meeting or exceeding the specified level.

Parameters

NameTypeRequiredDescription
countrystringrequired"THA" | "VNM" | "MYS"
severitystringoptional"D0" | "D1" | "D2" | "D3" | "D4". Defaults to "D2".

Response (200 OK)

{
  "success": true,
  "data": {
    "country": "THA",
    "severity_threshold": "D2",
    "alert_count": 6,
    "provinces": [
      { "name": "Chiang Rai", "severity": "D2", "score": 0.52 },
      { "name": "Nan",        "severity": "D3", "score": 0.61 }
    ]
  }
}

Point Query

GET/api/point-query

Reverse-geocode a lat/lng to a province then return full MDI drought data. Single call for location → risk lookup.

Parameters

NameTypeRequiredDescription
latnumberrequiredLatitude (-90 to 90)
lngnumberrequiredLongitude (-180 to 180)

Response (200 OK)

{
  "status": "ok",
  "province": "Bangkok Metropolis",
  "country": "THA",
  "mdi": { "score": 0.41, "level": "mild", "severity": "D0 Abnormally Dry" },
  "indices": { "spei": 0.38, "spi": 0.44, "vci": 0.36, "tci": 0.47, "vhi": 0.40, "pdsi": 0.42, "sma": 0.39 },
  "month": "2026-04"
}
// status: "out_of_coverage" if point is outside THA/VNM/MYS

Risk Score

POST/api/risk-map/score

Composite risk score for a coordinate across risk types. Returns a 0–1 score with level label.

Parameters

NameTypeRequiredDescription
latnumberrequiredLatitude
lngnumberrequiredLongitude
riskTypestringrequired"DROUGHT" | "FLOOD" | "WILDFIRE"

Response (200 OK)

{
  "riskScore": 0.61,
  "riskLevel": "moderate",
  "country": "THA",
  "province": "Chiang Mai",
  "month": "2026-04"
}

Batch

POST/api/risk-map/batch

Bulk risk scoring for multiple coordinates in a single request. More efficient than individual calls. Max 100 points per request.

Parameters

NameTypeRequiredDescription
pointsarrayrequiredArray of {lat, lng, id?} objects. Max 100.
riskTypestringrequired"DROUGHT" | "FLOOD" | "WILDFIRE"

Response (200 OK)

{
  "results": [
    { "id": "farm-01", "lat": 13.75, "lng": 100.50, "riskScore": 0.61, "riskLevel": "moderate" },
    { "id": "farm-02", "lat": 18.79, "lng": 98.97,  "riskScore": 0.72, "riskLevel": "severe"   }
  ],
  "processed": 2,
  "failed": 0
}

Supply Chain

POST/api/supply-chain/query

Port congestion and maritime trade intelligence. Returns congestion index, vessel count, dwell time, and cargo delay estimates.

Parameters

NameTypeRequiredDescription
latnumberoptionalPort latitude (use lat/lng or portCode)
lngnumberoptionalPort longitude
portCodestringoptionalUN/LOCODE port code (e.g. "THBKK", "SGSIN")
queryTypestringrequired"congestion" | "vessel_count" | "cargo_delay" | "trade_risk"

Response (200 OK)

{
  "portName": "Laem Chabang",
  "portCode": "THLCH",
  "congestionIndex": 64,
  "vesselCount": 48,
  "avgDwellDays": 3.2,
  "etaDelayHours": 18,
  "disruptionRisk": "medium",
  "summary": "Moderate congestion at Laem Chabang with 18h average delay.",
  "intelligence": "Container throughput at 82% capacity...",
  "keyFindings": ["48 vessels at anchor", "Avg dwell 3.2 days (+0.8 vs baseline)", "Container throughput 82% capacity"]
}

Rate Limits

PlanPer MinuteMonthlyNotes
Free / Trial10 req/min1,000 req/moFor evaluation only
Platform Pro60 req/min10,000 req/moSingle country
Bundle Pro60 req/min30,000 req/moTHA + VNM + MYS
SEA Bundle300 req/min200,000 req/moFull SEA coverage + Batch
EnterpriseCustomCustomSLA + dedicated support

When a rate limit is hit the API returns 429 Too Many Requests. Use exponential back-off before retrying. The X-RateLimit-Remaining response header shows calls left in the current window.

Error Codes

CodeStatusDescription
400Bad RequestMissing or invalid parameters (e.g. lat/lng out of range, bad YYYY-MM format)
401UnauthorizedMissing x-api-key header or key not found
403ForbiddenActive subscription does not include the requested country
404Not FoundProvince name not recognised, or no data for this location/period
429Too Many ReqsRate limit exceeded — back off and retry after the window resets
500Server ErrorUnexpected error — contact support@globmaps.com with the request ID

All error responses follow the shape: { "error": "Human-readable message." }

Data Attribution

Contains modified Copernicus Climate Change Service information 2026. Neither the European Commission nor ECMWF is responsible for any use that may be made of the Copernicus information or data it contains.

Data sources: ERA5 (Copernicus/ECMWF) · SEAS5 seasonal forecast · NOAA GHCND station data · GloFAS river discharge.

Administrative boundaries: geoBoundaries (gbOpen), Runfola et al. (2020), licensed CC BY 4.0.

MDI scores are probabilistic estimates for decision-support purposes. Not intended as the sole basis for critical infrastructure, financial, or emergency decisions. Applications using this API must display: "Powered by GlobMaps MDI".

Support