{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/twittrapi-com/json-schema/twittrapi-com-community-page-schema.json",
  "title": "CommunityPage",
  "description": "Simple format: a page of communities",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/twittrapi-com-openapi.json#/components/schemas/CommunityPage",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Community"
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Pass as cursor for the next page; null on the last page"
    },
    "previousCursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "X's top cursor, for polling newer items"
    },
    "hasNextPage": {
      "type": "boolean"
    }
  },
  "required": [
    "data",
    "nextCursor",
    "previousCursor",
    "hasNextPage"
  ],
  "$defs": {
    "Community": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string",
          "description": "Empty in search results"
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "memberCount": {
          "type": "integer"
        },
        "moderatorCount": {
          "type": "integer"
        },
        "joinPolicy": {
          "type": [
            "string",
            "null"
          ]
        },
        "nsfw": {
          "type": "boolean"
        },
        "topic": {
          "type": [
            "string",
            "null"
          ]
        },
        "bannerUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "creator": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "username": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "username"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "rules": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name",
              "description"
            ]
          }
        }
      },
      "required": [
        "id",
        "name",
        "description",
        "createdAt",
        "memberCount",
        "moderatorCount",
        "joinPolicy",
        "nsfw",
        "topic",
        "bannerUrl",
        "creator",
        "rules"
      ]
    }
  }
}