Skip to main content

GET /api/services

Retrieve a list of all services and organizations available in Dzaleka Refugee Camp.

Query Parameters

This endpoint does not require any query parameters.

Response Format

status
string
required
Status of the API response (“success” or “error”)
count
number
required
Total number of services returned
data
object
required
Container for the services data
services
array
required
Array of service objects
id
string
Unique identifier for the service
collection
string
Collection name (“services”)
title
string
Name of the service or organization
category
string
Service category (e.g., “Education”, “Legal Services”, “Technology”)
description
string
Detailed description of the service
location
object
Physical location information
address
string
Street address
city
string
City name
coordinates
object
GPS coordinates
lat
number
Latitude
lng
number
Longitude
contact
object
Contact information
email
string
Email address
phone
string
Phone number
hours
string
Operating hours
socialMedia
object
Social media links
facebook
string
Facebook URL
twitter
string
Twitter/X URL
instagram
string
Instagram URL
linkedin
string
LinkedIn URL
website
string
Website URL
URL to organization logo
Whether the service is featured
verified
boolean
Whether the service is verified
lastUpdated
string
Last update date (YYYY-MM-DD)

Error Responses

status
string
“error”
message
string
Error message description
error
string
Detailed error information
Status Codes:
  • 200 - Success
  • 429 - Rate limit exceeded (60 requests per minute)
  • 500 - Internal server error

Rate Limiting

All API endpoints are rate-limited to 60 requests per minute per IP address. Rate limit headers are included in responses:
  • X-RateLimit-Limit: Maximum requests per window
  • X-RateLimit-Remaining: Remaining requests in current window
  • X-RateLimit-Reset: Timestamp when the rate limit resets
  • Retry-After: Seconds to wait before retrying (only on 429 responses)

Example Request

curl -X GET "https://services.dzaleka.com/api/services" \
  -H "Content-Type: application/json"

Example Response

{
  "status": "success",
  "count": 2,
  "data": {
    "services": [
      {
        "id": "BloomBox",
        "collection": "services",
        "title": "BloomBox Design Labs",
        "category": "Education",
        "description": "BloomBox Design Labs is dedicated to the application of sustainable design strategies, materials, and energy to advancing access to high quality education.",
        "location": {
          "address": "BloomBox, Dzaleka, M16",
          "city": "Dowa",
          "coordinates": {
            "lat": -13.6628274,
            "lng": 33.8704301
          }
        },
        "contact": {
          "email": "",
          "phone": "+1 236-888-5055",
          "hours": "Monday-Friday, 9:00 AM - 5:00 PM"
        },
        "socialMedia": {
          "facebook": "",
          "twitter": "https://x.com/roux_sofie",
          "instagram": "https://www.instagram.com/bloomboxdesignlabs/?hl=en",
          "linkedin": "",
          "website": "https://www.bloomboxdesignlabs.com/"
        },
        "logo": "https://static.wixstatic.com/media/bd2625_69e11c70797246ccba3425b1b8bcd771%7Emv2.png/v1/fill/w_192%2Ch_192%2Clg_1%2Cusm_0.66_1.00_0.01/bd2625_69e11c70797246ccba3425b1b8bcd771%7Emv2.png",
        "featured": true,
        "verified": true,
        "lastUpdated": "2025-03-06"
      }
    ]
  }
}

POST /api/services

Retrieve services data with optional metadata and statistics.

Request Body

options
object
Optional configuration for the response
includeMetadata
boolean
Include export metadata in response
includeStats
boolean
Include statistics in response

Response Format

Same as GET endpoint, with optional additional fields:
metadata
object
Export metadata (only if includeMetadata: true)
exportDate
string
ISO 8601 timestamp of export
collection
string
Collection name
stats
object
Statistics (only if includeStats: true)
totalItems
number
Total number of items
collection
string
Collection name

Example Request

curl -X POST "https://services.dzaleka.com/api/services" \
  -H "Content-Type: application/json" \
  -d '{
    "options": {
      "includeMetadata": true,
      "includeStats": true
    }
  }'

Example Response

{
  "status": "success",
  "count": 45,
  "data": {
    "services": [
      {
        "id": "BloomBox",
        "title": "BloomBox Design Labs",
        "category": "Education"
      }
    ]
  },
  "metadata": {
    "exportDate": "2025-03-09T12:00:00.000Z",
    "collection": "services"
  },
  "stats": {
    "totalItems": 45,
    "collection": "services"
  }
}

Implementation

The Services API is implemented using the createGetHandler and createPostHandler utility functions from src/utils/api-utils.ts:118. Source code: src/pages/api/services.ts:5