# Twitter/X Community Scraper: Search, Members, Tweets & More! (`scrape.badger/twitter-community-scraper`) Actor

This Twitter (X) scraping actor is designed to extract communities information: tweets, members, moderators, search for different communities, get communities tweets.

- **URL**: https://apify.com/scrape.badger/twitter-community-scraper.md
- **Developed by:** [ScrapeBadger](https://apify.com/scrape.badger) (community)
- **Categories:** Social media, Developer tools, Other
- **Features:** Limited permissions
- **Stats:** 59 total users, 11 monthly users, 100.0% runs succeeded, 4 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.16 / 1,000 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

[![Scrapebadger Twitter Scraper](https://raw.githubusercontent.com/ScrapeBadger/twitter-scraper/refs/heads/main/scrapebadger.png)](https://scrapebadger.com)

ScrapeBadger provides powerful data extraction capabilities to scrape Twitter/X Communities, offering an incredibly affordable solution for comprehensive community data collection. Extract community details, members, moderators, tweets, and search for communities by keyword. All this starts at just **$0.20 per 1,000 results.**

Twitter Communities are groups where users with shared interests connect and discuss specific topics. With ScrapeBadger's Communities Scraper, you can analyze these communities for market research, competitor analysis, influencer identification, and audience segmentation.

### What can X Community Scraper do?

- **Effortless Operation:** Designed for **ease of use**, ScrapeBadger requires you to **select a Mode and provide its corresponding identifier** (e.g., Community ID for "Get Community Detail", search query for "Search Communities").
- **Comprehensive Community Data:**
  - **Get Community Detail** - Fetch metadata including name, description, member count, rules, and admin info.
  - **Get Community Members** - Extract all members of a community with their profiles.
  - **Get Community Moderators** - Identify moderators and admins of a community.
  - **Get Community Tweets** - Retrieve tweets posted within a community (Top, Latest, or Media).
- **Powerful Search:**
  - **Search Communities** - Find communities by keyword to discover relevant groups.
  - **Search Community Tweets** - Search for specific content within a community.
- **Flexible and Structured Output:** Data is delivered in Apify's standard Dataset, ready for export in CSV, JSON, etc.
- **Enterprise-Grade Reliability:** Built on the robust Apify platform for consistent results.
- **Cost-Effective Solution:** Just **$0.20 per 1,000 results**.

### Why scrape X (Twitter) Communities?

- **Market Research:** Discover communities discussing your products, services, or industry.
- **Competitor Analysis:** Monitor competitor communities and their engagement.
- **Community Management:** Analyze successful communities to inform your own strategy.
- **Influencer Identification:** Find key members and moderators in relevant communities.
- **Content Strategy:** Understand what topics and content resonate within communities.
- **Academic Research:** Study online community dynamics and behaviors.

### How to scrape X Communities

| Mode | Description | Key Input Parameter | JSON Parameter | Optional |
|:-----|:------------|:--------------------|:---------------|:---------|
| Get Community Detail | Get metadata for a specific community | **Community ID** | `community_id` | - |
| Get Community Members | Extract all members of a community | **Community ID** | `community_id` | `max_results` |
| Get Community Moderators | Get moderators/admins of a community | **Community ID** | `community_id` | `max_results` |
| Get Community Tweets | Get tweets posted in a community | **Community ID** | `community_id` | `tweet_type`, `max_results` |
| Search Communities | Find communities by keyword | **Search Query** | `query` | `max_results` |
| Search Community Tweets | Search tweets within a community | **Community ID**, **Query** | `community_id`, `query` | `max_results` |

### Request and response examples

#### 1. Get Community Detail

**Request:**

```json
{
  "mode": "Get Community Detail",
  "community_id": "1494465737469038594"
}
```

**Response:**

```json
{
  "id": "1494465737469038594",
  "name": "Crypto Community",
  "description": "A community for crypto enthusiasts...",
  "member_count": 15000,
  "created_at": "2022-02-17T18:00:00+00:00",
  "is_nsfw": false,
  "join_policy": "Open",
  "admin_username": "community_admin",
  "rules": [
    {"name": "Be respectful", "description": "..."}
  ]
}
```

#### 2. Get Community Members

**Request:**

```json
{
  "mode": "Get Community Members",
  "community_id": "1494465737469038594",
  "max_results": 500
}
```

**Response (array of community members):**

```json
{
  "user": {
    "id": "12345678",
    "username": "member_user",
    "name": "Member Name",
    "followers_count": 500
  },
  "role": "Member",
  "joined_at": "2023-05-15T10:00:00+00:00"
}
```

#### 3. Get Community Moderators

**Request:**

```json
{
  "mode": "Get Community Moderators",
  "community_id": "1494465737469038594",
  "max_results": 50
}
```

#### 4. Get Community Tweets

**Request:**

```json
{
  "mode": "Get Community Tweets",
  "community_id": "1494465737469038594",
  "tweet_type": "Latest",
  "max_results": 1000
}
```

**Tweet Type Options:**

- `Top` - Most popular/engaging tweets (default)
- `Latest` - Most recent tweets
- `Media` - Tweets containing images/videos

#### 5. Search Communities

**Request:**

```json
{
  "mode": "Search Communities",
  "query": "cryptocurrency",
  "max_results": 100
}
```

**Response (array of communities):**

```json
{
  "id": "1494465737469038594",
  "name": "Crypto Traders",
  "description": "Community for crypto trading...",
  "member_count": 8500,
  "is_nsfw": false
}
```

#### 6. Search Community Tweets

**Request:**

```json
{
  "mode": "Search Community Tweets",
  "community_id": "1494465737469038594",
  "query": "bitcoin price",
  "max_results": 200
}
```

### What data can X Community Scraper extract?

**Community objects include:**

- **Core:** id, name, description
- **Membership:** member_count, is_member, role
- **Settings:** is_nsfw, join_policy, invites_policy
- **Metadata:** created_at
- **Administration:** creator_id, creator_username, admin_id, admin_username
- **Rules:** rules (list of community rules)

**Community Member objects include:**

- **User:** Full user profile data
- **Role:** Member, Moderator, or Admin
- **Joined:** Date joined the community

**Tweet objects include:**

- **Core:** id, text, created_at, lang
- **Engagement:** favorite_count, retweet_count, reply_count, view_count
- **Author:** user_id, username

**Important Note:** To prevent API abuse and ensure fair resource allocation, you will be charged for requests that return an empty results set.

### How much does it cost to scrape X Communities?

- **Highly Targeted Data:** Get precisely the Twitter/X community data you need.
- **Efficient and Reliable:** Built for speed and stability on the Apify platform.
- **Unbeatable Value:** Just $0.20 per 1,000 results.
- **User-Friendly:** Easy to configure regardless of technical expertise.
- **Seamless Integration:** Output data readily available for analysis.

### About ScrapeBadger

This actor is powered by [ScrapeBadger](https://scrapebadger.com) - a reliable Twitter/X data extraction service.

- **Official Website:** [scrapebadger.com](https://scrapebadger.com)
- **Faster Support:** Get priority support directly through the ScrapeBadger website
- **SDK & API Access:** Want to use ScrapeBadger outside of Apify? The Python SDK and REST API are available for direct integration into your own applications

### Ready-to-run examples

Each of these is a live, pre-configured task — open one and press **Start**, no setup:

- [Find X Communities in your niche](https://apify.com/scrape.badger/twitter-community-scraper/examples/find-x-communities-in-your-niche)
- [Export community members](https://apify.com/scrape.badger/twitter-community-scraper/examples/export-community-members-for-outreach)
- [Monitor community conversations](https://apify.com/scrape.badger/twitter-community-scraper/examples/monitor-community-conversations)
- [Identify community moderators](https://apify.com/scrape.badger/twitter-community-scraper/examples/identify-community-moderators)
- [Search inside a community](https://apify.com/scrape.badger/twitter-community-scraper/examples/search-inside-a-community)
- [Profile a community before joining](https://apify.com/scrape.badger/twitter-community-scraper/examples/profile-a-community-before-joining)

### What can you do with X (Twitter) Communities data?

#### Niche audience discovery

Communities are where topic-specific conversation moved after the algorithm took over the main feed. Searching them by keyword finds the rooms your buyers are actually in.

#### Pre-qualified outreach lists

Everyone in a community opted into its topic. That makes a member export one of the cleanest prospect lists available on any social platform.

#### Product feedback and support signals

Communities discuss tools candidly, in a semi-private setting. Monitoring the ones around your category surfaces complaints long before they reach your support queue.

#### Competitive intelligence

Watching a competitor's community shows you what their users struggle with, in their users' own words.

#### Finding the real authorities

Moderators decide what gets seen. Identifying them tells you who to approach before pitching anything into a community.

### Is scraping X legal?

This Actor requests only public X fields — the same content any logged-out visitor can see. It does not access private accounts, direct messages or anything behind a login.

Results can still contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.

### Frequently asked questions

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

It is the number in the community URL: `x.com/i/communities/1471580197908586507`. Or use *Search Communities* to find it by keyword.

#### Do I need to be a member to scrape a community?

No. Only publicly visible community data is returned, and no X credentials are supplied to the Actor.

#### Can I search inside one specific community?

Yes — *Search Community Tweets* scopes a keyword search to a single community, which is far more precise than a global search.

### Your feedback and support

Found a bug, missing a field, or need a mode that is not here? Open a ticket on the **Issues** tab, or email <support@scrapebadger.com>.

# Changelog

This Actor's version history is a separate document: https://apify.com/scrape.badger/twitter-community-scraper/changelog.md

# Actor input Schema

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

Select the type of community data to scrape. Each mode requires different input parameters.

## `community_id` (type: `string`):

The numeric Community ID from the URL. From https://x.com/i/communities/<b>1494465737469038594</b>, enter <b>1494465737469038594</b>. Required for community-specific modes.

## `query` (type: `string`):

Keywords to search for communities or tweets within a community. Example: <b>crypto</b> or <b>AI developers</b>. Required for search modes.

## `tweet_type` (type: `string`):

Type of tweets to retrieve. <b>Top</b> shows popular tweets, <b>Latest</b> shows recent tweets, <b>Media</b> shows tweets with images/videos. Used for 'Get Community Tweets' mode.

## `max_results` (type: `integer`):

Maximum number of items to return. Higher values increase run time and cost. Default: 1000.

## Actor input object example

```json
{
  "mode": "Get Community Detail",
  "community_id": "1494465737469038594",
  "query": "crypto",
  "tweet_type": "Top",
  "max_results": 1000
}
```

# Actor output Schema

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

All scraped data including user profiles, tweets, and status indicators stored in the default dataset

# 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 = {
    "community_id": "1494465737469038594",
    "query": "crypto"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrape.badger/twitter-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 = {
    "community_id": "1494465737469038594",
    "query": "crypto",
}

# Run the Actor and wait for it to finish
run = client.actor("scrape.badger/twitter-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 '{
  "community_id": "1494465737469038594",
  "query": "crypto"
}' |
apify call scrape.badger/twitter-community-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrape.badger/twitter-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/YMpSdKKlSZ0JlnS0M/builds/SEwIIkbYmedQabHgx/openapi.json
