This API provides random images of guppy.
GET /random-image
Returns a randomly selected guppy image.
Headers:
Accept: application/json (optional)
If Accept header is application/json:
{
"url": "https://res.cloudinary.com/your_cloud_name/image/upload/v12345/guppy_images/example.jpg",
"publicId": "guppy_images/example"
}
If no Accept header is specified, the API returns the image directly.
GET /api/images/count
Returns the total count of available images.
{
"count": 150,
"lastRefreshed": "2025-02-26T12:00:00.000Z"
}
GET /admin/refresh-cache
Forces the API to refresh the list of images from Cloudinary.
{
"success": true,
"count": 155,
"lastRefreshed": "2025-02-26T12:10:00.000Z"
}
Errors are returned in JSON format with appropriate HTTP status codes.
{
"error": "No images found."
}
{
"error": "Failed to retrieve random guppy image"
}
curl -H "Accept: application/json" https://guppy.tsrs.tech/random-image
curl -o guppy.jpg https://guppy.tsrs.tech/random-image
curl https://guppy.tsrs.tech/api/images/count
curl https://guppy.tsrs.tech/admin/refresh-cache
This API was built by the guppy fan club.