Markets API
Access information about agricultural markets and trading centers across Kenya
List Markets
GET
/api/v1/marketsPublic KeyGet a paginated list of agricultural markets
Query Parameters
Parameters
pageintegerdefault: 1Page number for pagination
page_sizeintegerdefault: 20Items per page (max: 100)
county_idintegerFilter by county ID
market_typestringFilter by market type (Wholesale, Retail, Rural, Urban)
searchstringSearch markets by name
Example Request
Request
curl -X GET "https://api.shambarecords.com/api/v1/markets?county_id=47&market_type=Wholesale" \
-H "X-API-Key: sr_pub_your_public_key"Response
{
"data": [
{
"uuid": "b2c3d4e5-f6a7-4890-b123-456789abcdef",
"name": "Gikomba Market",
"type": "Wholesale",
"county": {
"id": 47,
"name": "Nairobi"
},
"sub_county": "Starehe",
"location": {
"latitude": -1.2833,
"longitude": 36.8333
},
"operating_days": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
"is_active": true
}
],
"meta": {
"page": 1,
"page_size": 20,
"total": 15,
"total_pages": 1
}
}Get Market by UUID
GET
/api/v1/markets/:uuidPublic KeyRetrieve detailed information about a specific market
Example Request
Request
curl -X GET "https://api.shambarecords.com/api/v1/markets/b2c3d4e5-f6a7-4890-b123-456789abcdef" \
-H "X-API-Key: sr_pub_your_public_key"Response
{
"data": {
"uuid": "b2c3d4e5-f6a7-4890-b123-456789abcdef",
"name": "Gikomba Market",
"type": "Wholesale",
"county": {
"id": 47,
"name": "Nairobi",
"code": "047"
},
"sub_county": "Starehe",
"location": {
"latitude": -1.2833,
"longitude": 36.8333,
"address": "Gikomba, Nairobi"
},
"operating_days": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
"operating_hours": "6:00 AM - 6:00 PM",
"description": "One of Nairobi's largest wholesale markets",
"facilities": ["Parking", "Loading Bay", "Storage"],
"contact": {
"phone": "+254700000000",
"email": "info@gikombamarket.ke"
},
"is_active": true,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-15T10:00:00Z"
}
}Market Object Schema
Response Schema
uuidstring (UUID)Unique identifier for the market
namestringMarket name
typestringMarket type (Wholesale, Retail, Rural, Urban)
countyobjectCounty information (id, name, code)
sub_countystringnullableSub-county name
locationobjectnullableGeographic location (latitude, longitude, address)
operating_daysarray of stringsDays when market is operational
operating_hoursstringnullableOperating hours
descriptionstringnullableMarket description
facilitiesarray of stringsnullableAvailable facilities
contactobjectnullableContact information (phone, email)
is_activebooleanWhether the market is currently active