Skip to main content

Overview

The Song resource represents individual songs used in anime themes. Each song can be associated with multiple anime themes and artists through performances.

List Songs

GET
endpoint
/api/song
Retrieve a paginated list of songs.

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:
  • artists - Associated artists (deprecated, use performances)
  • performances - Song performances
  • performances.artist - Artists from performances
  • animethemes - Anime themes using this song
  • animethemes.anime - Anime for each theme
  • animethemes.animethemeentries - Theme entries
  • animethemes.animethemeentries.videos - Videos
  • resources - External resources (Spotify, YouTube, etc.)
filter[title]
string
Filter by song title
fields[song]
string
Comma-separated list of fields to return. Available fields:
  • song_id
  • title
  • title_native
sort
string
Sort by field. Prefix with - for descending order. Available: title, created_at, updated_at
q
string
Full-text search query across song titles

Response

songs
array
Array of song objects
song_id
integer
Unique identifier
title
string
Song title (romanized or English)
title_native
string
Song title in native language
created_at
string
ISO 8601 timestamp
updated_at
string
ISO 8601 timestamp

Example Request

curl "https://api.animethemes.moe/api/song?include=performances.artist,animethemes.anime&page[size]=10"

Example Response

{
  "songs": [
    {
      "song_id": 1,
      "title": "Tank!",
      "title_native": null,
      "created_at": "2024-01-15T12:00:00.000000Z",
      "updated_at": "2024-01-15T12:00:00.000000Z",
      "performances": [
        {
          "performance_id": 1,
          "song_id": 1,
          "as": "Artist",
          "artist": {
            "artist_id": 1,
            "name": "The Seatbelts",
            "slug": "the_seatbelts"
          }
        }
      ],
      "animethemes": [
        {
          "theme_id": 1,
          "type": "OP",
          "sequence": 1,
          "slug": "OP1",
          "anime": {
            "anime_id": 1,
            "name": "Cowboy Bebop",
            "slug": "cowboy_bebop"
          }
        }
      ]
    }
  ],
  "links": {
    "first": "https://api.animethemes.moe/api/song?page[number]=1",
    "next": "https://api.animethemes.moe/api/song?page[number]=2"
  },
  "meta": {
    "current_page": 1,
    "per_page": 10
  }
}

Show Song

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

Path Parameters

id
integer
required
The song ID

Query Parameters

include
string
Same includes as list endpoint

Example Request

curl "https://api.animethemes.moe/api/song/1?include=performances.artist,animethemes.anime,resources"

Example Response

{
  "song": {
    "song_id": 1,
    "title": "Tank!",
    "title_native": null,
    "created_at": "2024-01-15T12:00:00.000000Z",
    "updated_at": "2024-01-15T12:00:00.000000Z",
    "performances": [
      {
        "performance_id": 1,
        "as": "Artist",
        "artist": {
          "artist_id": 1,
          "name": "The Seatbelts"
        }
      }
    ],
    "animethemes": [
      {
        "theme_id": 1,
        "type": "OP",
        "sequence": 1,
        "anime": {
          "anime_id": 1,
          "name": "Cowboy Bebop"
        }
      }
    ],
    "resources": [
      {
        "resource_id": 1,
        "external_id": "3CTAyBp4M8M",
        "site": "YouTube",
        "link": "https://www.youtube.com/watch?v=3CTAyBp4M8M"
      }
    ]
  }
}

Create Song

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

Request Body

title
string
Song title (romanized or English)
title_native
string
Song title in native language
At least one of title or title_native should be provided.

Update Song

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

Request Body

Same fields as create endpoint (all optional).

Delete Song

DELETE
endpoint
/api/song/:id
Soft delete a song. Requires authentication.

Restore Song

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

Force Delete Song

DELETE
endpoint
/forceDelete/song/:id
Permanently delete a song. Requires authentication.

Build docs developers (and LLMs) love