Geographic Endpoints¶
Endpoints for accessing geographic hierarchy data: countries, administrative divisions (Admin1, Admin2), and weather stations/locations.
Countries¶
List all countries¶
Returns all enabled countries with id, name, and iso2 code.
Response:
Get countries by name¶
| Parameter | Type | Description |
|---|---|---|
| name | string | Country name to search |
Admin Level 1 (Departments / States)¶
Get by country ID¶
| Parameter | Type | Description |
|---|---|---|
| country_id | integer | Country ID |
Response:
[
{
"id": 1,
"name": "Putumayo",
"ext_id": "86",
"country_id": 3,
"country_name": "AMAZONIA",
"country_iso2": "ST"
}
]
Get by name¶
Admin Level 2 (Municipalities / Districts)¶
Get by country ID¶
Get by name¶
Response:
[
{
"id": 1,
"name": "Mocoa",
"ext_id": "86001",
"admin1_id": 1,
"admin1_name": "Putumayo",
"admin1_ext_id": "86",
"country_id": 3,
"country_name": "AMAZONIA",
"country_iso2": "ST"
}
]
Locations (Weather Stations)¶
Get by ID¶
Get by name¶
Get locations with latest monitoring data¶
Returns locations with their complete admin hierarchy and latest monitoring data.
| Parameter | Type | Description |
|---|---|---|
| country_ids | string | Comma-separated country IDs |
| days | integer | Days back for latest data (0 = no limit, max 365) |
Response:
{
"id": 1,
"name": "CAMPUCANA",
"ext_id": "44010030",
"machine_name": "campucana",
"enable": true,
"altitude": 1400.0,
"latitude": 1.2025,
"longitude": -76.68083333,
"visible": true,
"source_id": 1,
"source_name": "IDEAM",
"source_type": "observational",
"admin2_id": 1,
"admin2_name": "Mocoa",
"admin1_id": 1,
"admin1_name": "Putumayo",
"country_id": 3,
"country_name": "AMAZONIA",
"country_iso2": "ST",
"latest_data": {
"date": "1996-10-01",
"measures": [
{
"measure_id": 7,
"measure_name": "Minimum temperature",
"measure_short_name": "tmin",
"measure_unit": "\u00b0C",
"value": 20.71
}
]
}
}