API

Demo API documentation and endpoints

🔌

Demo API

This API documentation demonstrates REST endpoint design and backend architecture. The endpoints are functional within this demo environment.

Getting Started

1

Authentication

Demo environment uses session-based authentication with NextAuth.js integration.

2

Base URL

All API endpoints are relative to the current domain's /api path.

3

Response Format

All responses return JSON with consistent error handling and status codes.

Available Endpoints

GET/api/tracks

Retrieve all tracks with pagination

GET /api/tracks?page=1&limit=10
GET/api/tracks/{id}

Get specific track by ID

GET /api/tracks/clx123abc
GET/api/artists

List all artists with optional genre filter

GET /api/artists?genre=synthwave
GET/api/albums

Retrieve albums with track information

GET /api/albums

Example Response

GET /api/tracks response:

{
  "tracks": [
    {
      "id": "clx123abc",
      "title": "Neon Dreams",
      "description": "A synthwave journey...",
      "audioUrl": "https://example.com/track.mp3",
      "artworkUrl": "https://example.com/artwork.jpg",
      "duration": 180,
      "tempo": 128,
      "mood": "Energetic",
      "artist": {
        "id": "cly456def", 
        "name": "Demo Artist"
      },
      "album": {
        "id": "clz789ghi",
        "title": "Digital Horizons"
      }
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 50
  }
}

Explore the API

Test the endpoints and see the backend architecture in action.