{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/limzo-com/json-schema/limzo-com-group-directory-schema.json",
  "title": "GroupDirectory",
  "description": "Compact directory rows for discovering groups. Sorted by Limzo Score.",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/limzo-com-openapi.yml#/components/schemas/GroupDirectory",
  "type": "object",
  "required": [
    "ok",
    "total_matches",
    "groups"
  ],
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    },
    "docs": {
      "type": "string",
      "format": "uri",
      "description": "Human-readable API documentation."
    },
    "openapi": {
      "type": "string",
      "format": "uri",
      "description": "Machine-readable OpenAPI document for the REST API."
    },
    "query": {
      "type": [
        "string",
        "null"
      ],
      "description": "The normalized search keyword, or null when listing top groups."
    },
    "lang": {
      "type": [
        "string",
        "null"
      ],
      "description": "The applied ISO 639-1 language filter, or null when not filtering by language."
    },
    "total_matches": {
      "type": "integer",
      "description": "Groups that matched, before the limit was applied."
    },
    "groups": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "Use with /s/{slug}.json or the get_group_stats MCP tool."
          },
          "title": {
            "type": "string"
          },
          "username": {
            "type": [
              "string",
              "null"
            ],
            "description": "Telegram username without @, when the group is public on t.me."
          },
          "plan": {
            "type": "string",
            "enum": [
              "free",
              "pro",
              "community"
            ]
          },
          "member_count": {
            "type": [
              "integer",
              "null"
            ]
          },
          "score": {
            "type": "number",
            "description": "Limzo Score — the directory ranking metric."
          },
          "messages_7d": {
            "type": "integer"
          },
          "active_users_7d": {
            "type": "integer"
          },
          "language": {
            "type": [
              "object",
              "null"
            ],
            "description": "The group's language mix (primary language + top languages as percentages). Null when there is not enough signal.",
            "properties": {
              "primary": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Dominant language as an ISO 639-1 code."
              },
              "distinct": {
                "type": "integer",
                "description": "Number of distinct languages detected."
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "ISO 639-1 language code, or null for the aggregated \"other\" bucket."
                    },
                    "name": {
                      "type": "string"
                    },
                    "pct": {
                      "type": "number",
                      "description": "Share of the group, 0–100."
                    }
                  }
                }
              }
            }
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The human stats page for this group."
          },
          "stats_json": {
            "type": "string",
            "format": "uri",
            "description": "Full curated stats payload for this group."
          }
        }
      }
    }
  }
}