# Twitter (X) Community Search, Members & Tweets Scraper (`maximedupre/x-communities`) Actor

Search X (Twitter) communities by keyword or get them by link or ID. Get community details and rules, feed posts with engagement counts, or member lists with roles. No X login needed.

- **URL**: https://apify.com/maximedupre/x-communities.md
- **Developed by:** [Maxime Dupré](https://apify.com/maximedupre) (community)
- **Categories:** Social media, Lead generation, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / 1,000 communities

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

### 🏘️ Get X communities, posts, and members in one place

X Communities helps marketers, researchers, founders, and community managers study Twitter communities on [X](https://x.com). Search communities by keyword, or paste community links or IDs. You get community details and rules, feed posts with engagement counts, or full member lists with roles. You do not need an X account, cookies, or an API key.

- Find **[Twitter communities](https://apify.com/maximedupre/x-communities/examples/twitter-communities)** about any topic by searching with your own keywords.
- Export **[Twitter community members](https://apify.com/maximedupre/x-communities/examples/twitter-community-members)** with roles, bios, and follower counts for audience research.
- See who runs a group with an **[X community moderators](https://apify.com/maximedupre/x-communities/examples/x-community-moderators)** list of admins and moderators.
- **[Search X community posts](https://apify.com/maximedupre/x-communities/examples/search-x-community-posts)** for a word or phrase to follow one topic inside a group.
- Check for **[X communities still active](https://apify.com/maximedupre/x-communities/examples/x-communities-still-active)** by reading the newest posts in each feed.
- Collect photos and videos from a group's Media feed with **[X community media](https://apify.com/maximedupre/x-communities/examples/x-community-media)**.

#### 📊 What data you get from X communities

Each run returns one kind of result. You pick it with **Result type**.

- **Communities**: name, description, member count, topic, banner image, member preview images, adult content flag, rules, join and invite policy, creation date, and the creator and admin profiles. Keyword search results include the fields X shows in search, plus the keyword that found them.
- **Community posts**: full text, date, language, likes, reposts, replies, quotes, views, bookmarks, images and videos, links, hashtags, mentions, reply and quote IDs, and the author profile.
- **Community members**: profile ID, username, display name, bio, location, website, follower and following counts, post count, verification, and the member's role in the community.

#### 🚀 How to scrape X communities

1. Choose a **Result type**: Communities, Community posts, or Community members.
2. For communities, search by **Keywords**, or switch **Find communities by** to Community links or IDs.
3. For posts or members, add one or more **Community links or IDs**, such as `https://x.com/i/communities/1471580197908586507`.
4. Set **Maximum results**, or leave it empty to get everything available.
5. Click **Start**, then download your data as JSON, CSV, Excel, or another format.

#### ⚙️ Input

**Input fields**

| Field | Type | What it does |
| --- | --- | --- |
| `resultType` | string | Required. `communities`, `posts`, or `members`. The form starts with `communities`. |
| `maxItems` | integer | Stops after this many results in total, for all communities. Empty or `0` means get all available results. The form starts with `1`. |
| `findCommunitiesBy` | string | For Communities only. `keywords` searches X communities. `links` gets the communities in `communityList`. Default: `keywords`. |
| `keywords` | array of strings | Search words or phrases for community search. Each entry is a separate search. The form starts with `technology`. |
| `postFeed` | string | For Community posts. `top`, `latest`, or `media` feed. Default: `latest`. |
| `postKeywords` | array of strings | For Community posts. Only get posts that match these words or phrases. Each entry is a separate search in each community. Works with `top` and `latest` only. Using it with `media` stops the run with a message and no results. |
| `memberRole` | string | For Community members. `all` gets all members. `moderators` gets only admins and moderators. Default: `all`. |
| `communityList` | array of strings | X community links or IDs (the digits after `/i/communities/`). Used by Community posts, Community members, and Communities found by links. Entries that are not a community link or ID are skipped with a warning. Repeated communities are read once. |

If a needed list is empty, the run ends with a clear message and no results. The same post or community is saved only once per run. A member is saved once per community.

**Example input**

```json
{
  "maxItems": 1,
  "resultType": "communities",
  "findCommunitiesBy": "keywords",
  "keywords": [
    "technology"
  ],
  "postFeed": "latest",
  "memberRole": "all"
}
```

#### 🧾 Output

**Output fields**

Every row has a `type` field: `community`, `post`, or `member`. Fields are left out when X does not show a value.

**Community row**

| Field | Type | What it does |
| --- | --- | --- |
| `type` | string | Always `community`. |
| `id` | string | X community ID. |
| `name` | string | Community name shown on X. |
| `description` | string | Community description. |
| `memberCount` | integer | Total member count reported by X. |
| `topic` | string | Community topic. |
| `bannerImageUrl` | string | Banner image URL. |
| `memberPreviewImageUrls` | array of strings | Profile images in the member preview. |
| `isAdultContent` | boolean | Whether X marks the community as adult content. |
| `rules` | array of objects | Community rules. |
| `rules.name` | string | Rule name. |
| `rules.description` | string | Rule text. |
| `joinPolicy` | string | How people join, such as `Open`. |
| `invitationPolicy` | string | Who may invite people, when public. |
| `createdAt` | string | Date and time the community was created. |
| `creator` | object | Profile that created the community. |
| `creator.id` | string | X account ID. |
| `creator.username` | string | Username without the @ sign. |
| `creator.name` | string | Display name. |
| `creator.avatarUrl` | string | Profile image URL. |
| `creator.description` | string | Profile bio. |
| `creator.location` | string | Location on the profile. |
| `creator.website` | string | Website on the profile. |
| `creator.followersCount` | integer | Follower count. |
| `creator.followingCount` | integer | Number of accounts followed. |
| `creator.postCount` | integer | Post count. |
| `creator.isVerified` | boolean | Whether X marks the profile as verified. |
| `creator.verificationType` | string | Verification type. |
| `creator.isProtected` | boolean | Whether posts are limited to approved followers. |
| `creator.createdAt` | string | Date and time the account was created. |
| `administrator` | object | Admin profile, with the same fields as `creator`. |
| `keyword` | string | Search keyword that found the community. Only in keyword search results. |

**Example community row**

```json
{
  "type": "community",
  "id": "1471580197908586507",
  "name": "Startup Community",
  "description": "The #1 online community for helping startups succeed. Click for more —> www.startupasap.com",
  "memberCount": 193685,
  "topic": "Entrepreneurship",
  "bannerImageUrl": "https://pbs.twimg.com/community_banner_img/2049541347078516736/EHSmwzod?format=jpg&name=orig",
  "memberPreviewImageUrls": [
    "https://pbs.twimg.com/profile_images/2054255394076160001/tURgPuGZ_normal.png",
    "https://pbs.twimg.com/profile_images/2090797293452623872/2a75axtW_normal.jpg",
    "https://pbs.twimg.com/profile_images/1839840550498816000/qWnCj2Ul_normal.jpg",
    "https://pbs.twimg.com/profile_images/2038815619215462400/gyH0mrRY_normal.jpg",
    "https://pbs.twimg.com/profile_images/2001663013061804032/_bHgbKMj_normal.jpg"
  ],
  "isAdultContent": false,
  "rules": [
    {
      "name": "Focus on startup businesses.",
      "description": "No off-topic posts or content."
    },
    {
      "name": "Post useful startup information.",
      "description": "No low quality, basic questions, inspiration."
    },
    {
      "name": "Share your story - build in public.",
      "description": "Wins, fails, strategies, data, etc."
    },
    {
      "name": "No promotion (self, sales, services)",
      "description": "DM Adam for sponsor/pinned posts."
    },
    {
      "name": "No driving traffic to your links/posts.",
      "description": "Sources or Product Hunt links are ok."
    },
    {
      "name": "No asks (join, follow, reply, DM, etc)",
      "description": "(job, fund, waitlist, signup, connect)"
    },
    {
      "name": "No spam (junk, copies, bots, AI slop)",
      "description": "English only. Limit 5 posts/day."
    },
    {
      "name": "No engagement farming, social metrics.",
      "description": "These are not for startups."
    },
    {
      "name": "CTA: Add spotlight to profile.",
      "description": "Be proud. Click ✨ on homepage."
    },
    {
      "name": "CTA: Turn on notifications.",
      "description": "Don’t miss out. Click 🔔 on homepage."
    }
  ],
  "joinPolicy": "Open",
  "invitationPolicy": "MemberInvitesAllowed",
  "createdAt": "2021-12-16T20:37:14.477Z",
  "creator": {
    "id": "1274090521321930758",
    "username": "StartupASAP",
    "name": "Startup Community",
    "avatarUrl": "https://pbs.twimg.com/profile_images/2054255394076160001/tURgPuGZ_normal.png",
    "description": "Follow what the best startups are doing now.",
    "location": "👉",
    "website": "https://t.co/5Nc4bA96ZZ",
    "followersCount": 44864,
    "followingCount": 2158,
    "postCount": 15909,
    "isVerified": true,
    "isProtected": false,
    "createdAt": "2020-06-19T21:24:17.000Z"
  },
  "administrator": {
    "id": "1274090521321930758",
    "username": "StartupASAP",
    "name": "Startup Community",
    "avatarUrl": "https://pbs.twimg.com/profile_images/2054255394076160001/tURgPuGZ_normal.png",
    "description": "Follow what the best startups are doing now.",
    "location": "👉",
    "website": "https://t.co/5Nc4bA96ZZ",
    "followersCount": 44864,
    "followingCount": 2158,
    "postCount": 15909,
    "isVerified": true,
    "isProtected": false,
    "createdAt": "2020-06-19T21:24:17.000Z"
  }
}
```

**Post row**

| Field | Type | What it does |
| --- | --- | --- |
| `type` | string | Always `post`. |
| `communityId` | string | ID of the community the post comes from. |
| `id` | string | X post ID. |
| `text` | string | Full post text. |
| `createdAt` | string | Date and time the post was published. |
| `language` | string | Language code reported by X. |
| `author` | object | Profile that wrote the post. |
| `author.id` | string | X account ID. |
| `author.username` | string | Username without the @ sign. |
| `author.name` | string | Display name. |
| `author.avatarUrl` | string | Profile image URL. |
| `author.description` | string | Profile bio. |
| `author.location` | string | Location on the profile. |
| `author.website` | string | Website on the profile. |
| `author.followersCount` | integer | Follower count. |
| `author.followingCount` | integer | Number of accounts followed. |
| `author.postCount` | integer | Post count. |
| `author.isVerified` | boolean | Whether X marks the profile as verified. |
| `author.verificationType` | string | Verification type. |
| `author.isProtected` | boolean | Whether posts are limited to approved followers. |
| `author.createdAt` | string | Date and time the account was created. |
| `likeCount` | integer | Likes. |
| `repostCount` | integer | Reposts. |
| `replyCount` | integer | Replies. |
| `quoteCount` | integer | Quotes. |
| `viewCount` | integer | Views. |
| `bookmarkCount` | integer | Bookmarks. |
| `media` | array of objects | Images and videos in the post. |
| `media.type` | string | Media type, such as `photo`, `video`, or animated GIF. |
| `media.url` | string | Link to open or download the file. |
| `media.previewImageUrl` | string | Preview image. |
| `media.altText` | string | Text that describes the media. |
| `media.width` | integer | Width in pixels. |
| `media.height` | integer | Height in pixels. |
| `media.durationMillis` | integer | Video length in milliseconds. |
| `conversationId` | string | ID of the conversation the post belongs to. |
| `inReplyToPostId` | string | ID of the post this one replies to. |
| `quotedPostId` | string | ID of the quoted post. |
| `links` | array of strings | Full web links in the post. |
| `hashtags` | array of strings | Hashtags without the # sign. |
| `mentions` | array of objects | Accounts mentioned in the post. |
| `mentions.id` | string | X account ID. |
| `mentions.username` | string | Username without the @ sign. |
| `keyword` | string | Post keyword that found the post. Only when you use Post keywords. |

**Example post row**

```json
{
  "type": "post",
  "communityId": "1471580197908586507",
  "id": "2115157712992612762",
  "text": "Big news for freelancers, web designers, and agencies. All our premium templates are now FREE to use for both personal projects and client work.\n\nLink: https://t.co/Y2wM4poggQ\n\nWhat You Get -\n* Create professional websites faster.\n* Deliver beautiful designs to your clients.\n* Save money without compromising quality.\n* Take on more projects with confidence.",
  "createdAt": "2026-10-27T19:04:31.000Z",
  "language": "en",
  "author": {
    "id": "1931769728353357824",
    "username": "TemplaMunk",
    "name": "Template Munk",
    "avatarUrl": "https://pbs.twimg.com/profile_images/2019802524237303808/9ycLh6RK_normal.jpg",
    "description": "Building a brand, product, or digital presence, this is design engineered to feel as good as it looks.",
    "location": "Chittagong, Bangladesh",
    "website": "https://t.co/Thpm0JNjic",
    "followersCount": 273,
    "followingCount": 527,
    "postCount": 1669,
    "isVerified": true,
    "isProtected": false,
    "createdAt": "2025-06-08T17:46:21.000Z"
  },
  "likeCount": 0,
  "repostCount": 0,
  "replyCount": 0,
  "quoteCount": 0,
  "bookmarkCount": 0,
  "media": [
    {
      "type": "photo",
      "url": "https://pbs.twimg.com/media/HVqLSlAb0AAzkoX.jpg",
      "previewImageUrl": "https://pbs.twimg.com/media/HVqLSlAb0AAzkoX.jpg",
      "width": 1200,
      "height": 630
    }
  ],
  "conversationId": "2115157712992612762",
  "links": [
    "https://www.framer.com/@template-munk/"
  ],
  "hashtags": [],
  "mentions": []
}
```

**Member row**

| Field | Type | What it does |
| --- | --- | --- |
| `type` | string | Always `member`. |
| `communityId` | string | ID of the community the member belongs to. |
| `id` | string | X account ID. |
| `username` | string | Username without the @ sign. |
| `name` | string | Display name. |
| `avatarUrl` | string | Profile image URL. |
| `description` | string | Profile bio. |
| `location` | string | Location on the profile. |
| `website` | string | Website on the profile. |
| `followersCount` | integer | Follower count. |
| `followingCount` | integer | Number of accounts followed. |
| `postCount` | integer | Post count. |
| `isVerified` | boolean | Whether X marks the profile as verified. |
| `verificationType` | string | Verification type. |
| `isProtected` | boolean | Whether posts are limited to approved followers. |
| `createdAt` | string | Date and time the account was created. |
| `role` | string | Role in this community, such as `Admin`. |

**Example member row**

```json
{
  "type": "member",
  "communityId": "1471580197908586507",
  "id": "1274090521321930758",
  "username": "StartupASAP",
  "name": "Startup Community",
  "avatarUrl": "https://pbs.twimg.com/profile_images/2054255394076160001/tURgPuGZ_normal.png",
  "description": "Follow what the best startups are doing now.",
  "location": "👉",
  "website": "https://t.co/5Nc4bA96ZZ",
  "followersCount": 44864,
  "followingCount": 2158,
  "postCount": 15909,
  "isVerified": true,
  "isProtected": false,
  "createdAt": "2020-06-19T21:24:17.000Z",
  "role": "Admin"
}
```

#### 💳 Pricing

You pay per saved result. There is no charge to start a run.

| Result | Free, Bronze, Silver plans | Gold, Platinum, Diamond plans |
| --- | --- | --- |
| Community | $0.15 per 1,000 | $0.10 per 1,000 |
| Community post | $0.15 per 1,000 | $0.10 per 1,000 |
| Community member | $0.15 per 1,000 | $0.10 per 1,000 |

Only rows saved to your dataset are charged. A run that finds nothing, or stops because the input needs a change, saves no rows and has no result charges. Use **Maximum results** to cap your cost.

#### 🔌 Integrations

Connect X Communities to other apps with [Apify integrations](https://apify.com/integrations). You can send results to Make, Zapier, Google Sheets, Slack, webhooks, and more. You can also start runs and read results with the Apify API.

https://www.youtube.com/watch?v=bNACk1_S_6w\&list=PLObrtcm1Kw6MUrlLNDbK9QRg8VDJg0gOW\&index=4

#### ❓ FAQ

##### Can I use Post keywords with the Media feed?

No. Post keywords work only with the Top or Latest feed. If you choose Media and add Post keywords, the run stops with a message and saves nothing.

##### How do I get only the admins and moderators?

Choose Community members as the result type, then set **Members to get** to Admins and moderators only.

##### Where do I find a community ID?

Open the community on X. The ID is the long number after `/i/communities/` in the link. You can also paste the full link.

##### How do I search for communities on X?

Choose Communities, keep **Find communities by** on Keywords, and add one or more search words. Each keyword is a separate search, and each row shows the keyword that found it.

##### How can I tell if an X community is still active?

Get the community's posts from the Latest feed. The `createdAt` date on each post shows when people last posted.

##### Do I need an X account or cookies?

No. You do not need an X account, login cookies, or an API key. The Actor gets public community data only.

##### Can I get private communities?

No. The Actor gets public community data only. It cannot read data that needs your own X login.

##### What does Maximum results set to 0 mean?

Empty or `0` means no limit. The run gets all available results for all your communities and keywords.

##### What happens if one community fails?

The run shows a warning and moves on to the next community. If no community can be read at all, the run fails and asks you to try again later.

### 📝 Changelog

**v0.0** (27-10-2026)

- Initial release.

### 🆘 Support

For issues, questions, or feature requests, [file a ticket](https://console.apify.com/actors/maximedupre~x-communities/issues) and I'll fix or implement it in less than 24h 🫡

### 🔗 Related Actors

- [X (Twitter) Community Top Posts Scraper](https://apify.com/maximedupre/twitter-communities-top-posts-scraper): get the top posts from X communities by keyword or community link.
- [X Communities Latest Posts Scraper](https://apify.com/maximedupre/twitter-communities-latest-posts-scraper): follow the newest posts across X communities.
- [Twitter (X) Scraper](https://apify.com/maximedupre/twitter-scraper): collect public X posts and profiles beyond communities.
- [Twitter List Followers Scraper](https://apify.com/maximedupre/twitter-list-followers-scraper): get follower and subscriber profiles from public X lists.
- [Twitter Lead Scraper](https://apify.com/maximedupre/twitter-lead-scraper): turn X handles or a niche keyword into structured profile leads.

**Made with ❤️ by Maxime Dupré**

# Actor input Schema

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

Stop after this many results in total, for all communities. Leave empty or set 0 to get all available results.

## `resultType` (type: `string`):

Choose what each result is: one community, one post from a community feed, or one community member.

## `findCommunitiesBy` (type: `string`):

Search X communities by keyword, or get the communities you list in Community links or IDs. If omitted, keyword search is used.

## `keywords` (type: `array`):

Enter one or more words or phrases. Each entry is a separate search.

## `postFeed` (type: `string`):

Get posts from the community's Top, Latest, or Media feed. If omitted, the Latest feed is used. Post keywords work only with Top or Latest. Media with Post keywords is an invalid choice. It is not replaced by another feed.

## `postKeywords` (type: `array`):

Only get posts that match these words or phrases. Each entry is a separate search in each community. Keyword search uses the Top or Latest order from Feed. It does not work with the Media feed. Leave empty to get all posts in the feed.

## `memberRole` (type: `string`):

Get all members, or only the admins and moderators. If omitted, all members are returned.

## `communityList` (type: `array`):

Enter X community links, such as https://x.com/i/communities/1234567890, or community IDs (the digits after /i/communities/). Used by Community posts, Community members, and Communities when you find communities by links or IDs.

## Actor input object example

```json
{
  "maxItems": 1,
  "resultType": "communities",
  "findCommunitiesBy": "keywords",
  "keywords": [
    "technology"
  ],
  "postFeed": "latest",
  "memberRole": "all"
}
```

# Actor output Schema

## `results` (type: `string`):

View the communities, posts, or members you asked for.

# 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 = {
    "maxItems": 1,
    "resultType": "communities",
    "findCommunitiesBy": "keywords",
    "keywords": [
        "technology"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("maximedupre/x-communities").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 = {
    "maxItems": 1,
    "resultType": "communities",
    "findCommunitiesBy": "keywords",
    "keywords": ["technology"],
}

# Run the Actor and wait for it to finish
run = client.actor("maximedupre/x-communities").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 '{
  "maxItems": 1,
  "resultType": "communities",
  "findCommunitiesBy": "keywords",
  "keywords": [
    "technology"
  ]
}' |
apify call maximedupre/x-communities --silent --output-dataset

```

## MCP server setup

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

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/Cbk3nqYKFhjF7pimY/builds/oCCLYdfd8W5oiDE4X/openapi.json
