GET /api/photos
Retrieve a collection of photo stories and visual narratives from Dzaleka Refugee Camp.Query Parameters
This endpoint does not require any query parameters.Response Format
Status of the API response (“success” or “error”)
Total number of photos returned
Container for the photos data
Array of photo story objects
Unique identifier for the photo story
Collection name (“photos”)
Photo story title
Description or narrative of the photo story
Contributor slug/identifier
URL to the main image
Publication date (YYYY-MM-DD)
Array of tag strings
Whether the photo story is featured
Location where the photo was taken
Error Responses
“error”
Error message description
Detailed error information
200- Success429- 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 windowX-RateLimit-Remaining: Remaining requests in current windowX-RateLimit-Reset: Timestamp when the rate limit resetsRetry-After: Seconds to wait before retrying (only on 429 responses)
Example Request
Example Response
POST /api/photos
Retrieve photos data with optional metadata and statistics.Request Body
Response Format
Same as GET endpoint, with optional additional fields:Example Request
Example Response
Implementation
The Photos API is implemented using thecreateGetHandler and createPostHandler utility functions from src/utils/api-utils.ts:118.
Source code: src/pages/api/photos.ts:5