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

# Year in review

> Returns a year-in-review summary with monthly breakdown and top runs.



## OpenAPI

````yaml get /v1/running/year/{year}
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/running/year/{year}:
    get:
      tags:
        - Running
      summary: Year in review
      description: Returns a year-in-review summary with monthly breakdown and top runs.
      operationId: getRunningYearInReview
      parameters:
        - schema:
            type: string
          required: true
          name: year
          in: path
      responses:
        '200':
          description: Year in review
          content:
            application/json:
              schema:
                type: object
                properties:
                  year:
                    type: number
                  total_runs:
                    type: number
                  total_distance_mi:
                    type: number
                  total_elevation_ft:
                    type: number
                  total_duration_s:
                    type: number
                  avg_pace:
                    type: string
                  longest_run_mi:
                    type: number
                  race_count:
                    type: number
                  monthly:
                    type: array
                    items:
                      type: object
                      properties:
                        month:
                          type: string
                        runs:
                          type: number
                        distance_mi:
                          type: number
                        duration_s:
                          type: number
                        elevation_ft:
                          type: number
                      required:
                        - month
                        - runs
                        - distance_mi
                        - duration_s
                        - elevation_ft
                  top_runs:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                        strava_id:
                          type: number
                        name:
                          type: string
                        date:
                          type: string
                        distance_mi:
                          type: number
                        duration:
                          type: string
                        duration_s:
                          type: number
                        pace:
                          type: string
                        elevation_ft:
                          type: number
                        heartrate_avg:
                          type:
                            - number
                            - 'null'
                        heartrate_max:
                          type:
                            - number
                            - 'null'
                        cadence:
                          type:
                            - number
                            - 'null'
                        calories:
                          type:
                            - number
                            - 'null'
                        suffer_score:
                          type:
                            - number
                            - 'null'
                        city:
                          type:
                            - string
                            - 'null'
                        state:
                          type:
                            - string
                            - 'null'
                        polyline:
                          type:
                            - string
                            - 'null'
                        is_race:
                          type: boolean
                        workout_type:
                          type: string
                        strava_url:
                          type:
                            - string
                            - 'null'
                      required:
                        - id
                        - strava_id
                        - name
                        - date
                        - distance_mi
                        - duration
                        - duration_s
                        - pace
                        - elevation_ft
                        - heartrate_avg
                        - heartrate_max
                        - cadence
                        - calories
                        - suffer_score
                        - city
                        - state
                        - polyline
                        - is_race
                        - workout_type
                        - strava_url
                required:
                  - year
                  - total_runs
                  - total_distance_mi
                  - total_elevation_ft
                  - total_duration_s
                  - avg_pace
                  - longest_run_mi
                  - race_count
                  - monthly
                  - top_runs
              example:
                year: 2025
                total_runs: 120
                total_distance_mi: 540.2
                total_elevation_ft: 18500
                total_duration_s: 257400
                avg_pace: 7:55/mi
                longest_run_mi: 13.1
                race_count: 3
                monthly:
                  - month: 2025-01
                    runs: 8
                    distance_mi: 35.2
                    duration_s: 17100
                    elevation_ft: 1200
                  - month: 2025-02
                    runs: 10
                    distance_mi: 42.1
                    duration_s: 20400
                    elevation_ft: 1500
                top_runs:
                  - id: 12345
                    strava_id: 12345
                    name: Portland Half Marathon
                    date: '2025-10-06'
                    distance_mi: 13.1
                    duration: '1:45:00'
                    duration_s: 6300
                    pace: 8:01/mi
                    elevation_ft: 320
                    heartrate_avg: 160
                    heartrate_max: 178
                    cadence: 77
                    calories: 1400
                    suffer_score: 120
                    city: Portland
                    state: OR
                    polyline: null
                    is_race: true
                    workout_type: race
                    strava_url: https://www.strava.com/activities/12345
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    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.

````