{
  "openapi": "3.0.1",
  "info": {
    "title": "X Community Scraper",
    "description": "Search public X (Twitter) Communities by keyword and export community details, rules and member counts, the members X shows, and community posts. No login, no cookies. Pay only for rows saved.",
    "version": "0.1",
    "x-build-id": "MLmFAKXiVETlq4oJK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/coregent~x-community-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-coregent-x-community-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/coregent~x-community-scraper/runs": {
      "post": {
        "operationId": "runs-sync-coregent-x-community-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/coregent~x-community-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-coregent-x-community-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "search",
              "details",
              "members",
              "posts"
            ],
            "type": "string",
            "description": "<b>Search communities</b>: find communities by keyword (uses <i>Search terms</i>). <b>Community details</b>: name, description, rules, member count, topic and creation date of each community (uses <i>Community URLs</i>). <b>Members</b>: the members X shows for each community, about 20 per community (uses <i>Community URLs</i>). <b>Posts</b>: posts in each community (uses <i>Community URLs</i>). One mode per run.",
            "default": "search"
          },
          "searchTerms": {
            "title": "Search terms",
            "maxItems": 100,
            "type": "array",
            "description": "Keywords to find communities by, one per entry (e.g. <code>AI</code>, <code>crypto</code>, <code>photography</code>). Used by <b>Search communities</b> only. One-word terms match best: X's community search handles multi-word terms poorly, so they are tried as <code>star-wars</code>, then <code>starwars</code>.",
            "items": {
              "type": "string"
            }
          },
          "communityUrls": {
            "title": "Community URLs",
            "maxItems": 100,
            "type": "array",
            "description": "X community URLs (e.g. <code>https://x.com/i/communities/1493290339532222469</code>) or numeric community IDs, one per entry. Used by <b>Community details</b>, <b>Members</b> and <b>Posts</b>. Tip: run <b>Search communities</b> first and copy the <code>communityUrl</code> values.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Maximum results (total)",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stops the whole run after this many saved rows, across all inputs.",
            "default": 10
          },
          "maxItemsPerInput": {
            "title": "Maximum results per input",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Stops each search term (or community) after this many saved rows. Inputs are read in turns, a page each, so one large input can't use up the total limit.",
            "default": 1000
          },
          "minMemberCount": {
            "title": "Minimum members",
            "minimum": 0,
            "type": "integer",
            "description": "Search and Details modes: only keep communities with at least this many members. 0 = off. Applied after each page is fetched; dropped rows are never charged.",
            "default": 0
          },
          "postsRanking": {
            "title": "Posts order",
            "enum": [
              "Recency",
              "Relevance"
            ],
            "type": "string",
            "description": "Posts mode: <b>Recency</b> (newest first) or <b>Relevance</b> (X's top posts).",
            "default": "Recency"
          },
          "since": {
            "title": "Posts since",
            "type": "string",
            "description": "Posts mode: only keep posts from this date on. A date (<code>2026-11-01</code>) or a period back from the run's start (<code>7 days</code>, <code>2 weeks</code>, <code>3 months</code>). With <b>Recency</b> order the run stops reading a community once it reaches older posts. Leave empty for no date filter."
          },
          "includeDetails": {
            "title": "Include full community details",
            "type": "boolean",
            "description": "Search mode: add each found community's description, rules and creation date with one extra lookup per saved community, billed as a separate community-details event. Details mode always includes them.",
            "default": false
          },
          "excludeIds": {
            "title": "Skip these",
            "maxItems": 50000,
            "type": "array",
            "description": "Community IDs or URLs, member user IDs or handles, or post IDs or URLs to leave out, e.g. what you collected in an earlier run. Skipped rows are never charged.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxUpstreamCalls": {
            "title": "Maximum data requests per run",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Safety limit on requests to the data provider in one run. 0 = automatic (sized from your limits).",
            "default": 0
          },
          "failOnPartial": {
            "title": "Fail on partial results",
            "type": "boolean",
            "description": "Mark the run as failed when any input fails (e.g. an unknown community). Rows already saved are kept either way. Members lists being limited to the first ~20 members doesn't count as a failure.",
            "default": false
          },
          "debug": {
            "title": "Debug mode",
            "type": "boolean",
            "description": "Saves the first raw provider pages to the key-value store (DEBUG_RAW_PAGE_1…3) for troubleshooting.",
            "default": false
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}