openapi: 3.0.3
info:
  title: 'API Documentation'
  description: ''
  version: 1.0.0
servers:
  -
    url: 'https://sportsfever.ai'
paths:
  /api/player:
    get:
      summary: 'GET /api/player'
      operationId: gETapiplayer
      description: 'Display all the players.'
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {YOUR_AUTH_KEY}'
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n\"data\": [\n{\n\"pid\": 1,\n\"title\": \"Martin Guptill\",\n\"short_name\": \"Martin Guptill\",\n\"first_name\": \"Martin Guptill\",\n\"last_name\" : \"\",\n\"nationality\": \"New Zealand\",\n\"birthdate\": \"30-09-1986\",\n\"country\": \"nz\"\n},{\n \"pid\": 29,\n\"title\": \"Brendon McCullum\",\n\"short_name\": \"Brendon McCullum\",\n\"first_name\": \"Brendon McCullum\",\n\"last_name\": \"\",\n\"nationality\": \"New Zealand\",\n\"birthdate\": \"27-09-1981\",\n\"country\": \"nz\"\n}\n],\n}"
      tags:
        - Endpoints
  '/api/player/{id}':
    get:
      summary: 'GET /api/player/{id}'
      operationId: gETapiplayerid
      description: 'Display the details of the specified player.'
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {YOUR_AUTH_KEY}'
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n   \"title\": \"Martin Guptill\",\n   \"short_name\": \"Martin Guptill\",\n   \"first_name\": \"Martin Guptill\",\n   \"last_name\": \"\",\n   \"middle_name\": \"\",\n   \"birthdate\": \"30-09-1986\",\n   \"birthplace\": \"\",\n   \"country\": \"nz\",\n   \"primary_team\": \"[]\",\n   \"logo_url\": \"\",\n   \"playing_role\": \"bat\",\n   \"batting_style\": \"\",\n   \"bowling_style\": \"\",\n   \"fielding_position\": \"\",\n   \"recent_match\": \"0\",\n   \"recent_appearance\": \"0\",\n   \"fantasy_player_rating\": \"8.5\",\n   \"alt_name\": \"\",\n   \"nationality\": \"New Zealand\",\n   \"batting_stats\": [\n       {\n       \"match_id\": 0,\n       \"inning_id\": 0,\n       \"matches\": 47,\n       \"innings\": 89,\n       \"notout\": 1,\n       \"runs\": 2586,\n       \"balls\": 5548,\n       \"highest\": 189,\n       \"runs100\": 3,\n       \"runs50\": 17,\n       \"runs4\": 326,\n       \"runs6\": 23,\n       \"average\": 29.38,\n       \"strike\": 46.61,\n       \"catches\": 50,\n       \"stumpings\": 0,\n       \"fastest50balls\": 0,\n        \"fastest100balls\": 0,\n        \"type\": \"test\"\n        },\n   ],\n   \"bowling_stats\": [\n       {\n       \"match_id\": 0,\n       \"inning_id\": 0,\n       \"matches\": 47,\n       \"innings\": 18,\n       \"balls\": 428,\n       \"overs\": 71.2,\n       \"runs\": 298,\n       \"wickets\": 8,\n       \"bestinning\": \"3/11\",\n       \"bestmatch\": \"3/11\",\n       \"econ\": 4.17,\n       \"average\": 37.25,\n       \"strike\": 53.5,\n       \"wicket4i\": 0,\n       \"wicket5i\": 0,\n       \"wicket10m\": 0,\n       \"hattrick\": 0,\n       \"expensive_over_runs\": 0,\n       \"type\": \"test\"\n       },\n   ]\n   }"
      tags:
        - Endpoints
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the player.'
        example: 27
        required: true
        schema:
          type: integer
  /api/latest-commentary:
    get:
      summary: 'GET /api/latest-commentary'
      operationId: gETapilatestCommentary
      description: 'Get the latest commentary for the specified match'
      parameters:
        -
          in: query
          name: match_id
          description: 'The ID of the match.'
          example: '1'
          required: true
          schema:
            type: string
            description: 'The ID of the match.'
            example: '1'
        -
          in: query
          name: lang
          description: 'The language of the commentary.'
          example: 'Hindi, English, Malayalam.'
          required: true
          schema:
            type: string
            description: 'The language of the commentary.'
            example: 'Hindi, English, Malayalam.'
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {YOUR_AUTH_KEY}'
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  status: success
                  data:
                    match_id: 1
                    commentary: 'Martin Guptill to Shikhar Dhawan, no run, full and outside off, Dhawan drives it to mid off'
                    over: 1
                    ball: 1
                    runs: 0
                    wicket: 0
                    extra: 0
                properties:
                  status:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      match_id:
                        type: integer
                        example: 1
                      commentary:
                        type: string
                        example: 'Martin Guptill to Shikhar Dhawan, no run, full and outside off, Dhawan drives it to mid off'
                      over:
                        type: integer
                        example: 1
                      ball:
                        type: integer
                        example: 1
                      runs:
                        type: integer
                        example: 0
                      wicket:
                        type: integer
                        example: 0
                      extra:
                        type: integer
                        example: 0
      tags:
        - Endpoints
  /api/all-commentary:
    get:
      summary: 'GET /api/all-commentary'
      operationId: gETapiallCommentary
      description: 'Get all the commentaries for the specified match'
      parameters:
        -
          in: query
          name: match_id
          description: 'The ID of the match.'
          example: '1'
          required: true
          schema:
            type: string
            description: 'The ID of the match.'
            example: '1'
        -
          in: query
          name: lang
          description: 'The language of the commentary.'
          example: 'Hindi, English, Malayalam.'
          required: true
          schema:
            type: string
            description: 'The language of the commentary.'
            example: 'Hindi, English, Malayalam.'
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {YOUR_AUTH_KEY}'
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "[\n{\n \"innings\": 2,\n \"over\": 1,\n \"ball\": 6,\n \"runs\": 2,\n \"wicket\": 0,\n \"extra\": 0,\n \"batter1\": \"Kane Williamson\",\n \"batter2\": \"Martin Guptill\",\n \"bowler\": \"Rohit Sharma\",\n \"commetary\": \"Kane Williamson takes a double toward third man good running between the wickets. Rohit Sharma ball’s a Fast delivery on full length on off stump. \"\n},\n{\n \"innings\": 2,\n \"over\": 1,\n \"ball\": 5,\n \"runs\": 1,\n \"wicket\": 0,\n \"extra\": 0,\n \"batter1\": \"Martin Guptill\",\n \"batter2\": \"Kane Williamson\",\n \"bowler\": \"Rohit Sharma\",\n \"commetary\": \"Martin Guptill takes a single toward deep third man. Rohit Sharma ball’s a Fast delivery on full length on off stump. \"\n},"
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                match_id:
                  type: number
                  description: 'Must be at least 1. Must not be greater than 99999.'
                  example: 3
                lang:
                  type: string
                  description: 'Must contain only letters. Must be one of <code>Hindi</code>, <code>English</code>, <code>Malayalam</code>, <code>Telugu</code>, <code>Bengali</code>, <code>Kannada</code>, or <code>Tamil</code>.'
                  example: Kannada
              required:
                - match_id
                - lang
  /api/match:
    get:
      summary: 'GET /api/match'
      operationId: gETapimatch
      description: 'Display the details of all the matches.'
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {YOUR_AUTH_KEY}'
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{[\n\"id\": 1,\n\"team_a\": 1,\n\"team_b\": 2,\n\"match_type\": \"ODI\",\n\"started\": 1,\n\"finished\": 0\n],\n[\n\"id\": 2,\n\"team_a\": 3,\n\"team_b\": 4,\n\"match_type\": \"ODI\",\n\"started\": 1,\n\"finished\": 0\n]\n}"
      tags:
        - Endpoints
  '/api/match/{match_id}':
    get:
      summary: 'GET /api/match/{match_id}'
      operationId: gETapimatchmatchId
      description: 'Display the details of the specified match.'
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {YOUR_AUTH_KEY}'
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  team_a: 1
                  team_b: 2
                  match_type: ODI
                  started: 1
                  finished: 0
                  toss_winner: 1
                  innings:
                    - '1'
                    - '2'
                properties:
                  team_a:
                    type: integer
                    example: 1
                  team_b:
                    type: integer
                    example: 2
                  match_type:
                    type: string
                    example: ODI
                  started:
                    type: integer
                    example: 1
                  finished:
                    type: integer
                    example: 0
                  toss_winner:
                    type: integer
                    example: 1
                  innings:
                    type: array
                    example:
                      - '1'
                      - '2'
                    items:
                      type: string
      tags:
        - Endpoints
    parameters:
      -
        in: path
        name: match_id
        description: 'The ID of the match.'
        example: '1'
        required: true
        schema:
          type: string
  /api/team:
    get:
      summary: 'GET /api/team'
      operationId: gETapiteam
      description: 'Display the details of all the teams.'
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {YOUR_AUTH_KEY}'
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 1
                  name: 'New Zealand'
                  team_short: NZ
                properties:
                  id:
                    type: integer
                    example: 1
                  name:
                    type: string
                    example: 'New Zealand'
                  team_short:
                    type: string
                    example: NZ
      tags:
        - Endpoints
  '/api/team/{team_id}':
    get:
      summary: 'GET /api/team/{team_id}'
      operationId: gETapiteamteamId
      description: 'Display the details of the specified team.'
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {YOUR_AUTH_KEY}'
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  name: 'New Zealand'
                  team_short: NZ
                properties:
                  name:
                    type: string
                    example: 'New Zealand'
                  team_short:
                    type: string
                    example: NZ
      tags:
        - Endpoints
    parameters:
      -
        in: path
        name: team_id
        description: 'The ID of the team.'
        example: 1
        required: true
        schema:
          type: integer
tags:
  -
    name: Endpoints
    description: ''
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: ''
security:
  -
    default: []
