Image Upload API Documentation

This documentation describes the backend API endpoints provided by SKY Image Hosting, which support image uploads, cloud synchronization, file deletion, and direct access to uploaded files.

Overview

This API allows the uploading of one or multiple image files. It supports automatic conversion of supported image formats to WebP and automatic thumbnail generation. Upon upload, the system first calculates the file's SHA-256 checksum; if the file already exists, the existing record information is returned. Note that certain image formats (such as svg, gif, ico, raw, tif, tiff) do not support WebP conversion or thumbnail generation.

Endpoints

1. Public Upload Endpoint

URL: https://skyimg.net/api/upload

Method: POST

Supports uploading image files using multipart/form-data. The field name for files is file (multiple files can be uploaded simultaneously). Optional query parameters:

An optional HTTP request header x-sync-token can be used for subsequent cloud synchronization. If an uploaded file matches an existing record on the server, the existing record information is returned.

Successful Response (200 OK):

[
  {
    "url": "https://skyimg.net/up/2024/04/01/abc123.webp",
    "thumbnail": "https://skyimg.net/thumb/2024/04/01/def456.webp",
    "identifier": "unique-file-identifier"
  },
  {
    "url": "https://skyimg.net/up/2024/04/01/ghi789.png",
    "thumbnail": "https://skyimg.net/thumb/2024/04/01/jkl987.webp",
    "identifier": "another-unique-file-identifier"
  }
]

2. File Deletion

URL: https://skyimg.net/delete/:identifier

Method: DELETE

Deletes the file corresponding to the provided identifier (including the generated thumbnail) and removes any associated cloud synchronization record.

"File successfully deleted"

3. File Access

Uploaded files and generated thumbnails can be accessed directly via the following paths:

Usage Limits

To prevent abuse, upload restrictions have been implemented. The specific limitations are as follows: