Regions, and their districts and capitals in Ghana
A single endpoint returning a json-formatted response of Ghana's regions and their districts with corresponding capital.
EDNPOINT: https://regions-and-districts-in-ghana.onrender.com
REQUEST METHOD: GET
/regions
Lists all regions with their districts and capitals
/regions/{region_code}
List districts of a specific region
Please see
codes.txt
for region codes
Details of response data
interface district {
code: string
label: string
category: string
capital: string
}
interface region {
code: string
label: string
capital: string
districts: Array<district>
}
All Regions
https://regions-and-districts-in-ghana.onrender.com/regions
{
"status": true,
"regions": [
{
"code": "AR",
"label": "Ahafo Region",
"capital": "Goaso",
"districts": [
{
"code": "ASN",
"label": "Asunafo North",
"category": "Municipal",
"capital": "Goaso"
}
]
}
],
"details": {
"total_regions": 4,
"total_districts": 73
}
}
Specific Region
https://regions-and-districts-in-ghana.onrender.com/regions/ar
region code can be uppercase or lowercase
{
"status": true,
"regions": {
"code": "AR",
"label": "Ahafo Region",
"capital": "Goaso",
"districts": [
{
"code": "ASN",
"label": "Asunafo North",
"category": "Municipal",
"capital": "Goaso"
},
{
"code": "ASS",
"label": "Asunafo South",
"category": "District",
"capital": "Kukuom"
}
]
},
"details": {
"total_regions": 1,
"total_districts": 6
}
}
- Clone project
git remote add my_awesome_regions https://github.com/brvhprince/regions-districts-in-ghana.git
-
Run
yarn install
use npm if preferred
-
Start development server
yarn dev
-
Build for production
yarn build
-
Start production server
yarn start
https://en.wikipedia.org/wiki/Districts_of_Ghana#List_of_Districts