API Documentation
All endpoints return JSON. No authentication required. Base URL: /api
List States
GET /api/statesReturns all 36 states + FCT.
Example response
{
"success": true,
"data": [
{ "id": 1, "name": "Abia", "slug": "abia" },
{ "id": 2, "name": "Adamawa", "slug": "adamawa" },
...
]
}Get State
GET /api/states/:slugReturns a state and its LGAs.
Example response
{
"success": true,
"data": {
"id": 25, "name": "Lagos", "slug": "lagos",
"lgas": [
{ "id": 100, "name": "Eti-Osa", "slug": "eti-osa" },
...
]
}
}Get LGA
GET /api/lgas/:slugReturns an LGA with its parent state and all markets.
Example response
{
"success": true,
"data": {
"id": 100, "name": "Eti-Osa", "slug": "eti-osa",
"state": { "id": 25, "name": "Lagos", "slug": "lagos" },
"markets": [
{ "id": 1, "name": "Lekki Market", "slug": "lekki-market", "lat": 6.47, "lng": 3.59, "added_by": "ifihan" }
]
}
}List Markets
GET /api/markets?limit=20&offset=0&order=ascPaginated list of all markets. Max limit is 100.
| Param | Default | Description |
|---|---|---|
limit | 20 | Number of results (1–100) |
offset | 0 | Skip N results |
order | asc | asc or desc by name |
Search Markets
GET /api/search?q=balogunSearches market names, LGA names, and state names. Returns up to 50 results.
Submit a Market
POST /api/contributeCreates a GitHub issue for review. Body (JSON):
{
"market_name": "Balogun Market",
"state": "Lagos",
"lga": "Lagos Island",
"lat": 6.4541,
"lng": 3.3947,
"description": "One of the largest markets in Lagos",
"contributor_name": "your-github-username"
}