Markets API

Access information about agricultural markets and trading centers across Kenya

List Markets

GET/api/v1/marketsPublic Key

Get a paginated list of agricultural markets

Query Parameters

Parameters

pageintegerdefault: 1

Page number for pagination

page_sizeintegerdefault: 20

Items per page (max: 100)

county_idinteger

Filter by county ID

market_typestring

Filter by market type (Wholesale, Retail, Rural, Urban)

searchstring

Search 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 Key

Retrieve 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

namestring

Market name

typestring

Market type (Wholesale, Retail, Rural, Urban)

countyobject

County information (id, name, code)

sub_countystringnullable

Sub-county name

locationobjectnullable

Geographic location (latitude, longitude, address)

operating_daysarray of strings

Days when market is operational

operating_hoursstringnullable

Operating hours

descriptionstringnullable

Market description

facilitiesarray of stringsnullable

Available facilities

contactobjectnullable

Contact information (phone, email)

is_activeboolean

Whether the market is currently active