openapi: 3.0.3
info:
  title: Web3 Meetups Events API
  description: >
    Read-only public API for upcoming Web3, crypto, and blockchain events across India,
    listed at https://web3meetups.xyz. No authentication required.
  version: "1.0.0"
  contact:
    email: web3meetupsxyz@gmail.com
servers:
  - url: https://web3meetups.xyz
paths:
  /api/events:
    get:
      operationId: listEvents
      summary: List upcoming Web3 events in India
      description: >
        Returns all currently listed upcoming events, optionally filtered to a single city.
      parameters:
        - name: city
          in: query
          required: false
          description: Filter events to an exact (case-insensitive) city match, e.g. "Mumbai".
          schema:
            type: string
      responses:
        '200':
          description: A list of events (empty array if the city filter matches nothing).
          content:
            application/json:
              schema:
                type: object
                required: [events]
                properties:
                  events:
                    type: array
                    items:
                      $ref: '#/components/schemas/Event'
        '400':
          description: Malformed request (e.g. empty city parameter).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '405':
          description: Method not allowed (only GET is supported).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Event:
      type: object
      required: [date, city, name, link]
      properties:
        date:
          type: string
          description: Human-readable date, e.g. "18 Jul".
        city:
          type: string
          description: Event city, e.g. "Mumbai".
        name:
          type: string
          description: Event name.
        link:
          type: string
          format: uri
          description: Shortened event registration/info URL.
    Error:
      type: object
      required: [error]
      properties:
        error:
          type: object
          required: [code, message]
          properties:
            code:
              type: string
            message:
              type: string
