Quickstart
Get drought risk data for any province in Thailand, Vietnam, or Malaysia in under 5 minutes.
Get drought risk data for any province in Thailand, Vietnam, or Malaysia in under 5 minutes.
Base URL: https://climate.globmaps.com
1. Get Your API Key
Sign in and generate a key at https://climate.globmaps.com/dashboard/api-keys
Key format: ci_ + 48 hex characters (e.g. ci_a1b2c3d4e5f6...)
2. Make Your First Request
curl
curl -H "x-api-key: ci_YOUR_KEY" \
"https://climate.globmaps.com/api/risk-map/drought/province?country=THA&name=Chiang%20Rai"
Python
import requests
API_KEY = "ci_YOUR_KEY"
BASE_URL = "https://climate.globmaps.com"
response = requests.get(
f"{BASE_URL}/api/risk-map/drought/province",
params={"country": "THA", "name": "Chiang Rai"},
headers={"x-api-key": API_KEY},
)
data = response.json()
print(data["data"]["riskLevel"]) # "low" | "moderate" | "high" | "extreme"
print(data["data"]["mdi_score"]) # 0–1 Multi-Dimensional Drought Index
JavaScript
const API_KEY = "ci_YOUR_KEY";
const res = await fetch(
"https://climate.globmaps.com/api/risk-map/drought/province?country=THA&name=Chiang%20Rai",
{ headers: { "x-api-key": API_KEY } }
);
const { data } = await res.json();
console.log(data.riskLevel); // "low"
console.log(data.mdi_score); // 0.1272
3. Example Response
Province: Chiang Rai, month: 2026-05 (live data)
{
"success": true,
"data": {
"province": "Chiang Rai",
"lat": 19.8433,
"lng": 99.866,
"month": "2026-05",
"spei1": -0.1755,
"spei3": -0.3232,
"spei6": -0.4351,
"spei12": -0.2198,
"spi1": -0.4948,
"spi3": -0.3874,
"spei1_class": "N",
"severity": "N",
"riskScore": 9,
"riskLevel": "low",
"confidence": 0.649,
"confidenceLabel": "Medium",
"mdi_score": 0.1272,
"mdi_severity": "none",
"mdi_components": {
"spei_score": 0.0,
"vci_score": 0.5245,
"vci_weight": 0.1573,
"esi_score": 0.0,
"smi_score": 0.298,
"active_layers": ["spei", "vci", "esi", "smi"],
"weight_sum": 0.957,
"weight_missing": 0.043,
"spei3_raw": -0.3232,
"vci_raw": 19.02,
"vci_source": "MODIS",
"esi_raw_pct": 2.41,
"smi_norm": 0.702,
"urban_fraction": 0.0221,
"cropland_fraction": 0.2321,
"forest_fraction": 0.6423,
"vci_discounted": true,
"vci_weight_eff": 0.1573
},
"forecast": [
{ "ym": "2026-06", "spei1": -0.2823, "severity": "N", "tp_mm": 184.07, "t2m_c": 25.58, "tp_cv": 0.339 },
{ "ym": "2026-07", "spei1": 0.1239, "severity": "N", "tp_mm": 329.69, "t2m_c": 25.0, "tp_cv": 0.298 },
{ "ym": "2026-08", "spei1": 0.3315, "severity": "N", "tp_mm": 360.36, "t2m_c": 24.82, "tp_cv": 0.237 },
{ "ym": "2026-09", "spei1": -0.1263, "severity": "N", "tp_mm": 230.17, "t2m_c": 24.25, "tp_cv": 0.310 },
{ "ym": "2026-10", "spei1": 0.4797, "severity": "N", "tp_mm": 134.60, "t2m_c": 23.02, "tp_cv": 0.704 },
{ "ym": "2026-11", "spei1": 0.6907, "severity": "W1","tp_mm": 73.30, "t2m_c": 21.44, "tp_cv": 0.771 }
]
}
}
4. Field Reference
| Field | Type | Description |
|---|---|---|
province | string | Province name |
lat, lng | float | Centroid coordinates |
month | string | Reference month (YYYY-MM) — ERA5 pipeline data |
spei1 | float | SPEI-1 score (1-month). < −1.28 = D2+; < 0 = mild stress |
spei3, spei6, spei12 | float | Long-term SPEI |
spi1, spi3 | float | SPI (precipitation-only) |
spei1_class | string | N · D0–D4 (drought) · W1–W2 (wet) |
severity | string | Same as spei1_class |
riskScore | int | 0–100 composite risk |
riskLevel | string | low · moderate · high · extreme |
confidence | float | 0–1 forecast confidence (lead-1) |
confidenceLabel | string | Low · Medium · High |
mdi_score | float | Multi-Dimensional Index 0–1 (SPEI+VCI+ESI+SMI) |
mdi_severity | string | none · mild · moderate · severe · extreme |
mdi_components | object | Raw per-layer scores |
forecast[] | array | 6-month SEAS5.1 forecast |
forecast[].ym | string | Month (YYYY-MM) |
forecast[].spei1 | float | Forecast SPEI-1 |
forecast[].severity | string | N / D0–D4 / W1–W2 |
forecast[].tp_mm | float | Forecast precipitation (mm) |
forecast[].t2m_c | float | Forecast temperature (°C) |
forecast[].tp_cv | float | Precipitation uncertainty (CV) |
5. All Drought Endpoints
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | /api/risk-map/drought/province | MDI + SPEI by province | ✅ |
| GET | /api/risk-map/drought | Grid-level data (lat/lng) | ✅ |
| GET | /api/risk-map/drought/summary | AI-generated country summary | ✅ |
| GET | /api/risk-map/drought/alert | Provinces in drought threshold | ✅ |
Query Parameters — /api/risk-map/drought/province
| Param | Required | Default | Notes |
|---|---|---|---|
country | No | THA | THA · VNM · MYS (uppercase ISO) |
name | Yes | — | Province name e.g. Chiang Rai, Bangkok |
month | No | latest | Filter by YYYY-MM (→ 404 if month not in data) |
Province lookup is case-insensitive and ignores spaces: chiangrai = Chiang Rai
6. Error Handling
All errors return: { "error": "<message>" }
| HTTP | Message | Cause |
|---|---|---|
401 | "Missing API key." | No x-api-key header |
401 | "Invalid API key." | Key not found or revoked |
429 | "Rate limit exceeded." | Over req/min for your plan |
403 | "No active subscription for THA..." | Country not in subscription |
400 | "name is required." | Missing name query param |
404 | "Province \"X\" not found." | Province name typo |
Rate Limits
| Plan | Requests/min |
|---|---|
| API_SANDBOX | 30 |
| API_PRO | 120 |
| API_BUSINESS | 300 |
| BUNDLE_PRO | 120 |
7. Available Countries & Provinces
| Country | Code | Example Provinces |
|---|---|---|
| Thailand | THA | Bangkok, Chiang Rai, Chiang Mai, Phuket, Nakhon Ratchasima (77 total) |
| Vietnam | VNM | Hanoi, Ho Chi Minh City, Da Nang |
| Malaysia | MYS | Kuala Lumpur, Penang, Johor |
8. Data Sources
| Source | Role |
|---|---|
| ERA5-Land (ECMWF) | Monthly reanalysis 0.1° — SPEI/SPI baseline |
| SEAS5.1 system=51 (ECMWF) | 51-member ensemble 6-month forecast |
| MODIS MOD13Q1 V6.1 (NASA) | 250m Vegetation Condition Index (VCI) |
| ERA5 ET proxy | Evaporative Stress Index (ESI) |
Baseline climatology: 1991–2020 (WMO standard period)
API verified from live code + data — 2026-06-16
Source: src/app/api/risk-map/drought/province/route.ts
Ready to build?
Get your API key — free
Sign up in seconds. No credit card required for the sandbox tier.
Sign up free →Already have an account? Sign in →