API Documentation

RESTful API endpoints for accessing public albums and images via our backend server

Overview

The ImageHost API provides programmatic access to public albums and images through a dedicated Express.js backend server hosted on Render. All endpoints return JSON responses and support CORS for browser-based applications.

Base URL

https://seruvo.onrender.com

Authentication

Currently, the API provides read-only access to public albums and images without authentication. Private albums are not able to be accessed with the API service.

Endpoints

GET/api/albums/{albumId}

Retrieve a specific public album by ID

Getting Album IDs

In your dashboard, click the <> icon next to any album to copy its ID for API use. This works for both public and private albums, but the API only returns data for public ones.

Path Parameters

ParameterTypeDescription
albumIdstringUUID of the album (copy from dashboard)

Example Request

GET /api/albums/123e4567-e89b-12d3-a456-426614174000

Example Response

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "My Public Album",
  "description": "A collection of photos",
  "is_public": true,
  "created_at": "2024-01-15T10:30:00Z"
}
GET/api/albums/{albumId}/images

Retrieve all images from a specific album

Path Parameters

ParameterTypeDescription
albumIdstringUUID of the album

Example Response

[
  {
    "id": "456e7890-e89b-12d3-a456-426614174001",
    "album_id": "123e4567-e89b-12d3-a456-426614174000",
    "filename": "1641234567890-abc123",
    "original_name": "sunset.jpg",
    "file_size": 2048576,
    "mime_type": "image/jpeg",
    "public_url": "https://storage.url/images/filename.jpg",
    "created_at": "2024-01-15T10:35:00Z"
  }
]
GET/api/images/{imageId}

Retrieve a specific image by ID

Path Parameters

ParameterTypeDescription
imageIdstringUUID of the image

Example Response

{
  "id": "456e7890-e89b-12d3-a456-426614174001",
  "album_id": "123e4567-e89b-12d3-a456-426614174000",
  "filename": "1641234567890-abc123",
  "original_name": "sunset.jpg",
  "file_size": 2048576,
  "mime_type": "image/jpeg",
  "public_url": "https://storage.url/images/filename.jpg",
  "alt_text": "Beautiful sunset over mountains",
  "created_at": "2024-01-15T10:35:00Z"
}

Error Responses

HTTP Status Codes

Status CodeDescription
200Success
400Bad Request - Missing or invalid parameters
403Forbidden - Album is private
404Not Found - Resource does not exist
500Internal Server Error

Error Response Format

{
  "error": "Album not found"
}

Rate Limiting & CORS

CORS Support

The API supports Cross-Origin Resource Sharing (CORS) and can be accessed from browser-based applications.

Rate Limiting

Currently no rate limiting is implemented, but this may be added in the future for fair usage.