openapi: 3.1.0
info:
  title: TG4 4DDraw.com public data API
  description: |
    Read-only static dataset of Malaysian 4D lottery results, published as
    CC0 public-domain JSON, CSV, and Atom/RSS/JSON Feed snapshots.
    Regenerated each build (~hourly during draws).
  version: mp974618
  license:
    name: CC0-1.0
    identifier: CC0-1.0
  contact:
    name: 4DDraw.com
    url: https://4ddraw.com/
servers:
  - url: https://4ddraw.com
paths:
  /api/index.json:
    get:
      summary: API root (hypermedia index of all endpoints)
      responses:
        "200":
          description: Discovery doc (tg4.api-index.v1)
          content:
            application/json: {}
  /api/today.json:
    get:
      summary: Today's 4D results for all operators
      responses:
        "200":
          description: tg4.today.v1 snapshot
          content:
            application/json:
              schema:
                $ref: 'https://4ddraw.com/api/today.schema.json'
  /api/today.csv:
    get:
      summary: Today's 4D results as CSV
      responses:
        "200":
          description: CSV with banner comments
          content:
            text/csv: {}
  /api/today.md:
    get:
      summary: Today's 4D results as Markdown
      responses:
        "200":
          description: Human-friendly Markdown
          content:
            text/markdown: {}
  /api/today.schema.json:
    get:
      summary: JSON Schema for /api/today.json
      responses:
        "200":
          description: Draft 2020-12 schema
          content:
            application/schema+json: {}
  /api/operators.json:
    get:
      summary: Static operator catalog (11 entries)
      responses:
        "200":
          description: tg4.operators.v1
          content:
            application/json: {}
  /feed.json:
    get:
      summary: JSON Feed 1.1
      responses:
        "200":
          description: jsonfeed.org/version/1.1
          content:
            application/feed+json: {}
  /atom.xml:
    get:
      summary: Atom 1.0
      responses:
        "200":
          description: RFC 4287
          content:
            application/atom+xml: {}
  /rss.xml:
    get:
      summary: RSS 2.0
      responses:
        "200":
          description: RSS 2.0
          content:
            application/rss+xml: {}
