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

# Get a user's Wrapped stats for a year or a recent rolling window



## OpenAPI

````yaml /api-reference/openapi.json get /app.rocksky.stats.getWrapped
openapi: 3.1.0
info:
  title: Rocksky XRPC API
  version: 1.0.0
  description: >-
    Generated from the registered Rocksky XRPC handlers and current lexicons.
    Provider-defined payloads remain open schemas. Some handlers return empty
    fallback objects on service failures. This reference describes the
    repository implementation; production may run an earlier revision.
  license:
    name: MIT License
    identifier: MIT
servers:
  - url: https://api.rocksky.app/xrpc
    description: Rocksky API
security: []
paths:
  /app.rocksky.stats.getWrapped:
    get:
      tags:
        - app.rocksky.stats
      summary: Get a user's Wrapped stats for a year or a recent rolling window
      operationId: app.rocksky.stats.getWrapped
      parameters:
        - name: did
          in: query
          required: true
          description: The DID or handle of the user
          schema:
            type: string
            description: The DID or handle of the user
            x-lexicon-format: at-identifier
        - name: year
          in: query
          required: false
          description: The year to get wrapped stats for (defaults to current year)
          schema:
            type: integer
            description: The year to get wrapped stats for (defaults to current year)
            minimum: 2000
        - name: period
          in: query
          required: false
          description: >-
            The window to compute stats over: a calendar year (see year), or a
            rolling window ending now. Defaults to year.
          schema:
            type: string
            description: >-
              The window to compute stats over: a calendar year (see year), or a
              rolling window ending now. Defaults to year.
            x-lexicon-knownValues:
              - year
              - 3months
              - month
              - 2weeks
              - week
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/app.rocksky.stats.defs__wrappedView'
        '400':
          description: Invalid XRPC request or parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/XrpcError'
        default:
          description: XRPC error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/XrpcError'
      security: []
components:
  schemas:
    app.rocksky.stats.defs__wrappedView:
      type: object
      properties:
        year:
          type: integer
          description: The year of the wrapped stats.
        period:
          type: string
          description: The window the stats cover.
          x-lexicon-knownValues:
            - year
            - 3months
            - month
            - 2weeks
            - week
        startDate:
          type: string
          description: Inclusive start of the window.
          format: date-time
        endDate:
          type: string
          description: Exclusive end of the window.
          format: date-time
        totalScrobbles:
          type: integer
          description: Total scrobbles in the year.
          minimum: 0
        totalListeningTimeMinutes:
          type: integer
          description: Total listening time in minutes.
          minimum: 0
        topArtists:
          type: array
          items:
            $ref: '#/components/schemas/app.rocksky.stats.defs__wrappedArtist'
          description: Top 5 artists by play count.
        topTracks:
          type: array
          items:
            $ref: '#/components/schemas/app.rocksky.stats.defs__wrappedTrack'
          description: Top 5 tracks by play count.
        topAlbums:
          type: array
          items:
            $ref: '#/components/schemas/app.rocksky.stats.defs__wrappedAlbum'
          description: Top 6 albums by play count.
        topGenres:
          type: array
          items:
            $ref: '#/components/schemas/app.rocksky.stats.defs__wrappedGenreCount'
          description: Top genres by play count.
        scrobblesPerMonth:
          type: array
          items:
            $ref: '#/components/schemas/app.rocksky.stats.defs__wrappedMonthCount'
          description: Scrobble counts per month.
        scrobblesPerDay:
          type: array
          items:
            $ref: '#/components/schemas/app.rocksky.stats.defs__wrappedDayCount'
          description: Scrobble counts per day (UTC), only days with plays.
        mostActiveDay:
          $ref: '#/components/schemas/app.rocksky.stats.defs__wrappedDayCount'
          description: The most active day of the year.
        mostActiveHour:
          type: integer
          description: The most active hour of the day (0-23).
          minimum: 0
          maximum: 23
        newArtistsCount:
          type: integer
          description: Number of artists heard for the first time this year.
          minimum: 0
        longestStreak:
          type: integer
          description: Longest consecutive days streak.
          minimum: 0
        firstScrobble:
          $ref: '#/components/schemas/app.rocksky.stats.defs__wrappedMilestone'
          description: The first scrobble of the year.
        lastScrobble:
          $ref: '#/components/schemas/app.rocksky.stats.defs__wrappedMilestone'
          description: The last scrobble of the year.
    XrpcError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        message:
          type: string
    app.rocksky.stats.defs__wrappedArtist:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the artist.
        name:
          type: string
          description: The name of the artist.
        picture:
          type: string
          description: The picture URL of the artist.
        uri:
          type: string
          description: The AT-URI of the artist.
          x-lexicon-format: at-uri
        playCount:
          type: integer
          description: Number of plays in the wrapped period.
          minimum: 0
    app.rocksky.stats.defs__wrappedTrack:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the track.
        title:
          type: string
          description: The title of the track.
        artist:
          type: string
          description: The artist of the track.
        albumArt:
          type: string
          description: The album art URL.
        uri:
          type: string
          description: The AT-URI of the track.
          x-lexicon-format: at-uri
        artistUri:
          type: string
          description: The AT-URI of the artist.
          x-lexicon-format: at-uri
        albumUri:
          type: string
          description: The AT-URI of the album.
          x-lexicon-format: at-uri
        playCount:
          type: integer
          description: Number of plays in the wrapped period.
          minimum: 0
    app.rocksky.stats.defs__wrappedAlbum:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the album.
        title:
          type: string
          description: The title of the album.
        artist:
          type: string
          description: The artist of the album.
        albumArt:
          type: string
          description: The album art URL.
        uri:
          type: string
          description: The AT-URI of the album.
          x-lexicon-format: at-uri
        playCount:
          type: integer
          description: Number of plays in the wrapped period.
          minimum: 0
    app.rocksky.stats.defs__wrappedGenreCount:
      type: object
      properties:
        genre:
          type: string
          description: The genre name.
        count:
          type: integer
          description: Number of scrobbles for this genre.
          minimum: 0
    app.rocksky.stats.defs__wrappedMonthCount:
      type: object
      properties:
        month:
          type: integer
          description: Month number (1-12).
          minimum: 1
          maximum: 12
        count:
          type: integer
          description: Number of scrobbles in this month.
          minimum: 0
    app.rocksky.stats.defs__wrappedDayCount:
      type: object
      properties:
        date:
          type: string
          description: The date (YYYY-MM-DD).
        count:
          type: integer
          description: Number of scrobbles on this day.
          minimum: 0
    app.rocksky.stats.defs__wrappedMilestone:
      type: object
      properties:
        trackTitle:
          type: string
          description: The title of the track.
        artistName:
          type: string
          description: The name of the artist.
        timestamp:
          type: string
          description: The timestamp of the scrobble.
          format: date-time
        trackUri:
          type: string
          description: >-
            AT-URI of the track record, used to build a clickable link to the
            song page.
          x-lexicon-format: at-uri

````

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