# X Community Scraper (`coregent/x-community-scraper`) Actor

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.

- **URL**: https://apify.com/coregent/x-community-scraper.md
- **Developed by:** [Delowar Munna](https://apify.com/coregent) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 community results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## X Community Scraper

![X Community Scraper](https://raw.githubusercontent.com/coregentdevspace/x-community-scraper-assets/main/thumbnail-x-community-scraper.png)

Find and export public **X (Twitter) Communities**. Search communities by keyword, pull each community's details (name, description, rules, member count, topic, creation date), list the members X shows, and export community posts with likes, reposts, replies and views. Every record is one flat row in JSON, CSV, Excel or Google Sheets, or call it from the API, Make, Zapier, n8n or an AI agent.

- **No login, no cookies, no X account.** Public data only.
- **Four modes:** search communities, community details, members, posts. One mode per run.
- **Batch inputs:** up to 100 search terms or community URLs per run, read in turns so one large input can't use up your total limit.
- **Honest coverage.** X shows only the first ~20 members of a community; the Actor says so in every members run instead of pretending to export the full roster.
- **Filters:** minimum members for communities, a date cut-off for posts, and a skip list for what you already have.
- **Pay only for rows saved.** Duplicates, rows your filters or skip list drop, failed inputs and empty runs are free.
- **Clear status messages** and a `RUN_SUMMARY` with per-input coverage, so you know what was found, what failed and why the run stopped.

### What can you do with it?

| Use case | Mode | Typical setup |
|---|---|---|
| **Find niche communities** to join, sponsor or study | Search communities | A few keywords, **Minimum members** 1,000 |
| **Compare communities** in a market | Community details | The community URLs from a search, for descriptions, rules, member counts and topics |
| **Community research and moderation analysis** | Community details | Rules and descriptions side by side |
| **See who is active in a community** | Members | The members X shows: handle, name, profile link, picture and verified badge |
| **Monitor what a community talks about** | Posts | **Recency** order, **Posts since** `7 days`, on a daily schedule |
| **Content and trend datasets** | Posts | Several communities, JSON into your analysis pipeline |

### How to use it

1. Pick **What to scrape**: Search communities, Community details, Members or Posts.
2. For **Search communities**, add **Search terms**. For the other modes, add **Community URLs** (`https://x.com/i/communities/<id>`) or numeric community IDs.
3. Set **Maximum results (total)** and, for several inputs, **Maximum results per input**.
4. Optionally add filters, **Include full community details** (search), or a skip list.
5. Click **Start**, then download the results from the **Output** tab.

Run it with the defaults and it searches communities for `AI` and returns up to 10.

**Tip:** run **Search communities** first, then copy the `communityUrl` values into **Community URLs** for the other modes.

#### The four modes

| Mode | Input | One row per | Notes |
|---|---|---|---|
| **Search communities** | Search terms | Community found | Name, member count, topic, banner. Turn on **Include full community details** to add the description, rules and creation date |
| **Community details** | Community URLs or IDs | Community | Name, description, rules, member count, topic, creation date, banner, sensitive-content flag |
| **Members** | Community URLs or IDs | Member | The members X shows, **about 20 per community** (see Limits): handle, name, profile link, picture, verified badge |
| **Posts** | Community URLs or IDs | Post | **Recency** (newest first) or **Relevance** order; text, date, author, likes, reposts, replies, quotes, views, hashtags, media |

Inputs that don't fit the mode are ignored with a warning (for example search terms in Posts mode). Entries that aren't a community URL or ID (a profile link, a post link, another website) are skipped and listed in the run log. A community that doesn't exist or can't be read is reported in the status message, and the run carries on with the others.

#### Filters and options

| Option | Modes | What it does |
|---|---|---|
| Minimum members | Search, Details | Keeps communities with at least this many members (0 = off) |
| Posts order | Posts | Recency (newest first) or Relevance |
| Posts since | Posts | Keeps posts from a date (`2026-11-01`) or a period (`7 days`, `2 weeks`, `3 months`). With Recency order, reading a community stops once it reaches older posts |
| Include full community details | Search | One extra lookup per saved community for the description, rules and creation date, billed as a separate `community-details` event |
| Skip these | All | Community IDs or URLs, member IDs or handles, post IDs or URLs to leave out |
| Fail on partial results | All | Marks the run failed when any input fails. Rows already saved are kept |

Filters work on each page after it's fetched. Rows they drop are never charged, but the pages still have to be read, so a strict filter makes a run take longer to reach your limit.

### Input examples

**Search communities, default size:**

```json
{
    "mode": "search",
    "searchTerms": ["AI"],
    "maxItems": 10
}
```

**Search three topics with full details** (the run behind the Communities screenshot below):

```json
{
    "mode": "search",
    "searchTerms": ["AI", "photography", "crypto"],
    "maxItems": 20,
    "maxItemsPerInput": 7,
    "includeDetails": true
}
```

**Larger communities only:**

```json
{
    "mode": "search",
    "searchTerms": ["crypto", "fitness", "photography"],
    "maxItems": 60,
    "maxItemsPerInput": 20,
    "minMemberCount": 1000
}
```

**Details of specific communities:**

```json
{
    "mode": "details",
    "communityUrls": ["https://x.com/i/communities/1506797806761172993"]
}
```

**Members of two communities:**

```json
{
    "mode": "members",
    "communityUrls": ["https://x.com/i/communities/1506797806761172993", "1533759195526348800"],
    "maxItems": 40
}
```

**Last week's posts in a community, newest first:**

```json
{
    "mode": "posts",
    "communityUrls": ["https://x.com/i/communities/1506797806761172993"],
    "postsRanking": "Recency",
    "since": "7 days",
    "maxItems": 200
}
```

`1506797806761172993` is the "STREET PHOTOGRAPHY" community and `1533759195526348800` is "Photography". Swap in the `communityUrl` values from your own search run.

### Output

One row per community, member or post, depending on the mode. All rows share the same columns; the fields a mode doesn't fill are `null`. A value X doesn't provide is `null`, never a guess.

**Every row**

| Field | Description |
|---|---|
| `recordType` | `community`, `member` or `post` |
| `mode` | The mode that produced the row |
| `communityId`, `communityUrl` | The community |
| `name` | The community's name (on member and post rows too) |
| `memberCount` | The community's member count (on member and post rows too, when available) |
| `sourceInput` | The search term or community you entered |
| `sourceProvider`, `scrapedAt`, `runId`, `schemaVersion` | Data source, collection time (ISO, UTC), the run and the row format version |

**Community rows** (Search communities, Community details)

| Field | Description |
|---|---|
| `description` | The community's description |
| `rules`, `ruleCount` | Its rules as one text (`1. Rule: explanation \| 2. …`) and how many there are |
| `topic` | X's topic for the community |
| `isNsfw` | X's sensitive-content flag |
| `createdAt` | When the community was created (ISO, UTC) |
| `bannerUrl` | Banner image |
| `detailsIncluded` | `true` when the row comes from a full details lookup (always in Details mode; in Search mode with **Include full community details**) |

**Member rows** (Members)

| Field | Description |
|---|---|
| `memberUserId`, `memberUsername`, `memberName`, `memberUrl` | The member |
| `memberIsVerified` | Verified badge |
| `memberAvatarUrl` | Profile picture |

**Post rows** (Posts)

| Field | Description |
|---|---|
| `postId`, `postUrl`, `postText`, `postedAt` | The post |
| `lang` | Language X detected |
| `likeCount`, `retweetCount`, `replyCount`, `quoteCount`, `viewCount` | Engagement at the time of the run |
| `hashtags`, `mediaUrls` | Hashtags in the post text, and image/video links |
| `authorUserId`, `authorUsername`, `authorName`, `authorIsVerified` | Who posted it |

The **Output** tab has three views: **Communities**, **Members** and **Posts**. They show the same dataset with different columns. Open the one that matches the mode you ran. The Console always opens on **Communities**, so for a Members or Posts run click its tab; otherwise the columns look empty.

#### Communities

![Communities view](https://raw.githubusercontent.com/coregentdevspace/x-community-scraper-assets/main/x-community-scraper-output-communities-table-view.png)

```json
{
    "recordType": "community",
    "mode": "search",
    "communityId": "1506797806761172993",
    "communityUrl": "https://x.com/i/communities/1506797806761172993",
    "name": "STREET PHOTOGRAPHY",
    "description": "\"The street has a spirit of its own. Surrender to it and realize that you are not apart from it, but a part of it. This is street photography.\" - @NYCPhotomaker",
    "rules": "1. STREET PHOTOGRAPHY ONLY | 2. BE RESPECTFUL | 3. NO SPAM: Spam this community and be removed. | 4. GIVE CREDIT: If it's not your photo, cite the artist, or us…",
    "ruleCount": 4,
    "memberCount": 14437,
    "topic": "Photography",
    "isNsfw": false,
    "createdAt": "2022-03-24T00:59:26.741Z",
    "bannerUrl": "https://pbs.twimg.com/media/FECQ154VEAAjQrR.jpg",
    "detailsIncluded": true,
    "sourceInput": "photography",
    "sourceProvider": "tikhub",
    "scrapedAt": "2026-11-20T23:30:51.253Z",
    "schemaVersion": "1.0"
}
```

#### Members

![Members view](https://raw.githubusercontent.com/coregentdevspace/x-community-scraper-assets/main/x-community-scraper-output-members-table-view.png)

```json
{
    "recordType": "member",
    "mode": "members",
    "communityId": "1506797806761172993",
    "communityUrl": "https://x.com/i/communities/1506797806761172993",
    "name": "STREET PHOTOGRAPHY",
    "memberCount": 14437,
    "memberUserId": "1103288522847518720",
    "memberUsername": "NYCPhotomaker",
    "memberName": "NYCPhotomaker 🍉",
    "memberUrl": "https://x.com/NYCPhotomaker",
    "memberIsVerified": true,
    "memberAvatarUrl": "https://pbs.twimg.com/profile_images/2059667137346617344/etjbPaqP_normal.jpg",
    "sourceInput": "1506797806761172993",
    "sourceProvider": "tikhub",
    "scrapedAt": "2026-11-21T01:42:15.505Z",
    "schemaVersion": "1.0"
}
```

#### Posts

![Posts view](https://raw.githubusercontent.com/coregentdevspace/x-community-scraper-assets/main/x-community-scraper-output-posts-table-view.png)

```json
{
    "recordType": "post",
    "mode": "posts",
    "communityId": "1506797806761172993",
    "communityUrl": "https://x.com/i/communities/1506797806761172993",
    "name": "STREET PHOTOGRAPHY",
    "memberCount": 14437,
    "postId": "2123795324397568443",
    "postUrl": "https://x.com/pure_street_/status/2123795324397568443",
    "postText": "NYC Streetphotography \n#streetphotography https://t.co/M27FBbRmza",
    "postedAt": "2026-11-20T15:07:18.000Z",
    "lang": "en",
    "likeCount": 13,
    "retweetCount": 0,
    "replyCount": 0,
    "quoteCount": 0,
    "viewCount": 120,
    "hashtags": "streetphotography",
    "mediaUrls": "https://pbs.twimg.com/media/HXk8lzjXEAAW56i.jpg",
    "authorUserId": "1859606953753968640",
    "authorUsername": "pure_street_",
    "authorName": "Oscar Goldman",
    "authorIsVerified": true,
    "sourceInput": "1506797806761172993",
    "sourceProvider": "tikhub",
    "scrapedAt": "2026-11-21T01:40:47.609Z",
    "schemaVersion": "1.0"
}
```

The samples leave out the fields a mode doesn't fill (they're `null` in the real rows) and `runId`. `hashtags` is `null` on posts without a hashtag, and `mediaUrls` on text-only posts.

A run summary is saved in the key-value store as `RUN_SUMMARY`: mode, inputs requested, processed, succeeded and failed, pages read, rows seen and saved, duplicates, skipped and filtered rows, details lookups, charged events by type, and, for each input, its status, rows saved, coverage (`complete`, `partial` or `unknown`) and why it stopped.

### Pricing

This Actor uses **pay-per-event** pricing. You pay one event per row saved, by mode:

- `community-result` per community saved by **Search communities**,
- `community-details` per community saved with full details: every row in **Community details** mode, and each saved search row when **Include full community details** is on (once per community),
- `member-result` per member saved,
- `post-result` per post saved.

Nothing else is charged:

- duplicate rows,
- rows dropped by your filters or skip list,
- inputs that fail, communities that don't exist or can't be read,
- the run summary, and runs that save nothing.

The prices are on the Actor's **Pricing** tab in the Apify Console, and they can differ by Apify plan. This README deliberately doesn't quote figures, so it never goes out of date. Set a **maximum cost per run** in the run options and the Actor stops saving before it would exceed it.

### Limits and good to know

- **Public data only.** Private communities, posts that need membership and anything that needs a login aren't available.
- **Members: about 20 per community, basic profile only.** X serves only the first page of a community's member list, and it can't be paged further. Each member comes with handle, name, picture and verified badge; for full profiles (bio, follower counts), run the handles through a profile scraper. Members runs report this as `partial` coverage in `RUN_SUMMARY` and in the status message. The Actor doesn't promise, and can't deliver, a full member export.
- **Search results** are what X's community search returns for the keyword; very broad terms return X's top matches, not every community.
- **One-word search terms work best.** X's community search handles multi-word terms poorly, so the Actor tries a term like `star wars` as `star-wars`, then `starwars`. If neither works, the term is reported as failed and nothing is charged for it. Prefer one distinctive word (`starwars`, `crypto`, `photography`).
- **Posts** go back as far as X serves the community timeline.
- **Counts change.** Member counts and engagement are a snapshot taken when the run happened.
- **Timeouts.** If a run gets close to its timeout, it stops by itself, keeps every row already saved and says so in the status message.

### FAQ

**Do I need an X account or API key?** No.

**How do I find a community's URL?** Run **Search communities** and copy `communityUrl`, or open the community on X: the address looks like `https://x.com/i/communities/1493290339532222469`.

**Why did I get only ~20 members?** That's all X shows for a community's member list; see Limits.

**Is scraping X legal?** This Actor collects publicly available data only. You're responsible for how you use it: follow X's terms, data-protection laws such as GDPR, and don't collect personal data without a lawful reason, use it for harassment or unsolicited mass contact. This is an independent tool, not affiliated with, sponsored or endorsed by X Corp.

**Can I get tweets by keyword or profile, or an account's followers?** Not in this Actor. Use our [X Tweet Scraper](https://apify.com/coregent/x-tweet-scraper) or [X Followers Scraper](https://apify.com/coregent/x-followers-scraper).

**Can I collect only new posts each day?** Yes: schedule a Posts run with **Posts since** `1 day` (or `2 days` for overlap), and put post IDs you already have in **Skip these**.

**Can I use it from code or an AI agent?** Yes. Call it through the Apify API, the Apify client libraries or the Apify MCP server, and read the dataset as JSON:

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('coregent/x-community-scraper').call({
    mode: 'search',
    searchTerms: ['AI'],
    maxItems: 10,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

### Feedback

Found a problem or need a field that's missing? Open an issue on the Actor's **Issues** tab and include the run link.

# Actor input Schema

## `mode` (type: `string`):

<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.

## `searchTerms` (type: `array`):

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>.

## `communityUrls` (type: `array`):

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.

## `maxItems` (type: `integer`):

Stops the whole run after this many saved rows, across all inputs.

## `maxItemsPerInput` (type: `integer`):

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.

## `minMemberCount` (type: `integer`):

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.

## `postsRanking` (type: `string`):

Posts mode: <b>Recency</b> (newest first) or <b>Relevance</b> (X's top posts).

## `since` (type: `string`):

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` (type: `boolean`):

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.

## `excludeIds` (type: `array`):

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.

## `maxUpstreamCalls` (type: `integer`):

Safety limit on requests to the data provider in one run. 0 = automatic (sized from your limits).

## `failOnPartial` (type: `boolean`):

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.

## `debug` (type: `boolean`):

Saves the first raw provider pages to the key-value store (DEBUG_RAW_PAGE_1…3) for troubleshooting.

## Actor input object example

```json
{
  "mode": "search",
  "searchTerms": [
    "AI"
  ],
  "maxItems": 10,
  "maxItemsPerInput": 1000,
  "minMemberCount": 0,
  "postsRanking": "Recency",
  "includeDetails": false,
  "excludeIds": [],
  "maxUpstreamCalls": 0,
  "failOnPartial": false,
  "debug": false
}
```

# Actor output Schema

## `communities` (type: `string`):

No description

## `members` (type: `string`):

No description

## `posts` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "search",
    "searchTerms": [
        "AI"
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("coregent/x-community-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "search",
    "searchTerms": ["AI"],
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("coregent/x-community-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "search",
  "searchTerms": [
    "AI"
  ],
  "maxItems": 10
}' |
apify call coregent/x-community-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,coregent/x-community-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/bYY89qEp1cWJPzC6o/builds/MLmFAKXiVETlq4oJK/openapi.json
