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

# Per-player aggregate stats across attended games

> Aggregate stat lines for one player across the games you attended (no-shows excluded). MLB players return a hitter or pitcher line; other leagues return appearance summaries.



## OpenAPI

````yaml get /v1/attending/players/{id}/stats
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/attending/players/{id}/stats:
    get:
      tags:
        - Attending
      summary: Per-player aggregate stats across attended games
      description: >-
        Aggregate stat lines for one player across the games you attended
        (no-shows excluded). MLB players return a hitter or pitcher line; other
        leagues return appearance summaries.
      operationId: getAttendedPlayerStats
      parameters:
        - schema:
            type:
              - integer
              - 'null'
          required: true
          name: id
          in: path
        - schema:
            type:
              - integer
              - 'null'
            example: 2025
            description: >-
              Optional. Single-season slice (matches event_data.season). Omit
              for career across all attended games.
          required: false
          description: >-
            Optional. Single-season slice (matches event_data.season). Omit for
            career across all attended games.
          name: season
          in: query
      responses:
        '200':
          description: Player aggregate stats
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      supported:
                        type: boolean
                        enum:
                          - true
                      hitter:
                        type: boolean
                        enum:
                          - true
                      league:
                        type: string
                        enum:
                          - mlb
                      scope:
                        type: string
                        enum:
                          - career
                          - season
                      season:
                        type: number
                      player:
                        type: object
                        properties:
                          id:
                            type: number
                          full_name:
                            type: string
                          primary_position:
                            type:
                              - string
                              - 'null'
                          primary_team:
                            $ref: '#/components/schemas/Team'
                        required:
                          - id
                          - full_name
                          - primary_position
                          - primary_team
                      games:
                        type: number
                      games_with_box_score:
                        type: number
                      batting:
                        type: object
                        properties:
                          pa:
                            type: number
                          ab:
                            type: number
                          r:
                            type: number
                          h:
                            type: number
                          doubles:
                            type: number
                          triples:
                            type: number
                          hr:
                            type: number
                          rbi:
                            type: number
                          bb:
                            type: number
                          k:
                            type: number
                          sb:
                            type: number
                          hbp:
                            type: number
                          total_bases:
                            type: number
                          avg:
                            type:
                              - string
                              - 'null'
                          slg:
                            type:
                              - string
                              - 'null'
                        required:
                          - pa
                          - ab
                          - r
                          - h
                          - doubles
                          - triples
                          - hr
                          - rbi
                          - bb
                          - k
                          - sb
                          - hbp
                          - total_bases
                          - avg
                          - slg
                    required:
                      - supported
                      - hitter
                      - league
                      - scope
                      - player
                      - games
                      - games_with_box_score
                      - batting
                  - type: object
                    properties:
                      supported:
                        type: boolean
                        enum:
                          - true
                      pitcher:
                        type: boolean
                        enum:
                          - true
                      league:
                        type: string
                        enum:
                          - mlb
                      scope:
                        type: string
                        enum:
                          - career
                          - season
                      season:
                        type: number
                      player:
                        type: object
                        properties:
                          id:
                            type: number
                          full_name:
                            type: string
                          primary_position:
                            type:
                              - string
                              - 'null'
                          primary_team:
                            $ref: '#/components/schemas/Team'
                        required:
                          - id
                          - full_name
                          - primary_position
                          - primary_team
                      games:
                        type: number
                      games_with_box_score:
                        type: number
                      pitching:
                        type: object
                        properties:
                          ip:
                            type: string
                          bf:
                            type: number
                          h:
                            type: number
                          r:
                            type: number
                          er:
                            type: number
                          bb:
                            type: number
                          k:
                            type: number
                          hr:
                            type: number
                          pitches:
                            type: number
                          strikes:
                            type: number
                          era:
                            type:
                              - string
                              - 'null'
                          whip:
                            type:
                              - string
                              - 'null'
                          decisions:
                            type: object
                            properties:
                              w:
                                type: number
                              l:
                                type: number
                              sv:
                                type: number
                              hld:
                                type: number
                              bs:
                                type: number
                            required:
                              - w
                              - l
                              - sv
                              - hld
                              - bs
                        required:
                          - ip
                          - bf
                          - h
                          - r
                          - er
                          - bb
                          - k
                          - hr
                          - pitches
                          - strikes
                          - era
                          - whip
                          - decisions
                    required:
                      - supported
                      - pitcher
                      - league
                      - scope
                      - player
                      - games
                      - games_with_box_score
                      - pitching
                  - type: object
                    properties:
                      supported:
                        type: boolean
                        enum:
                          - false
                      league:
                        type: string
                      reason:
                        type: string
                      scope:
                        type: string
                        enum:
                          - career
                          - season
                      season:
                        type: number
                      player:
                        type: object
                        properties:
                          id:
                            type: number
                          full_name:
                            type: string
                          primary_position:
                            type:
                              - string
                              - 'null'
                          primary_team:
                            $ref: '#/components/schemas/Team'
                        required:
                          - id
                          - full_name
                          - primary_position
                          - primary_team
                      appearances:
                        type: array
                        items:
                          type: object
                          properties:
                            event_id:
                              type: number
                            event_date:
                              type: string
                            title:
                              type: string
                            home_team:
                              type:
                                - string
                                - 'null'
                            away_team:
                              type:
                                - string
                                - 'null'
                            final_score:
                              type:
                                - string
                                - 'null'
                            my_team_won:
                              type:
                                - boolean
                                - 'null'
                          required:
                            - event_id
                            - event_date
                            - title
                            - home_team
                            - away_team
                            - final_score
                            - my_team_won
                    required:
                      - supported
                      - league
                      - reason
                      - scope
                      - player
                      - appearances
        '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:
    Team:
      type:
        - object
        - 'null'
      properties:
        id:
          type: integer
          example: 136
        league:
          type: string
          example: mlb
        abbreviation:
          type: string
          example: SEA
        location:
          type:
            - string
            - 'null'
          example: Seattle
        name:
          type: string
          example: Mariners
        full_name:
          type:
            - string
            - 'null'
          example: Seattle Mariners
        primary_color:
          type:
            - string
            - 'null'
          example: '#0C2C56'
        secondary_color:
          type:
            - string
            - 'null'
          example: '#005C5C'
        tertiary_color:
          type:
            - string
            - 'null'
          example: null
        ui_tint_color:
          type:
            - string
            - 'null'
          example: '#0C2C56'
        logo_url:
          type:
            - string
            - 'null'
          example: https://www.mlbstatic.com/team-logos/136.svg
        logo_dark_url:
          type:
            - string
            - 'null'
          example: https://www.mlbstatic.com/team-logos/team-cap-on-dark/136.svg
        logo_light_url:
          type:
            - string
            - 'null'
          example: https://www.mlbstatic.com/team-logos/team-cap-on-light/136.svg
        conference:
          type:
            - string
            - 'null'
          example: AL
        division:
          type:
            - string
            - 'null'
          example: AL West
      required:
        - id
        - league
        - abbreviation
        - location
        - name
        - full_name
        - primary_color
        - secondary_color
        - tertiary_color
        - ui_tint_color
        - logo_url
        - logo_dark_url
        - logo_light_url
        - conference
        - division
    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.

````

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