Skip to main content

Overview

The Audio resource represents audio track files extracted from videos. Audio files are typically in OGG or FLAC format and can be associated with multiple video files.

List Audio

GET
endpoint
/api/audio
Retrieve a paginated list of audio tracks.

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:
  • videos - Videos using this audio track
filter[basename]
string
Filter by audio basename
fields[audio]
string
Comma-separated list of fields to return. Available fields:
  • audio_id
  • basename
  • filename
  • path
  • size
  • mimetype
  • link
sort
string
Sort by field. Prefix with - for descending order. Available: basename, size, created_at, updated_at

Response

audios
array
Array of audio objects
audio_id
integer
Unique identifier
basename
string
Audio filename without extension
filename
string
Full filename with extension
path
string
Full storage path
size
integer
File size in bytes
mimetype
string
MIME type (e.g., “audio/ogg”, “audio/flac”)
Direct streaming URL
created_at
string
ISO 8601 timestamp
updated_at
string
ISO 8601 timestamp

Example Request

curl "https://api.animethemes.moe/api/audio?include=videos&page[size]=10"

Example Response

{
  "audios": [
    {
      "audio_id": 1,
      "basename": "CowboyBebop-OP1",
      "filename": "CowboyBebop-OP1.ogg",
      "path": "/audio/CowboyBebop-OP1.ogg",
      "size": 5242880,
      "mimetype": "audio/ogg",
      "link": "https://a.animethemes.moe/CowboyBebop-OP1.ogg",
      "created_at": "2024-01-15T12:00:00.000000Z",
      "updated_at": "2024-01-15T12:00:00.000000Z",
      "videos": [
        {
          "video_id": 1,
          "basename": "CowboyBebop-OP1",
          "resolution": 1080,
          "source": "BD"
        },
        {
          "video_id": 2,
          "basename": "CowboyBebop-OP1-NCBD720",
          "resolution": 720,
          "source": "BD"
        }
      ]
    }
  ],
  "links": {
    "first": "https://api.animethemes.moe/api/audio?page[number]=1",
    "next": "https://api.animethemes.moe/api/audio?page[number]=2"
  },
  "meta": {
    "current_page": 1,
    "per_page": 10
  }
}

Show Audio

GET
endpoint
/api/audio/:basename
Retrieve a single audio track by its basename.

Path Parameters

basename
string
required
The audio basename (filename without extension)

Query Parameters

include
string
Same includes as list endpoint

Example Request

curl "https://api.animethemes.moe/api/audio/CowboyBebop-OP1?include=videos"

Example Response

{
  "audio": {
    "audio_id": 1,
    "basename": "CowboyBebop-OP1",
    "filename": "CowboyBebop-OP1.ogg",
    "path": "/audio/CowboyBebop-OP1.ogg",
    "size": 5242880,
    "mimetype": "audio/ogg",
    "link": "https://a.animethemes.moe/CowboyBebop-OP1.ogg",
    "created_at": "2024-01-15T12:00:00.000000Z",
    "updated_at": "2024-01-15T12:00:00.000000Z",
    "videos": [
      {
        "video_id": 1,
        "basename": "CowboyBebop-OP1",
        "filename": "CowboyBebop-OP1.webm",
        "resolution": 1080,
        "source": "BD",
        "link": "https://v.animethemes.moe/CowboyBebop-OP1.webm"
      }
    ]
  }
}

Create Audio

POST
endpoint
/api/audio
Create a new audio track. Requires authentication.

Request Body

basename
string
required
Audio basename (unique)
filename
string
required
Full filename with extension
path
string
required
Storage path
size
integer
required
File size in bytes
mimetype
string
required
MIME type (e.g., “audio/ogg”, “audio/flac”)

Update Audio

PUT
endpoint
/api/audio/:basename
Update an existing audio track. Requires authentication.

Request Body

Same fields as create endpoint (all optional).

Delete Audio

DELETE
endpoint
/api/audio/:basename
Soft delete an audio track. Requires authentication.

Restore Audio

PATCH
endpoint
/restore/audio/:basename
Restore a soft-deleted audio track. Requires authentication.

Force Delete Audio

DELETE
endpoint
/forceDelete/audio/:basename
Permanently delete an audio track. Requires authentication.

Build docs developers (and LLMs) love