Skip to main content

Villages

This endpoint allows you to retrieve villages in Uganda.

Get All Villages

Fetches a list of all villages in Uganda.

Endpoint

GET https://api.opendataug.org/v1/villages

Headers

HeaderRequiredDescription
x-api-keyYesYour API key for authentication

Example Request

curl -X GET \
'https://api.opendataug.org/v1/villages' \
-H 'x-api-key: your_api_key_here'

Response

{
"status": "success",
"data": [
{
"id": "1",
"name": "Kiwafu",
"parish_id": "1",
"parish_name": "Bukoto",
"subcounty_id": "1",
"subcounty_name": "Nakawa"
}
]
}

Response Fields

FieldTypeDescription
statusstringThe status of the request ("success" or "error")
dataarrayArray of village objects
data[].idstringUnique identifier for the village
data[].namestringName of the village
data[].parish_idstringID of the parish this village belongs to
data[].parish_namestringName of the parish this village belongs to
data[].subcounty_idstringID of the subcounty this village belongs to
data[].subcounty_namestringName of the subcounty this village belongs to

Error Responses

Status CodeDescription
401Invalid or missing API key
429Too many requests - Rate limit exceeded
500Internal server error

Rate Limiting

This endpoint is subject to rate limiting. Please refer to our rate limiting documentation for more details.

Notes

  • Villages are the smallest administrative units in Uganda
  • The API response is paginated with 100 villages per page
  • Villages are sorted alphabetically by name

Get Villages by Parish

Fetches all villages within a specific parish.

Endpoint

GET https://api.opendataug.org/v1/parishes/{parish_id}/villages

Parameters

ParameterTypeRequiredDescription
parish_idstringYesID of the parish

Example Request

curl -X GET \
'https://api.opendataug.org/v1/parishes/1/villages' \
-H 'x-api-key: your_api_key_here'

The response format is the same as the Get All Villages endpoint.