GET
/api/media/search
Read
Search and filter photos
| Parameter | Type | Description |
|---|---|---|
| trip_id | int|string | Filter by trip ID (comma-separated for multiple) |
| tags | string | Filter by tag slugs or IDs (comma-separated) |
| exclude_tags | string | Exclude photos with these tags |
| date_from | date | Filter by date (YYYY-MM-DD) |
| date_to | date | Filter by date (YYYY-MM-DD) |
| year | int | Filter by year |
| month | int | Filter by month (1-12) |
| type | string | Filter by type: photo, video |
| has_location | bool | Filter by GPS data presence |
| bbox | string | Bounding box: sw_lat,sw_lng,ne_lat,ne_lng |
| camera | string | Filter by camera make/model |
| limit | int | Results per page (max 100, default 50) |
| offset | int | Pagination offset |
| sort | string | Sort field: taken_at, created_at, display_order |
| order | string | Sort order: ASC, DESC |
GET /api/media/search?tags=food,travel&limit=20
{
"success": true,
"data": [
{
"id": 123,
"url": "https://...",
"thumbnail": "https://...",
"width": 4000,
"height": 3000,
"taken_at": "2024-01-15 14:30:00",
"location": { "lat": 35.6762, "lng": 139.6503 },
"trip": { "id": 1, "name": "Tokyo 2024", "slug": "tokyo-2024" },
"tags": [
{ "id": 1, "name": "Food", "slug": "food", "color": "#f59e0b" }
]
}
],
"pagination": { "total": 150, "limit": 20, "offset": 0, "has_more": true }
}
GET
/api/media/get
Read
Get single photo by ID
| Parameter | Type | Description |
|---|---|---|
| id | int | Required Photo ID |
GET /api/media/get?id=123
{
"success": true,
"data": {
"id": 123,
"url": "https://cdn.example.com/photos/abc123.jpg",
"thumbnail": "https://cdn.example.com/thumbs/abc123.jpg",
"width": 4000,
"height": 3000,
"taken_at": "2024-01-15 14:30:00",
"location": { "lat": 35.6762, "lng": 139.6503 },
"trip": { "id": 1, "name": "Tokyo 2024", "slug": "tokyo-2024" },
"camera_info": { "make": "Sony", "model": "A7IV", "lens": "24-70mm f/2.8" },
"exposure_info": { "aperture": "f/2.8", "shutter_speed": "1/250", "iso": 400 },
"navigation": { "prev_id": 122, "next_id": 124 }
}
}
GET
/api/media/filters
Read
Get available filter options
Returns available years, cameras, and other filter options based on existing photos.
GET /api/media/filters
{
"success": true,
"filters": {
"years": [
{ "year": 2024, "count": 450 },
{ "year": 2023, "count": 320 }
],
"cameras": [
{ "make": "Sony", "model": "A7IV", "count": 280 },
{ "make": "Apple", "model": "iPhone 15 Pro", "count": 150 }
],
"trips": [
{ "id": 1, "name": "Tokyo 2024", "slug": "tokyo-2024", "photo_count": 125 }
],
"date_range": { "min": "2023-01-15", "max": "2024-12-20" },
"media_types": { "photo": 720, "video": 50 },
"location": { "with_location": 680, "without_location": 90 }
}
}