API Reference
Authenticate every request with an x-api-key: YOUR_API_KEY header. Manage keys in the API Keys tab.
Current Coverage
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
/api/risk-map/droughtGrid-level drought index at a coordinate (nearest ~25 km grid cell). Returns MDI score, severity, and 7-dimension index breakdown.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| lat | number | required | Latitude (-90 to 90) |
| lng | number | required | Longitude (-180 to 180) |
| month | string | optional | Data 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
}
}/api/risk-map/drought/provinceProvince-level drought data. Coverage: Thailand (77 provinces), Vietnam (63 provinces), Malaysia (16 states).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | required | Province name (e.g. "Chiang Mai", "Ha Noi", "Johor") |
| country | string | required | "THA" | "VNM" | "MYS" |
| month | string | optional | Data 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 }
}
}/api/risk-map/drought/summaryCountry-level drought summary with AI-generated narrative and aggregate statistics.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| country | string | required | "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..."
}
}/api/risk-map/drought/confidence7-dimension forecast confidence scores for each index in the MDI composite.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| country | string | required | "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
}
}/api/risk-map/drought/alertActive drought alerts filtered by severity threshold. Returns provinces meeting or exceeding the specified level.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| country | string | required | "THA" | "VNM" | "MYS" |
| severity | string | optional | "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
/api/point-queryReverse-geocode a lat/lng to a province then return full MDI drought data. Single call for location → risk lookup.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| lat | number | required | Latitude (-90 to 90) |
| lng | number | required | Longitude (-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/MYSRisk Score
/api/risk-map/scoreComposite risk score for a coordinate across risk types. Returns a 0–1 score with level label.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| lat | number | required | Latitude |
| lng | number | required | Longitude |
| riskType | string | required | "DROUGHT" | "FLOOD" | "WILDFIRE" |
Response (200 OK)
{
"riskScore": 0.61,
"riskLevel": "moderate",
"country": "THA",
"province": "Chiang Mai",
"month": "2026-04"
}Batch
/api/risk-map/batchBulk risk scoring for multiple coordinates in a single request. More efficient than individual calls. Max 100 points per request.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| points | array | required | Array of {lat, lng, id?} objects. Max 100. |
| riskType | string | required | "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
/api/supply-chain/queryPort congestion and maritime trade intelligence. Returns congestion index, vessel count, dwell time, and cargo delay estimates.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| lat | number | optional | Port latitude (use lat/lng or portCode) |
| lng | number | optional | Port longitude |
| portCode | string | optional | UN/LOCODE port code (e.g. "THBKK", "SGSIN") |
| queryType | string | required | "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
| Plan | Per Minute | Monthly | Notes |
|---|---|---|---|
| Free / Trial | 10 req/min | 1,000 req/mo | For evaluation only |
| Platform Pro | 60 req/min | 10,000 req/mo | Single country |
| Bundle Pro | 60 req/min | 30,000 req/mo | THA + VNM + MYS |
| SEA Bundle | 300 req/min | 200,000 req/mo | Full SEA coverage + Batch |
| Enterprise | Custom | Custom | SLA + 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
| Code | Status | Description |
|---|---|---|
| 400 | Bad Request | Missing or invalid parameters (e.g. lat/lng out of range, bad YYYY-MM format) |
| 401 | Unauthorized | Missing x-api-key header or key not found |
| 403 | Forbidden | Active subscription does not include the requested country |
| 404 | Not Found | Province name not recognised, or no data for this location/period |
| 429 | Too Many Reqs | Rate limit exceeded — back off and retry after the window resets |
| 500 | Server Error | Unexpected 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