{
 "openapi": "3.0.3",
 "info": {
  "title": "Macau & Hong Kong Mark Six Draw API",
  "version": "1.0.0",
  "description": "Free static JSON API for Macau Mark Six and Hong Kong Mark Six draw results: latest draw, full draw history since 2020, and frequency/omission statistics. Updated after every draw (21:30 Asia/Shanghai). Data only — no predictions. License: CC BY 4.0.",
  "contact": {
   "name": "369777 Mark Six tools",
   "email": "3606700@gmail.com",
   "url": "https://369777.cc/api.html"
  },
  "license": {
   "name": "CC BY 4.0",
   "url": "https://creativecommons.org/licenses/by/4.0/"
  },
  "x-logo": {
   "url": "https://369777.cc/favicon.ico"
  }
 },
 "servers": [
  {
   "url": "https://369777.cc"
  }
 ],
 "paths": {
  "/api/latest.json": {
   "get": {
    "operationId": "getLatestDraws",
    "summary": "Latest Macau and Hong Kong draws",
    "responses": {
     "200": {
      "description": "Latest draw of each lottery",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "updated_at": {
           "type": "string"
          },
          "macau": {
           "type": "object",
           "properties": {
            "issue": {
             "type": "string",
             "example": "2026335"
            },
            "date": {
             "type": "string",
             "format": "date",
             "example": "2026-12-01"
            },
            "draw_time": {
             "type": "string",
             "example": "2026-12-01 21:32:32"
            },
            "numbers": {
             "type": "array",
             "items": {
              "type": "integer"
             },
             "minItems": 6,
             "maxItems": 6,
             "example": [
              12,
              9,
              5,
              10,
              7,
              46
             ]
            },
            "special": {
             "type": "integer",
             "example": 22
            },
            "zodiac": {
             "type": "array",
             "items": {
              "type": "string"
             },
             "minItems": 7,
             "maxItems": 7
            },
            "wave": {
             "type": "array",
             "items": {
              "type": "string",
              "enum": [
               "red",
               "blue",
               "green"
              ]
             },
             "minItems": 7,
             "maxItems": 7
            },
            "wave_zh": {
             "type": "array",
             "items": {
              "type": "string"
             },
             "minItems": 7,
             "maxItems": 7
            },
            "element": {
             "type": "array",
             "items": {
              "type": "string"
             },
             "minItems": 7,
             "maxItems": 7
            }
           },
           "required": [
            "issue",
            "date",
            "numbers",
            "special"
           ]
          },
          "hong_kong": {
           "type": "object",
           "properties": {
            "issue": {
             "type": "string",
             "example": "2026335"
            },
            "date": {
             "type": "string",
             "format": "date",
             "example": "2026-12-01"
            },
            "draw_time": {
             "type": "string",
             "example": "2026-12-01 21:32:32"
            },
            "numbers": {
             "type": "array",
             "items": {
              "type": "integer"
             },
             "minItems": 6,
             "maxItems": 6,
             "example": [
              12,
              9,
              5,
              10,
              7,
              46
             ]
            },
            "special": {
             "type": "integer",
             "example": 22
            },
            "zodiac": {
             "type": "array",
             "items": {
              "type": "string"
             },
             "minItems": 7,
             "maxItems": 7
            },
            "wave": {
             "type": "array",
             "items": {
              "type": "string",
              "enum": [
               "red",
               "blue",
               "green"
              ]
             },
             "minItems": 7,
             "maxItems": 7
            },
            "wave_zh": {
             "type": "array",
             "items": {
              "type": "string"
             },
             "minItems": 7,
             "maxItems": 7
            },
            "element": {
             "type": "array",
             "items": {
              "type": "string"
             },
             "minItems": 7,
             "maxItems": 7
            }
           },
           "required": [
            "issue",
            "date",
            "numbers",
            "special"
           ]
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/history-macau.json": {
   "get": {
    "operationId": "getMacauHistory",
    "summary": "Full Macau Mark Six draw history",
    "responses": {
     "200": {
      "description": "All Macau draws since 2020-03-07",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "lottery": {
           "type": "string"
          },
          "count": {
           "type": "integer"
          },
          "draws": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "issue": {
              "type": "string",
              "example": "2026335"
             },
             "date": {
              "type": "string",
              "format": "date",
              "example": "2026-12-01"
             },
             "draw_time": {
              "type": "string",
              "example": "2026-12-01 21:32:32"
             },
             "numbers": {
              "type": "array",
              "items": {
               "type": "integer"
              },
              "minItems": 6,
              "maxItems": 6,
              "example": [
               12,
               9,
               5,
               10,
               7,
               46
              ]
             },
             "special": {
              "type": "integer",
              "example": 22
             },
             "zodiac": {
              "type": "array",
              "items": {
               "type": "string"
              },
              "minItems": 7,
              "maxItems": 7
             },
             "wave": {
              "type": "array",
              "items": {
               "type": "string",
               "enum": [
                "red",
                "blue",
                "green"
               ]
              },
              "minItems": 7,
              "maxItems": 7
             },
             "wave_zh": {
              "type": "array",
              "items": {
               "type": "string"
              },
              "minItems": 7,
              "maxItems": 7
             },
             "element": {
              "type": "array",
              "items": {
               "type": "string"
              },
              "minItems": 7,
              "maxItems": 7
             }
            },
            "required": [
             "issue",
             "date",
             "numbers",
             "special"
            ]
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/history-hk.json": {
   "get": {
    "operationId": "getHongKongHistory",
    "summary": "Full Hong Kong Mark Six draw history",
    "responses": {
     "200": {
      "description": "All Hong Kong draws since 2020-01-02",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "lottery": {
           "type": "string"
          },
          "count": {
           "type": "integer"
          },
          "draws": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "issue": {
              "type": "string",
              "example": "2026335"
             },
             "date": {
              "type": "string",
              "format": "date",
              "example": "2026-12-01"
             },
             "draw_time": {
              "type": "string",
              "example": "2026-12-01 21:32:32"
             },
             "numbers": {
              "type": "array",
              "items": {
               "type": "integer"
              },
              "minItems": 6,
              "maxItems": 6,
              "example": [
               12,
               9,
               5,
               10,
               7,
               46
              ]
             },
             "special": {
              "type": "integer",
              "example": 22
             },
             "zodiac": {
              "type": "array",
              "items": {
               "type": "string"
              },
              "minItems": 7,
              "maxItems": 7
             },
             "wave": {
              "type": "array",
              "items": {
               "type": "string",
               "enum": [
                "red",
                "blue",
                "green"
               ]
              },
              "minItems": 7,
              "maxItems": 7
             },
             "wave_zh": {
              "type": "array",
              "items": {
               "type": "string"
              },
              "minItems": 7,
              "maxItems": 7
             },
             "element": {
              "type": "array",
              "items": {
               "type": "string"
              },
              "minItems": 7,
              "maxItems": 7
             }
            },
            "required": [
             "issue",
             "date",
             "numbers",
             "special"
            ]
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/stats.json": {
   "get": {
    "operationId": "getDrawStats",
    "summary": "Frequency and omission statistics",
    "responses": {
     "200": {
      "description": "Special-number frequencies, current omissions, hot/cold last 50 draws",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  }
 }
}