Skip to main content

Overview

The Image resource represents cover images, artwork, and other visual assets. Images can be associated with anime, artists, studios, and playlists with different facets (Cover, Small Cover, Grill).

List Images

GET
endpoint
/api/image
Retrieve a paginated list of images.

Query Parameters

page[size]
integer
Number of results per page (default: 15, max: 100)
page[number]
integer
Page number to retrieve
include
string
Comma-separated list of relationships to include. Available includes:
  • anime - Anime using this image
  • artists - Artists using this image
  • studios - Studios using this image
  • playlists - Playlists using this image
filter[facet]
string
Filter by image facet. Values: Cover, Small Cover, Grill
filter[path]
string
Filter by image path
fields[image]
string
Comma-separated list of fields to return. Available fields:
  • image_id
  • path
  • facet
  • link
sort
string
Sort by field. Prefix with - for descending order. Available: facet, created_at, updated_at

Response

images
array
Array of image objects
image_id
integer
Unique identifier
path
string
Storage path relative to image disk
facet
string
Image type (Cover, Small Cover, Grill)
Direct URL to the image
created_at
string
ISO 8601 timestamp
updated_at
string
ISO 8601 timestamp

Example Request

curl "https://api.animethemes.moe/api/image?include=anime,artists&filter[facet]=Cover&page[size]=10"

Example Response

{
  "images": [
    {
      "image_id": 1,
      "path": "anime/cowboy_bebop_cover.jpg",
      "facet": "Cover",
      "link": "https://animethemes.moe/storage/images/anime/cowboy_bebop_cover.jpg",
      "created_at": "2024-01-15T12:00:00.000000Z",
      "updated_at": "2024-01-15T12:00:00.000000Z",
      "anime": [
        {
          "anime_id": 1,
          "name": "Cowboy Bebop",
          "slug": "cowboy_bebop"
        }
      ],
      "artists": []
    }
  ],
  "links": {
    "first": "https://api.animethemes.moe/api/image?page[number]=1",
    "next": "https://api.animethemes.moe/api/image?page[number]=2"
  },
  "meta": {
    "current_page": 1,
    "per_page": 10
  }
}

Show Image

GET
endpoint
/api/image/:id
Retrieve a single image by its ID.

Path Parameters

id
integer
required
The image ID

Query Parameters

include
string
Same includes as list endpoint

Example Request

curl "https://api.animethemes.moe/api/image/1?include=anime,artists,studios"

Example Response

{
  "image": {
    "image_id": 1,
    "path": "anime/cowboy_bebop_cover.jpg",
    "facet": "Cover",
    "link": "https://animethemes.moe/storage/images/anime/cowboy_bebop_cover.jpg",
    "created_at": "2024-01-15T12:00:00.000000Z",
    "updated_at": "2024-01-15T12:00:00.000000Z",
    "anime": [
      {
        "anime_id": 1,
        "name": "Cowboy Bebop",
        "slug": "cowboy_bebop",
        "year": 1998
      }
    ],
    "artists": [],
    "studios": [
      {
        "studio_id": 1,
        "name": "Sunrise",
        "slug": "sunrise"
      }
    ]
  }
}

Create Image

POST
endpoint
/api/image
Create a new image. Requires authentication.

Request Body

path
string
required
Storage path for the image
facet
string
required
Image facet/type (Cover, Small Cover, Grill)
The actual image file must be uploaded separately to the storage system.

Update Image

PUT
endpoint
/api/image/:id
Update an existing image. Requires authentication.

Request Body

Same fields as create endpoint (all optional).

Delete Image

DELETE
endpoint
/api/image/:id
Soft delete an image. Requires authentication.

Restore Image

PATCH
endpoint
/restore/image/:id
Restore a soft-deleted image. Requires authentication.

Force Delete Image

DELETE
endpoint
/forceDelete/image/:id
Permanently delete an image. Requires authentication.

Image Facets

Images can have different facets that determine their usage:
Cover
facet
Standard cover image (typically 640x640 or similar)
Small Cover
facet
Thumbnail-sized cover image (typically 256x256 or similar)
Grill
facet
Character artwork/promotional images

Build docs developers (and LLMs) love