swagger: "2.0"
schemes:
  - https
  - http
host: api.fungenerators.com
info:
  description: |
    Below is the documentation for the API calls. You can try them out right here. 
  title: Random Lottery Number generator API
  version: "1.5"
  x-apisguru-categories:
    - text
  x-origin:
    - format: swagger
      url: https://fungenerators.com/yaml/lottery.yaml
      version: "2.0"
  x-providerName: fungenerators.com
  x-serviceName: lottery
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_apis.guru_assets_images_no-logo.svg
consumes:
  - application/json
produces:
  - application/json
  - application/xml
  - application/js
securityDefinitions:
  X-Fungenerators-Api-Secret:
    in: header
    name: X-Fungenerators-Api-Secret
    type: apiKey
tags:
  - description: Random Lottery number generation API
    externalDocs:
      description: Find out more
      url: http://fungenerators.com/api/lottery
    name: Lottery
paths:
  /lottery/countries:
    get:
      description: Get the complete list of countries supported in the number generation API.
      produces:
        - application/json
        - application/xml
        - application/js
      responses:
        "200":
          description: 200  response
          examples:
            application/json: |-
              { 
                "success":
                  {"total":76},
                "contents": {
                   "countries":
                      [
                        "Anguilla",
                        "Antigua and Barbuda",
                        "Australia",
                        "Austria",
                        "..."
                      ]
                }
              }
        "401":
          description: 401  response
          examples:
            application/json: |-
              {
                  "error": {
                      "code": 401,
                      "message": "Unauthorized"
                  }
              }
      security:
        - X-Fungenerators-Api-Secret: []
      tags:
        - Lottery
  /lottery/draw:
    get:
      description: Generate random draw for a given lottery game.
      parameters:
        - description: Lottery Game Name
          format: string
          in: query
          name: game
          required: true
          type: string
        - description: Number of draws (max 5 per request)
          format: integer
          in: query
          name: count
          required: false
          type: integer
      produces:
        - application/json
        - application/xml
        - application/js
      responses:
        "200":
          description: 200  response
          examples:
            application/json: |-
              {
                  "success": {
                      "total": 1
                  },
                  "contents": 
                      {
                        "numbers":
                          [
                            {"draw":[[21,10,6,44,17,5]]}
                          ]
                      }
              }
        "401":
          description: 401  response
          examples:
            application/json: |-
              {
                  "error": {
                      "code": 401,
                      "message": "Unauthorized"
                  }
              }
      security:
        - X-Fungenerators-Api-Secret: []
      tags:
        - Lottery
  /lottery/supported:
    get:
      description: Get the list of supported lottery games supported in the given country.
      parameters:
        - description: Country Name
          format: string
          in: query
          name: country
          required: true
          type: string
      produces:
        - application/json
        - application/xml
        - application/js
      responses:
        "200":
          description: 200  response
          examples:
            application/json: |-
              {
                  "success": {
                      "total":4
                    
                  },
                  "contents": {
                      "country" : "India",
                      "games" :
                      [
                        "india-playwin-easy-lotto",
                        "india-playwin-fast-digit-lottery",
                        "india-playwin-super-lotto",
                        "india-playwin-thunderball"
                      ]
                  }
              }            
        "401":
          description: 401  response
          examples:
            application/json: |-
              {
                  "error": {
                      "code": 401,
                      "message": "Unauthorized"
                  }
              }
      security:
        - X-Fungenerators-Api-Secret: []
      tags:
        - Lottery
