> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rewind.rest/llms.txt
> Use this file to discover all available pages before exploring further.

# Prepared recent albums with tracklists

> Returns up to 12 most recently played distinct albums that have accepted CD artwork and at least one song preview, newest first, with no time window. Albums whose disc art is missing, pending, or hidden, or with no preview for any song, are skipped, so a shelf can reach past newer listening. Each album includes its Apple Music catalog tracklist in disc/track order when stored (otherwise the songs played from it), previews, Apple Music links, artist image, all image sizes, and per-track play counts and last-played times. Prepared after each 15-minute scrobble sync, so newly accepted art appears at the next rebuild; no live provider requests. Supports If-None-Match.



## OpenAPI

````yaml get /v1/listening/discman
openapi: 3.1.0
info:
  title: Rewind API
  version: 1.0.0
  description: >-
    Personal data aggregation API. Syncs and serves data from Last.fm, Apple
    Music, Strava, Plex, Letterboxd, Discogs, Trakt, Instapaper, Google
    Calendar, and Gmail.


    ## Domains


    | Domain | Source | Description |

    |--------|--------|-------------|

    | **Listening** | Last.fm, Apple Music | Scrobbles, top
    artists/albums/tracks, streaks, stats |

    | **Running** | Strava | Activities, splits, gear, personal records, year
    summaries |

    | **Watching** | Plex, Letterboxd | Movies, TV shows, watch history,
    ratings, reviews |

    | **Collecting** | Discogs, Trakt | Vinyl/CD collection, physical media,
    wantlist |

    | **Reading** | Instapaper | Articles, highlights, reading progress, word
    count |

    | **Attending** | Google Calendar, Gmail | Live events, tickets, sports
    games, concerts, venues |


    ## Authentication


    All endpoints require a Bearer token. There are two key types:


    - **Read keys** (`rw_live_...`) — access all GET endpoints

    - **Admin keys** (`rw_admin_...`) — access all endpoints including sync
    triggers and data management


    Pass your key in the Authorization header: `Authorization: Bearer
    rw_live_...`


    ## Pagination


    List endpoints return paginated responses:


    ```json

    {
      "data": [...],
      "pagination": { "page": 1, "limit": 20, "total": 150, "total_pages": 8 }
    }

    ```


    The activity feed uses cursor-based pagination instead.


    ## Quick Start


    ```bash

    # Check the API is up

    curl https://api.rewind.rest/v1/health


    # Fetch recent scrobbles (requires read key)

    curl -H "Authorization: Bearer rw_live_..." \
      https://api.rewind.rest/v1/listening/recent

    # Fetch running stats

    curl -H "Authorization: Bearer rw_live_..." \
      https://api.rewind.rest/v1/running/stats
    ```


    ## Errors


    All errors follow the same envelope:


    ```json

    { "error": "Not found", "status": 404 }

    ```


    Common status codes: 400 (bad request), 401 (unauthorized), 404 (not found),
    500 (server error).
  contact:
    url: https://github.com/pdugan20/rewind
servers:
  - url: https://api.rewind.rest
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Listening
    description: Last.fm scrobbles, top charts, streaks, and stats.
  - name: Running
    description: Strava activities, splits, gear, records, and year summaries.
  - name: Watching
    description: >-
      Movies, TV shows, watch history, ratings, and reviews from Plex and
      Letterboxd.
  - name: Collecting
    description: Vinyl/CD collection from Discogs and physical media from Trakt.
  - name: Reading
    description: Articles, highlights, and reading stats from Instapaper.
  - name: Attending
    description: >-
      Live events you bought tickets for — sports games, concerts, theater.
      Sourced from Google Calendar and ticket-vendor email.
  - name: Feed
    description: Cross-domain activity feed with cursor-based pagination.
  - name: Search
    description: Full-text search across all domains.
  - name: Images
    description: Image proxy with on-the-fly transforms via Cloudflare Images.
  - name: System
    description: Health checks and sync status.
  - name: Admin
    description: >-
      API key management, sync triggers, and data administration. Requires admin
      key.
  - name: Webhooks
    description: Inbound webhook receivers for Strava and Plex. No auth required.
paths:
  /v1/listening/discman:
    get:
      tags:
        - Listening
      summary: Prepared recent albums with tracklists
      description: >-
        Returns up to 12 most recently played distinct albums that have accepted
        CD artwork and at least one song preview, newest first, with no time
        window. Albums whose disc art is missing, pending, or hidden, or with no
        preview for any song, are skipped, so a shelf can reach past newer
        listening. Each album includes its Apple Music catalog tracklist in
        disc/track order when stored (otherwise the songs played from it),
        previews, Apple Music links, artist image, all image sizes, and
        per-track play counts and last-played times. Prepared after each
        15-minute scrobble sync, so newly accepted art appears at the next
        rebuild; no live provider requests. Supports If-None-Match.
      operationId: getListeningDiscman
      responses:
        '200':
          description: Prepared shelf
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscmanSnapshot'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  status:
                    type: number
                required:
                  - error
                  - status
        '503':
          description: Shelf unavailable
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  status:
                    type: number
                required:
                  - error
                  - status
      security:
        - bearerAuth: []
components:
  schemas:
    DiscmanSnapshot:
      type: object
      properties:
        schema_version:
          type: number
          enum:
            - 1
        built_at:
          type: string
          format: date-time
        albums:
          type: array
          items:
            $ref: '#/components/schemas/DiscmanAlbum'
          maxItems: 12
      required:
        - schema_version
        - built_at
        - albums
    DiscmanAlbum:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        url:
          type:
            - string
            - 'null'
        apple_music_id:
          type:
            - integer
            - 'null'
        apple_music_url:
          type:
            - string
            - 'null'
          format: uri
        released_year:
          type:
            - integer
            - 'null'
        total_tracks:
          type:
            - integer
            - 'null'
        image:
          $ref: '#/components/schemas/DiscmanImage'
        artist:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
            url:
              type:
                - string
                - 'null'
            apple_music_id:
              type:
                - integer
                - 'null'
            apple_music_url:
              type:
                - string
                - 'null'
              format: uri
            genre:
              type:
                - string
                - 'null'
            image:
              $ref: '#/components/schemas/DiscmanImage'
          required:
            - id
            - name
            - url
            - apple_music_id
            - apple_music_url
            - genre
            - image
        last_played_at:
          type: string
          format: date-time
        play_count:
          type: integer
          minimum: 0
          description: All-time plays attributed to this album
        tracklist_source:
          type: string
          enum:
            - catalog
            - listens
          description: >-
            catalog: the released tracklist in disc/track order. listens: only
            songs played from this album, in first-heard order, when no catalog
            tracklist is stored.
        tracks:
          type: array
          items:
            $ref: '#/components/schemas/DiscmanTrack'
      required:
        - id
        - name
        - url
        - apple_music_id
        - apple_music_url
        - released_year
        - total_tracks
        - image
        - artist
        - last_played_at
        - play_count
        - tracklist_source
        - tracks
    DiscmanImage:
      type:
        - object
        - 'null'
      properties:
        thumbhash:
          type:
            - string
            - 'null'
        dominant_color:
          type:
            - string
            - 'null'
        accent_color:
          type:
            - string
            - 'null'
        urls:
          type: object
          properties:
            thumbnail:
              type: string
              format: uri
              description: 64px square
            small:
              type: string
              format: uri
              description: 150px square
            medium:
              type: string
              format: uri
              description: 300px square
            large:
              type: string
              format: uri
              description: 600px square
          required:
            - thumbnail
            - small
            - medium
            - large
      required:
        - thumbhash
        - dominant_color
        - accent_color
        - urls
    DiscmanTrack:
      type: object
      properties:
        position:
          type: integer
          exclusiveMinimum: 0
          description: 1-based play order within the album
        disc_number:
          type:
            - integer
            - 'null'
          exclusiveMinimum: 0
        track_number:
          type:
            - integer
            - 'null'
          exclusiveMinimum: 0
        name:
          type: string
        duration_ms:
          type:
            - integer
            - 'null'
          exclusiveMinimum: 0
        isrc:
          type:
            - string
            - 'null'
        apple_music_id:
          type:
            - integer
            - 'null'
        apple_music_url:
          type:
            - string
            - 'null'
          format: uri
        preview_url:
          type:
            - string
            - 'null'
          format: uri
        track_id:
          type:
            - integer
            - 'null'
          description: Listening track id when this song has been played
        play_count:
          type: integer
          minimum: 0
        last_played_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - position
        - disc_number
        - track_number
        - name
        - duration_ms
        - isrc
        - apple_music_id
        - apple_music_url
        - preview_url
        - track_id
        - play_count
        - last_played_at
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key. Read keys (rw_live_...) access GET endpoints. Admin keys
        (rw_admin_...) access all endpoints.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.