A flask based image hosting service.
The app exposes a read-only public API and a private API with endpoints for individual images and collections of images. All collection names share a common namespace.
Returns a JSON object with the name of the collection and a list of images in the collection.
Example: /api/c/my_collection
{
"type": "collection",
"name": "my_collection",
"images": [
{},
{}
]
}
Returns a JSON object with a single image.
Example: /api/i/01V9PaTx/my_image.jpg
{
"type": "image",
"url": "https://s3.amazonaws.com/my_bucket/01V9PaTx/my_image.jpg",
"s3_key": "01V9PaTx/my_image.jpg",
"title": "Image Title",
"description": "A description of the image.",
"size": {"width": 1920, "height": 1080},
"colors": ["#ffffff"],
"thumbs": [
{
"size": {"width": 512, "height": 288},
"url": "https://s3.amazonaws.com/my_bucket/01V9PaTx/t512/my_image.jpg"
}
]
}
All private endpoints require an API key or username and password sent using HTTP basic auth. When using an API key, send any string as the username, and the key as the password.
Returns a list of API keys.
Create a new API key.
Parameters:
description (optional) : A text description of the key. Use to indicate where this key is used. Defaults to an empty string.
Get a specific API key.
Update an existing API key.
Parameters:
description : A text description of the key. Use to indicate where this key is used. Defaults to an empty string.
Delete an API key.
Returns a list of collections.
Create a new collection.
Parameters:
name : A unique name used to identify the collecion.
Get a specific collection. The returned collection object also contains the associated images.
Delete a collecion.
Returns a list of images.
Create a new image.
Parameters:
s3_key : The S3 key of the image.
s3_bucket : The S3 bucket where the image is stored.
title (optional) : A title for the image.
description (optional) : A description of the image.
Get a specific image.
Update an image.
Parameters:
title (optional) : A title for the image.
description (optional) : A description of the image.
Delete an image.
Returns a list of images belonging to a collection.
Get an image if it belongs to a collection.
Add an image to a collection.
Remove an image from a collection.