swagger: "2.0"
schemes:
  - https
host: skynewz-api-fortnite.herokuapp.com
basePath: /api
info:
  contact:
    x-twitter: FortniteGame
  description: REST API about Fortnite game
  title: FORTNITE REST API
  version: 3.1.5
  x-apisguru-categories:
    - entertainment
  x-logo:
    url: https://twitter.com/FortniteGame/profile_image?size=original
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/SkYNewZ/rest-fornite-api/develop/src/public/swagger.yaml
      version: "2.0"
  x-providerName: skynewz-api-fortnite.herokuapp.com
  x-unofficialSpec: true
consumes:
  - application/x-www-form-urlencoded
  - application/json
produces:
  - application/json
securityDefinitions:
  Bearer:
    in: header
    name: Authorization
    type: apiKey
tags:
  - description: How to access to this API
    name: Security
  - description: Get user info
    name: User
  - description: Get all you Fornite stats
    name: Stats
  - description: Get Fortnite status
    name: Check
  - description: Get all your PVE Stats
    name: PVE
  - description: Get store infos
    name: Store
paths:
  /check:
    get:
      responses:
        "200":
          description: Fortnite is okay !
          schema:
            properties:
              status:
                type: boolean
            type: object
        default:
          description: Unexpected error
          schema:
            properties:
              code:
                format: int32
                type: integer
              message:
                type: string
            type: object
      security:
        - Bearer: []
      summary: Get Fortnite game status
      tags:
        - Check
  /news:
    get:
      responses:
        "200":
          description: A JSON objects of current news
          schema:
            properties:
              br:
                properties:
                  _type:
                    description: Type of news
                    type: string
                  body:
                    type: string
                  image:
                    description: Image path of this news
                    type: string
                  title:
                    type: string
                type: object
              common:
                properties:
                  _type:
                    type: string
                  body:
                    type: string
                  title:
                    type: string
                type: object
              loginmessage:
                properties:
                  _type:
                    type: string
                  body:
                    type: string
                  title:
                    type: string
                type: object
              survivalmessage:
                properties:
                  _type:
                    type: string
                  body:
                    type: string
                  title:
                    type: string
                type: object
            type: object
        default:
          description: Unexpected error
          schema:
            properties:
              code:
                format: int32
                type: integer
              message:
                type: string
            type: object
      security:
        - Bearer: []
      summary: Get Fortnite News
      tags:
        - News
  /oauth/token:
    post:
      parameters:
        - in: formData
          name: email
          required: true
          type: string
        - in: formData
          name: password
          required: true
          type: string
      responses:
        "200":
          description: Your access token
          schema:
            properties:
              access_toekn:
                type: string
              expiresIn:
                description: Time in seconds for the validity of token
                type: string
            type: object
        "401":
          description: Authentication failed
          schema:
            properties:
              message:
                type: string
              success:
                type: boolean
            type: object
        "404":
          description: Authentication failed. User not found
          schema:
            properties:
              message:
                type: string
              success:
                type: boolean
            type: object
      summary: Get a Bearer token
      tags:
        - Security
  /pve/info:
    get:
      responses:
        "200":
          description: All okay
          schema:
            type: object
        default:
          description: Unexpected error
          schema:
            properties:
              code:
                format: int32
                type: integer
              message:
                type: string
            type: object
      security:
        - Bearer: []
      summary: Get Fortnite PVE Info (storm, etc)
      tags:
        - PVE
  "/pve/user/{username}":
    get:
      parameters:
        - description: Fortnite username
          in: path
          name: username
          required: true
          type: string
      responses:
        "200":
          description: All okay
          schema:
            type: object
        "404":
          description: User not found or not found on this plateform
          schema:
            properties:
              code:
                format: int32
                type: integer
              message:
                type: string
            type: object
        default:
          description: Unexpected error
          schema:
            properties:
              code:
                format: int32
                type: integer
              message:
                type: string
            type: object
      security:
        - Bearer: []
      summary: Get PVE Stat by given username
      tags:
        - PVE
  "/stats/id/{plateform}/{id}":
    get:
      parameters:
        - description: Playing plateform, can be xb1, ps4 or pc
          in: path
          name: plateform
          required: true
          type: string
        - description: Player ID
          in: path
          name: id
          required: true
          type: string
      responses:
        "200":
          description: JSON Object of user stats
          schema:
            properties:
              group:
                description: Stats on solo, duo or squad
                properties:
                  duo:
                    properties:
                      k/d:
                        description: Ratio Kill/Dead
                        type: number
                      kills:
                        description: Number of kills
                        type: integer
                      killsPerMatch:
                        description: Number of kill/match
                        type: string
                      killsPerMin:
                        description: Number of kill/minute
                        type: string
                      score:
                        type: integer
                      timePlayed:
                        description: Number of days, hours and minutes played
                        type: string
                      top10:
                        description: Number of top10
                        type: integer
                      top12:
                        description: Number of top12
                        type: integer
                      top25:
                        description: Number of top25
                        type: integer
                      top3:
                        description: Number of top3
                        type: integer
                      top5:
                        description: Number of top5
                        type: integer
                      top6:
                        description: Number of top6
                        type: integer
                      win%:
                        description: Wins ratio
                        type: number
                      wins:
                        description: Number of top1
                        type: integer
                    type: object
                  solo:
                    properties:
                      k/d:
                        description: Ratio Kill/Dead
                        type: number
                      kills:
                        description: Number of kills
                        type: integer
                      killsPerMatch:
                        description: Number of kill/match
                        type: string
                      killsPerMin:
                        description: Number of kill/minute
                        type: string
                      score:
                        type: integer
                      timePlayed:
                        description: Number of days, hours and minutes played
                        type: string
                      top10:
                        description: Number of top10
                        type: integer
                      top12:
                        description: Number of top12
                        type: integer
                      top25:
                        description: Number of top25
                        type: integer
                      top3:
                        description: Number of top3
                        type: integer
                      top5:
                        description: Number of top5
                        type: integer
                      top6:
                        description: Number of top6
                        type: integer
                      win%:
                        description: Wins ratio
                        type: number
                      wins:
                        description: Number of top1
                        type: integer
                    type: object
                  squad:
                    properties:
                      k/d:
                        description: Ratio Kill/Dead
                        type: number
                      kills:
                        description: Number of kills
                        type: integer
                      killsPerMatch:
                        description: Number of kill/match
                        type: string
                      killsPerMin:
                        description: Number of kill/minute
                        type: string
                      score:
                        type: integer
                      timePlayed:
                        description: Number of days, hours and minutes played
                        type: string
                      top10:
                        description: Number of top10
                        type: integer
                      top12:
                        description: Number of top12
                        type: integer
                      top25:
                        description: Number of top25
                        type: integer
                      top3:
                        description: Number of top3
                        type: integer
                      top5:
                        description: Number of top5
                        type: integer
                      top6:
                        description: Number of top6
                        type: integer
                      win%:
                        description: Wins ratio
                        type: number
                      wins:
                        description: Number of top1
                        type: integer
                    type: object
                type: object
              info:
                description: Display user info
                properties:
                  accountId:
                    type: integer
                  plateform:
                    type: string
                  username:
                    type: string
                type: object
              lifetimeStats:
                properties:
                  k/d:
                    description: Ratio Kill/Dead
                    type: number
                  kills:
                    description: Number of kills
                    type: integer
                  killsPerMatch:
                    description: Number of kill/match
                    type: string
                  killsPerMin:
                    description: Number of kill/minute
                    type: string
                  score:
                    type: integer
                  timePlayed:
                    description: Number of days, hours and minutes played
                    type: string
                  top10:
                    description: Number of top10
                    type: integer
                  top12:
                    description: Number of top12
                    type: integer
                  top25:
                    description: Number of top25
                    type: integer
                  top3:
                    description: Number of top3
                    type: integer
                  top5:
                    description: Number of top5
                    type: integer
                  top6:
                    description: Number of top6
                    type: integer
                  win%:
                    description: Wins ratio
                    type: number
                  wins:
                    description: Number of top1
                    type: integer
                type: object
            type: object
        "400":
          description: "Please precise a good platform: ps4/xb1/pc"
        "404":
          description: User not found or not found on this plateform
          schema:
            properties:
              code:
                format: int32
                type: integer
              message:
                type: string
            type: object
        default:
          description: Unexpected error
          schema:
            properties:
              code:
                format: int32
                type: integer
              message:
                type: string
            type: object
      security:
        - Bearer: []
      summary: Get user's stats by user id
      tags:
        - Stats
  "/stats/{plateform}/{username}":
    get:
      parameters:
        - description: Playing plateform, can be xb1, ps4 or pc
          in: path
          name: plateform
          required: true
          type: string
        - description: Player username
          in: path
          name: username
          required: true
          type: string
      responses:
        "200":
          description: JSON Object of user stats
          schema:
            properties:
              group:
                description: Stats on solo, duo or squad
                properties:
                  duo:
                    properties:
                      k/d:
                        description: Ratio Kill/Dead
                        type: number
                      kills:
                        description: Number of kills
                        type: integer
                      killsPerMatch:
                        description: Number of kill/match
                        type: string
                      killsPerMin:
                        description: Number of kill/minute
                        type: string
                      score:
                        type: integer
                      timePlayed:
                        description: Number of days, hours and minutes played
                        type: string
                      top10:
                        description: Number of top10
                        type: integer
                      top12:
                        description: Number of top12
                        type: integer
                      top25:
                        description: Number of top25
                        type: integer
                      top3:
                        description: Number of top3
                        type: integer
                      top5:
                        description: Number of top5
                        type: integer
                      top6:
                        description: Number of top6
                        type: integer
                      win%:
                        description: Wins ratio
                        type: number
                      wins:
                        description: Number of top1
                        type: integer
                    type: object
                  solo:
                    properties:
                      k/d:
                        description: Ratio Kill/Dead
                        type: number
                      kills:
                        description: Number of kills
                        type: integer
                      killsPerMatch:
                        description: Number of kill/match
                        type: string
                      killsPerMin:
                        description: Number of kill/minute
                        type: string
                      score:
                        type: integer
                      timePlayed:
                        description: Number of days, hours and minutes played
                        type: string
                      top10:
                        description: Number of top10
                        type: integer
                      top12:
                        description: Number of top12
                        type: integer
                      top25:
                        description: Number of top25
                        type: integer
                      top3:
                        description: Number of top3
                        type: integer
                      top5:
                        description: Number of top5
                        type: integer
                      top6:
                        description: Number of top6
                        type: integer
                      win%:
                        description: Wins ratio
                        type: number
                      wins:
                        description: Number of top1
                        type: integer
                    type: object
                  squad:
                    properties:
                      k/d:
                        description: Ratio Kill/Dead
                        type: number
                      kills:
                        description: Number of kills
                        type: integer
                      killsPerMatch:
                        description: Number of kill/match
                        type: string
                      killsPerMin:
                        description: Number of kill/minute
                        type: string
                      score:
                        type: integer
                      timePlayed:
                        description: Number of days, hours and minutes played
                        type: string
                      top10:
                        description: Number of top10
                        type: integer
                      top12:
                        description: Number of top12
                        type: integer
                      top25:
                        description: Number of top25
                        type: integer
                      top3:
                        description: Number of top3
                        type: integer
                      top5:
                        description: Number of top5
                        type: integer
                      top6:
                        description: Number of top6
                        type: integer
                      win%:
                        description: Wins ratio
                        type: number
                      wins:
                        description: Number of top1
                        type: integer
                    type: object
                type: object
              info:
                description: Display user info
                properties:
                  accountId:
                    type: integer
                  plateform:
                    type: string
                  username:
                    type: string
                type: object
              lifetimeStats:
                properties:
                  k/d:
                    description: Ratio Kill/Dead
                    type: number
                  kills:
                    description: Number of kills
                    type: integer
                  killsPerMatch:
                    description: Number of kill/match
                    type: string
                  killsPerMin:
                    description: Number of kill/minute
                    type: string
                  score:
                    type: integer
                  timePlayed:
                    description: Number of days, hours and minutes played
                    type: string
                  top10:
                    description: Number of top10
                    type: integer
                  top12:
                    description: Number of top12
                    type: integer
                  top25:
                    description: Number of top25
                    type: integer
                  top3:
                    description: Number of top3
                    type: integer
                  top5:
                    description: Number of top5
                    type: integer
                  top6:
                    description: Number of top6
                    type: integer
                  win%:
                    description: Wins ratio
                    type: number
                  wins:
                    description: Number of top1
                    type: integer
                type: object
            type: object
        "400":
          description: "Please precise a good platform: ps4/xb1/pc"
        "404":
          description: User not found or not found on this plateform
          schema:
            properties:
              code:
                format: int32
                type: integer
              message:
                type: string
            type: object
        default:
          description: Unexpected error
          schema:
            properties:
              code:
                format: int32
                type: integer
              message:
                type: string
            type: object
      security:
        - Bearer: []
      summary: Get user's stats by username
      tags:
        - Stats
  /store:
    get:
      responses:
        "200":
          description: Current store object
          schema:
            type: object
        default:
          description: Unexpected error
          schema:
            properties:
              code:
                format: int32
                type: integer
              message:
                type: string
            type: object
      security:
        - Bearer: []
      summary: Get Fortnite Store
      tags:
        - Store
  "/user/{plateform}/{username}":
    get:
      parameters:
        - description: Playing plateform, can be xb1, ps4 or pc
          in: path
          name: plateform
          required: true
          type: string
        - description: Player username
          in: path
          name: username
          required: true
          type: string
      responses:
        "200":
          description: JSON Object of user
          schema:
            properties:
              displayName:
                type: string
              id:
                description: ID of player
                type: string
            type: object
        "404":
          description: User not found or not found on this plateform
          schema:
            properties:
              code:
                format: int32
                type: integer
              message:
                type: string
            type: object
        default:
          description: Unexpected error
          schema:
            properties:
              code:
                format: int32
                type: integer
              message:
                type: string
            type: object
      security:
        - Bearer: []
      summary: Get a user by username
      tags:
        - User
