> ## 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.

# Top artists

> Returns your top artists for a given time period.



## OpenAPI

````yaml get /v1/listening/top/artists
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/top/artists:
    get:
      tags:
        - Listening
      summary: Top artists
      description: Returns your top artists for a given time period.
      operationId: getListeningTopArtists
      parameters:
        - schema:
            type: string
            enum:
              - 7day
              - 1month
              - 3month
              - 6month
              - 12month
              - overall
            default: 7day
            example: 7day
          required: false
          name: period
          in: query
        - schema:
            type: integer
            minimum: 1
            default: 1
            example: 1
          required: false
          name: page
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 50
            default: 10
            example: 10
          required: false
          name: limit
          in: query
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
            description: Single day (YYYY-MM-DD). Overrides from/to.
            example: '2025-02-17'
          required: false
          description: Single day (YYYY-MM-DD). Overrides from/to.
          name: date
          in: query
        - schema:
            type: string
            description: Range start, inclusive (ISO 8601)
            example: '2025-02-01T00:00:00Z'
          required: false
          description: Range start, inclusive (ISO 8601)
          name: from
          in: query
        - schema:
            type: string
            description: Range end, inclusive (ISO 8601)
            example: '2025-02-28T23:59:59Z'
          required: false
          description: Range end, inclusive (ISO 8601)
          name: to
          in: query
        - schema:
            type:
              - boolean
              - 'null'
            description: >-
              When true, attach a `sparkline` object (granularity + zero-filled
              points) to each item. On rolling-period endpoints, supported for
              period in {1month, 3month, 6month, 12month, overall}. `overall`
              returns yearly buckets covering the artist/album/track lifetime;
              `7day` is unsupported and the field is omitted.
            example: false
          required: false
          description: >-
            When true, attach a `sparkline` object (granularity + zero-filled
            points) to each item. On rolling-period endpoints, supported for
            period in {1month, 3month, 6month, 12month, overall}. `overall`
            returns yearly buckets covering the artist/album/track lifetime;
            `7day` is unsupported and the field is omitted.
          name: include_sparklines
          in: query
      responses:
        '200':
          description: Top artists list
          content:
            application/json:
              schema:
                type: object
                properties:
                  period:
                    type: string
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        rank:
                          type: number
                        id:
                          type: number
                        name:
                          type: string
                        detail:
                          type: string
                        playcount:
                          type: number
                        image: {}
                        url:
                          type: string
                        apple_music_url:
                          type:
                            - string
                            - 'null'
                        preview_url:
                          type:
                            - string
                            - 'null'
                        sparkline:
                          type: object
                          properties:
                            granularity:
                              type: string
                              enum:
                                - day
                                - week
                                - month
                                - year
                            points:
                              type: array
                              items:
                                type: number
                          required:
                            - granularity
                            - points
                      required:
                        - rank
                        - id
                        - name
                        - detail
                        - playcount
                        - url
                        - apple_music_url
                  pagination:
                    $ref: '#/components/schemas/PaginationMeta'
                required:
                  - period
                  - data
                  - pagination
              example:
                period: 12month
                data:
                  - rank: 1
                    id: 130
                    name: Beastie Boys
                    detail: ''
                    playcount: 4011
                    genre: Hip-Hop
                    image:
                      url: >-
                        https://cdn.rewind.rest/listening/artists/130/original.jpg?width=300&height=300&fit=cover&format=auto&quality=85&v=1
                      thumbhash: GggGBwDN+CSBp7VXcmVmlyZ2BgAAAAAA
                      dominant_color: '#191919'
                      accent_color: '#7e7e7e'
                    url: https://www.last.fm/music/Beastie+Boys
                    apple_music_url: null
                    sparkline:
                      granularity: week
                      points:
                        - 3
                        - 5
                        - 12
                        - 8
                        - 4
                        - 0
                        - 0
                        - 6
                        - 9
                        - 11
                        - 14
                        - 7
                        - 5
                        - 8
                        - 12
                        - 18
                        - 22
                        - 19
                        - 11
                        - 6
                        - 4
                        - 8
                        - 13
                        - 17
                        - 21
                        - 16
                        - 9
                        - 5
                        - 3
                        - 7
                        - 12
                        - 18
                        - 24
                        - 19
                        - 14
                        - 8
                        - 5
                        - 9
                        - 13
                        - 17
                        - 22
                        - 28
                        - 25
                        - 18
                        - 12
                        - 7
                        - 4
                        - 9
                        - 14
                        - 19
                        - 23
                        - 26
                  - rank: 2
                    id: 189
                    name: Nirvana
                    detail: ''
                    playcount: 2179
                    genre: Grunge
                    image: null
                    url: https://www.last.fm/music/Nirvana
                    apple_music_url: https://music.apple.com/us/artist/nirvana/112018?uo=4
                  - rank: 3
                    id: 92
                    name: Taylor Swift
                    detail: ''
                    playcount: 2164
                    genre: Country
                    image: null
                    url: https://www.last.fm/music/Taylor+Swift
                    apple_music_url: >-
                      https://music.apple.com/us/artist/taylor-swift/159260351?uo=4
                pagination:
                  page: 1
                  limit: 20
                  total: 29
                  total_pages: 2
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    PaginationMeta:
      type: object
      properties:
        page:
          type: integer
          example: 1
        limit:
          type: integer
          example: 20
        total:
          type: integer
          example: 150
        total_pages:
          type: integer
          example: 8
      required:
        - page
        - limit
        - total
        - total_pages
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          example: Not found
        status:
          type: integer
          example: 404
      required:
        - error
        - status
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key. Read keys (rw_live_...) access GET endpoints. Admin keys
        (rw_admin_...) access all endpoints.

````