openapi: 3.0.3
info:
  title: 'PPvR API docs'
  description: 'PPvR public API'
  version: 1.0.0
servers:
  -
    url: 'https://ppvr.andrus.io'
paths:
  /api/posts:
    get:
      summary: Posts
      operationId: posts
      description: 'Get all posts (paginated, 50 per page)'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1001lgy
                      player_id: 10549880
                      map_artist: Apocalyptica
                      map_title: 'Reign of Fear'
                      map_diff: III
                      author: kipster15
                      score: 128
                      ups: 131
                      downs: 3
                      silver: 0
                      gold: 0
                      platinum: 0
                      created_utc: 1672514755
                      final: 0
                      created_at: '2022-12-31T19:30:07.000000Z'
                      updated_at: '2023-01-01T19:15:15.000000Z'
                    -
                      id: 1001lgy
                      player_id: 10549880
                      map_artist: Apocalyptica
                      map_title: 'Reign of Fear'
                      map_diff: III
                      author: kipster15
                      score: 128
                      ups: 131
                      downs: 3
                      silver: 0
                      gold: 0
                      platinum: 0
                      created_utc: 1672514755
                      final: 0
                      created_at: '2022-12-31T19:30:07.000000Z'
                      updated_at: '2023-01-01T19:15:15.000000Z'
                  links:
                    first: '/?page=1'
                    last: '/?page=1'
                    prev: null
                    next: null
                  meta:
                    current_page: 1
                    from: 1
                    last_page: 1
                    links:
                      -
                        url: null
                        label: '&laquo; Previous'
                        active: false
                      -
                        url: '/?page=1'
                        label: '1'
                        active: true
                      -
                        url: null
                        label: 'Next &raquo;'
                        active: false
                    path: /
                    per_page: 50
                    to: 2
                    total: 2
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1001lgy
                        player_id: 10549880
                        map_artist: Apocalyptica
                        map_title: 'Reign of Fear'
                        map_diff: III
                        author: kipster15
                        score: 128
                        ups: 131
                        downs: 3
                        silver: 0
                        gold: 0
                        platinum: 0
                        created_utc: 1672514755
                        final: 0
                        created_at: '2022-12-31T19:30:07.000000Z'
                        updated_at: '2023-01-01T19:15:15.000000Z'
                      -
                        id: 1001lgy
                        player_id: 10549880
                        map_artist: Apocalyptica
                        map_title: 'Reign of Fear'
                        map_diff: III
                        author: kipster15
                        score: 128
                        ups: 131
                        downs: 3
                        silver: 0
                        gold: 0
                        platinum: 0
                        created_utc: 1672514755
                        final: 0
                        created_at: '2022-12-31T19:30:07.000000Z'
                        updated_at: '2023-01-01T19:15:15.000000Z'
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: 1001lgy
                        player_id:
                          type: integer
                          example: 10549880
                        map_artist:
                          type: string
                          example: Apocalyptica
                        map_title:
                          type: string
                          example: 'Reign of Fear'
                        map_diff:
                          type: string
                          example: III
                        author:
                          type: string
                          example: kipster15
                        score:
                          type: integer
                          example: 128
                        ups:
                          type: integer
                          example: 131
                        downs:
                          type: integer
                          example: 3
                        silver:
                          type: integer
                          example: 0
                        gold:
                          type: integer
                          example: 0
                        platinum:
                          type: integer
                          example: 0
                        created_utc:
                          type: integer
                          example: 1672514755
                        final:
                          type: integer
                          example: 0
                        created_at:
                          type: string
                          example: '2022-12-31T19:30:07.000000Z'
                        updated_at:
                          type: string
                          example: '2023-01-01T19:15:15.000000Z'
                  links:
                    type: object
                    properties:
                      first:
                        type: string
                        example: '/?page=1'
                      last:
                        type: string
                        example: '/?page=1'
                      prev:
                        type: string
                        example: null
                      next:
                        type: string
                        example: null
                  meta:
                    type: object
                    properties:
                      current_page:
                        type: integer
                        example: 1
                      from:
                        type: integer
                        example: 1
                      last_page:
                        type: integer
                        example: 1
                      links:
                        type: array
                        example:
                          -
                            url: null
                            label: '&laquo; Previous'
                            active: false
                          -
                            url: '/?page=1'
                            label: '1'
                            active: true
                          -
                            url: null
                            label: 'Next &raquo;'
                            active: false
                        items:
                          type: object
                          properties:
                            url:
                              type: string
                              example: null
                            label:
                              type: string
                              example: '&laquo; Previous'
                            active:
                              type: boolean
                              example: false
                      path:
                        type: string
                        example: /
                      per_page:
                        type: integer
                        example: 50
                      to:
                        type: integer
                        example: 2
                      total:
                        type: integer
                        example: 2
      tags:
        - Posts
      security: []
  '/api/posts/{id}':
    get:
      summary: Post
      operationId: post
      description: 'Get a post by id (same as reddit post id)'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 1001lgy
                    player_id: 10549880
                    map_artist: Apocalyptica
                    map_title: 'Reign of Fear'
                    map_diff: III
                    author: kipster15
                    score: 128
                    ups: 131
                    downs: 3
                    silver: 0
                    gold: 0
                    platinum: 0
                    created_utc: 1672514755
                    final: 0
                    created_at: '2022-12-31T19:30:07.000000Z'
                    updated_at: '2023-01-01T19:15:15.000000Z'
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: 1001lgy
                      player_id:
                        type: integer
                        example: 10549880
                      map_artist:
                        type: string
                        example: Apocalyptica
                      map_title:
                        type: string
                        example: 'Reign of Fear'
                      map_diff:
                        type: string
                        example: III
                      author:
                        type: string
                        example: kipster15
                      score:
                        type: integer
                        example: 128
                      ups:
                        type: integer
                        example: 131
                      downs:
                        type: integer
                        example: 3
                      silver:
                        type: integer
                        example: 0
                      gold:
                        type: integer
                        example: 0
                      platinum:
                        type: integer
                        example: 0
                      created_utc:
                        type: integer
                        example: 1672514755
                      final:
                        type: integer
                        example: 0
                      created_at:
                        type: string
                        example: '2022-12-31T19:30:07.000000Z'
                      updated_at:
                        type: string
                        example: '2023-01-01T19:15:15.000000Z'
      tags:
        - Posts
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'post id (same as reddit post id)'
        example: u3rk97
        required: true
        schema:
          type: string
  '/api/posts/by-player/{id}':
    get:
      summary: 'Posts by Player'
      operationId: postsByPlayer
      description: "Get a players' posts by player id (same as osu player id)"
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 1001lgy
                    player_id: 10549880
                    map_artist: Apocalyptica
                    map_title: 'Reign of Fear'
                    map_diff: III
                    author: kipster15
                    score: 128
                    ups: 131
                    downs: 3
                    silver: 0
                    gold: 0
                    platinum: 0
                    created_utc: 1672514755
                    final: 0
                    created_at: '2022-12-31T19:30:07.000000Z'
                    updated_at: '2023-01-01T19:15:15.000000Z'
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: 1001lgy
                      player_id:
                        type: integer
                        example: 10549880
                      map_artist:
                        type: string
                        example: Apocalyptica
                      map_title:
                        type: string
                        example: 'Reign of Fear'
                      map_diff:
                        type: string
                        example: III
                      author:
                        type: string
                        example: kipster15
                      score:
                        type: integer
                        example: 128
                      ups:
                        type: integer
                        example: 131
                      downs:
                        type: integer
                        example: 3
                      silver:
                        type: integer
                        example: 0
                      gold:
                        type: integer
                        example: 0
                      platinum:
                        type: integer
                        example: 0
                      created_utc:
                        type: integer
                        example: 1672514755
                      final:
                        type: integer
                        example: 0
                      created_at:
                        type: string
                        example: '2022-12-31T19:30:07.000000Z'
                      updated_at:
                        type: string
                        example: '2023-01-01T19:15:15.000000Z'
      tags:
        - Posts
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'player id (same as osu player id)'
        example: 124493
        required: true
        schema:
          type: integer
  /api/players:
    get:
      summary: Players
      operationId: players
      description: 'Get all players (paginated, 50 per page)'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 2
                      name: peppy
                      score: 9540
                      created_at: '2018-09-10T23:34:06.000000Z'
                      updated_at: '2024-08-01T21:51:04.000000Z'
                    -
                      id: 2
                      name: peppy
                      score: 9540
                      created_at: '2018-09-10T23:34:06.000000Z'
                      updated_at: '2024-08-01T21:51:04.000000Z'
                  links:
                    first: '/?page=1'
                    last: '/?page=1'
                    prev: null
                    next: null
                  meta:
                    current_page: 1
                    from: 1
                    last_page: 1
                    links:
                      -
                        url: null
                        label: '&laquo; Previous'
                        active: false
                      -
                        url: '/?page=1'
                        label: '1'
                        active: true
                      -
                        url: null
                        label: 'Next &raquo;'
                        active: false
                    path: /
                    per_page: 50
                    to: 2
                    total: 2
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 2
                        name: peppy
                        score: 9540
                        created_at: '2018-09-10T23:34:06.000000Z'
                        updated_at: '2024-08-01T21:51:04.000000Z'
                      -
                        id: 2
                        name: peppy
                        score: 9540
                        created_at: '2018-09-10T23:34:06.000000Z'
                        updated_at: '2024-08-01T21:51:04.000000Z'
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 2
                        name:
                          type: string
                          example: peppy
                        score:
                          type: integer
                          example: 9540
                        created_at:
                          type: string
                          example: '2018-09-10T23:34:06.000000Z'
                        updated_at:
                          type: string
                          example: '2024-08-01T21:51:04.000000Z'
                  links:
                    type: object
                    properties:
                      first:
                        type: string
                        example: '/?page=1'
                      last:
                        type: string
                        example: '/?page=1'
                      prev:
                        type: string
                        example: null
                      next:
                        type: string
                        example: null
                  meta:
                    type: object
                    properties:
                      current_page:
                        type: integer
                        example: 1
                      from:
                        type: integer
                        example: 1
                      last_page:
                        type: integer
                        example: 1
                      links:
                        type: array
                        example:
                          -
                            url: null
                            label: '&laquo; Previous'
                            active: false
                          -
                            url: '/?page=1'
                            label: '1'
                            active: true
                          -
                            url: null
                            label: 'Next &raquo;'
                            active: false
                        items:
                          type: object
                          properties:
                            url:
                              type: string
                              example: null
                            label:
                              type: string
                              example: '&laquo; Previous'
                            active:
                              type: boolean
                              example: false
                      path:
                        type: string
                        example: /
                      per_page:
                        type: integer
                        example: 50
                      to:
                        type: integer
                        example: 2
                      total:
                        type: integer
                        example: 2
      tags:
        - Players
      security: []
  '/api/players/{id}':
    get:
      summary: Player
      operationId: player
      description: 'Get a player by id (same as osu player id)'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 2
                    name: peppy
                    score: 9540
                    created_at: '2018-09-10T23:34:06.000000Z'
                    updated_at: '2024-08-01T21:51:04.000000Z'
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 2
                      name:
                        type: string
                        example: peppy
                      score:
                        type: integer
                        example: 9540
                      created_at:
                        type: string
                        example: '2018-09-10T23:34:06.000000Z'
                      updated_at:
                        type: string
                        example: '2024-08-01T21:51:04.000000Z'
      tags:
        - Players
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'player id (same as osu player id)'
        example: 124493
        required: true
        schema:
          type: integer
  '/api/ranks/{playerId}':
    get:
      summary: Ranks
      operationId: ranks
      description: 'Get the rank history for a player'
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 4620143
                      player_id: 7562902
                      rank: 1
                      created_at: '2024-09-12T03:00:39.000000Z'
                      updated_at: '2024-09-12T03:00:39.000000Z'
                    -
                      id: 4620143
                      player_id: 7562902
                      rank: 1
                      created_at: '2024-09-12T03:00:39.000000Z'
                      updated_at: '2024-09-12T03:00:39.000000Z'
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 4620143
                        player_id: 7562902
                        rank: 1
                        created_at: '2024-09-12T03:00:39.000000Z'
                        updated_at: '2024-09-12T03:00:39.000000Z'
                      -
                        id: 4620143
                        player_id: 7562902
                        rank: 1
                        created_at: '2024-09-12T03:00:39.000000Z'
                        updated_at: '2024-09-12T03:00:39.000000Z'
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 4620143
                        player_id:
                          type: integer
                          example: 7562902
                        rank:
                          type: integer
                          example: 1
                        created_at:
                          type: string
                          example: '2024-09-12T03:00:39.000000Z'
                        updated_at:
                          type: string
                          example: '2024-09-12T03:00:39.000000Z'
      tags:
        - Ranks
      security: []
    parameters:
      -
        in: path
        name: playerId
        description: 'player id (same as osu player id)'
        example: 124493
        required: true
        schema:
          type: integer
tags:
  -
    name: Posts
    description: ''
  -
    name: Players
    description: ''
  -
    name: Ranks
    description: ''
