# X Communities Latest Posts Scraper (`maximedupre/twitter-communities-latest-posts-scraper`) Actor

Search public X Communities by keyword, Community ID, or URL. Choose newest-first or the source's top-ranked order, then save post text, Community details, author data, timestamps, engagement, media, and post links when available.

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

## Pricing

from $0.15 / 1,000 community posts

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### 🧭 Find the latest posts in X Communities

Researchers, community managers, and data teams can search public X Communities by one keyword or by one or more Community IDs or URLs. The Actor saves each post as a structured dataset row with its text, source Community, author details, time, engagement counts, media references, and public links when available. The source Community stays with each row, so you can see where a post came from.

**Use cases**

- Find latest public Community posts with **[Twitter Communities Latest Posts Scraper](https://apify.com/maximedupre/twitter-communities-latest-posts-scraper/examples/twitter-communities-latest-posts-scraper)**.
- Collect public Community posts with **[Twitter Community Posts](https://apify.com/maximedupre/twitter-communities-latest-posts-scraper/examples/twitter-community-posts)**.
- Save public Community posts with **[Scrape Twitter Community Posts](https://apify.com/maximedupre/twitter-communities-latest-posts-scraper/examples/scrape-twitter-community-posts)**.
- Find keyword matches in public Communities with **[Search Twitter Communities](https://apify.com/maximedupre/twitter-communities-latest-posts-scraper/examples/search-twitter-communities)**.
- Collect posts from public X Communities with **[X Communities Scraper](https://apify.com/maximedupre/twitter-communities-latest-posts-scraper/examples/x-communities-scraper)**.

#### 🗂️ Public X Community post rows

Each saved row represents one public post. A row can include the post text, source Community, author data, engagement counts, media references, language, and conversation context when the source exposes them. Optional fields may be absent.

The first eligible match is saved right away. If another submitted Community, URL, or keyword finds the same post later, that later match is ignored. The saved row keeps the source context from the first match.

#### ▶️ Search or collect Community posts

**Run steps**

1. Set **Find posts by** to **Community** or **Keyword**.
2. Enter one or more public Community IDs or URLs, or enter one keyword or phrase.
3. Choose **Newest first** or **Top ranked**.
4. Set **Maximum posts** when you want a smaller run. Leave it empty to return all available results until the source is exhausted.
5. Run the Actor and open the dataset.

**Post order**

Newest first uses publication time. Top ranked uses the source's top or high-engagement order when available.

#### ⚙️ Input

Choose one way to find posts. Use **Community** for one or more public X Community IDs or URLs. Use **Keyword** for one keyword or phrase. The post order and optional maximum apply to either choice.

**Input fields**

| Field | Type | What it does |
|---|---|---|
| `findBy` | string | Chooses Community or Keyword search. |
| `communities` | string\[] | Lists one or more public X Community IDs or URLs. Each saved row keeps its source Community. |
| `keyword` | string | Sets one keyword or phrase for matching posts. Run a separate search for each keyword. |
| `sortBy` | string | Sets Newest first or Top ranked. Top ranked uses the source's top or high-engagement order when available. |
| `maxItems` | integer | Stops after this many eligible posts. Leave it empty to return all available results until the source is exhausted. |

**Example input**

This is the public input from a successful current-beta run that uses the prefilled keyword:

```json
{
  "findBy": "Keyword",
  "keyword": "open source",
  "sortBy": "latest",
  "maxItems": 10
}
```

#### 🧾 Output

Every run uses the same `Community post` row shape. A field may be absent when X does not expose it. The output link opens the run dataset.

**Run output**

| Field | Type | What it does |
|---|---|---|
| `dataset` | string | Opens the run's default dataset, where the Community post rows are saved. |

**Community post**

| Field | Type | What it does |
|---|---|---|
| `postId` | string | Gives the stable public ID of the post. |
| `text` | string | Gives the public post text when available. |
| `postedAt` | string | Gives the public publication time when available. |
| `postUrl` | string | Gives the direct public post URL when available. |
| `community` | object | Holds the public source Community. |
| `community.id` | string | Gives the stable public ID of the source Community. |
| `community.name` | string | Gives the public Community name when available. |
| `community.url` | string | Gives the canonical public Community URL when available. |
| `author` | object | Holds public identity and profile details for the author. |
| `author.id` | string | Gives the stable public author ID when available. |
| `author.username` | string | Gives the author's public username when available. |
| `author.displayName` | string | Gives the author's public display name when available. |
| `author.verified` | boolean | Says whether the source marks the author as verified when available. |
| `author.avatarUrl` | string | Gives the author's public avatar URL when available. |
| `author.bio` | string | Gives the author's public biography when available. |
| `author.location` | string | Gives the author's public location when available. |
| `author.followersCount` | integer | Gives the author's public follower count when available. |
| `author.createdAt` | string | Gives the public account creation time when available. |
| `engagement` | object | Holds public engagement counts for the post. |
| `engagement.likeCount` | integer | Gives the public number of likes when available. |
| `engagement.repostCount` | integer | Gives the public number of reposts when available. |
| `engagement.replyCount` | integer | Gives the public number of replies when available. |
| `engagement.quoteCount` | integer | Gives the public number of quote posts when available. |
| `engagement.viewCount` | integer | Gives the public number of views when available. |
| `engagement.bookmarkCount` | integer | Gives the public number of bookmarks when available. |
| `media` | object\[] | Lists public references and available details for attached images or videos. |
| `media[].type` | string | Gives the attached media type. |
| `media[].url` | string | Gives the public media URL when available. |
| `media[].previewImageUrl` | string | Gives the public preview image URL when available. |
| `media[].width` | integer | Gives the media width in pixels when available. |
| `media[].height` | integer | Gives the media height in pixels when available. |
| `media[].durationMs` | integer | Gives the video duration in milliseconds when available. |
| `media[].altText` | string | Gives the public alternative text when available. |
| `language` | string | Gives the public language metadata when available. |
| `context` | object | Holds public conversation, reply, quote, and sensitive-content context. |
| `context.conversationId` | string | Gives the public conversation ID when available. |
| `context.replyToPostId` | string | Gives the ID of the post being replied to when available. |
| `context.replyToAuthorId` | string | Gives the ID of the replied-to author when available. |
| `context.quotePostId` | string | Gives the ID of the quoted post when available. |
| `context.quotePostUrl` | string | Gives the public URL of the quoted post when available. |
| `context.possiblySensitive` | boolean | Says whether the source marks the post as possibly sensitive. |

**Example row**

This complete row comes from the successful current-beta keyword run. Optional fields not exposed in this row are absent.

```json
{
  "postId": "2093601699877249200",
  "community": {
    "id": "1929843531566268760",
    "url": "https://x.com/i/communities/1929843531566268760"
  },
  "text": "Stacked dev , made grok trenches bot \n\nHe 100x Ed in 48h \n\n50$ to 5k \n\nOpen sourced \n\nThis bond and RIP \n\nAPsZ9cXdHXkj1dfuG622X5xeCMJapJ7LBPuLKvi8pump",
  "postedAt": "2026-08-29T07:28:37.000Z",
  "postUrl": "https://x.com/WojakWal/status/2093601699877249200",
  "author": {
    "id": "1587518588218384384",
    "username": "WojakWal",
    "displayName": "WOJAK WAL",
    "verified": true,
    "avatarUrl": "https://pbs.twimg.com/profile_images/2042821165706588160/H2ufw4cf_normal.jpg",
    "bio": "tg: https://t.co/PcPx8otYXF \n\neverything i share is NFA",
    "followersCount": 3978,
    "createdAt": "2022-11-01T18:55:16.000Z"
  },
  "engagement": {
    "likeCount": 4,
    "repostCount": 0,
    "replyCount": 2,
    "quoteCount": 0,
    "viewCount": 243,
    "bookmarkCount": 0
  },
  "language": "en",
  "context": {
    "conversationId": "2093601699877249200",
    "quotePostId": "2093451510126465047",
    "quotePostUrl": "https://twitter.com/slash1sol/status/2093451510126465047"
  }
}
```

#### 💳 Pricing

This Actor uses pay-per-event pricing. One charge applies to each public X Community post saved to the dataset. Set **Maximum posts** to control how many rows the run can save. Leaving it empty returns all available results until the source is exhausted.

#### 🔌 Integrations

Read the dataset in Apify or through the standard dataset API after a run. See the walkthrough:

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

#### ❓ FAQ

##### Can I search by a keyword?

Yes. Enter one keyword or phrase in **Keyword**. Run a separate search for each keyword.

##### Can I use more than one Community?

Yes. In **Community** mode, enter one or more public Community IDs or URLs. Each saved row keeps its source Community.

##### What does Top ranked mean?

It uses the source's top or high-engagement order when available. **Newest first** uses publication time.

##### What happens when the same post is found twice?

The first eligible match is saved immediately. A later match for the same post is ignored, and the saved row keeps the first match's source context.

##### What happens when Maximum posts is empty?

The Actor returns all available results until the source is exhausted.

##### Do I need an X login, cookies, or API key?

No. The Actor is designed to access public X Community content without buyer-supplied X login credentials, cookies, or API keys.

##### Does it download attached media?

No. It returns public media references and available details. It does not download or mirror the media files.

##### Can it read private or deleted Communities?

No. Private, deleted, restricted, and other non-public Community content is outside the Actor's scope.

### 📝 Changelog

**0.0: Initial release**

### 🆘 Support

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

### 🔗 Related Actors

- [Twitter (X) Scraper](https://apify.com/maximedupre/twitter-scraper) collects broader public X posts, profile matches, and regional trends.
- [Twitter X Media Scraper](https://apify.com/maximedupre/twitter-media-scraper) collects public images, videos, and GIF links with related post data.
- [X (Twitter) Community Search Post Scraper](https://apify.com/api-ninja/x-twitter-community-search-post-scraper) searches public Communities for keyword-matching posts with Community context.
- [Twitter/X Communities Posts Search](https://apify.com/igview-owner/twitter-x-communities-posts-search) searches public Communities for posts with engagement, media, and author data.
- [X (Twitter) Community Post Search - All Communities](https://apify.com/seemuapps/x-community-post-search-scraper) searches public Communities for matching posts across Community sources.

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

# Actor input Schema

## `findBy` (type: `string`):

Choose one way to find public X Community posts.

## `communities` (type: `array`):

Enter one or more public X Community IDs or URLs. The Actor collects posts from each value and keeps the source Community with every row.

## `keyword` (type: `string`):

Enter one keyword or phrase. The Actor searches public X Communities for matching posts and uses the selected post order. Run separate searches for separate keywords.

## `sortBy` (type: `string`):

Choose how to order matching posts. Newest first uses publication time. Top ranked uses the source's top or high-engagement order when available.

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

Stop after this many eligible posts. Leave it empty to return all available results until the source is exhausted.

## Actor input object example

```json
{
  "findBy": "Keyword",
  "keyword": "open source",
  "sortBy": "latest",
  "maxItems": 10
}
```

# Actor output Schema

## `dataset` (type: `string`):

Open the posts collected by this run.

# 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 = {
    "findBy": "Keyword",
    "keyword": "open source",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("maximedupre/twitter-communities-latest-posts-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 = {
    "findBy": "Keyword",
    "keyword": "open source",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("maximedupre/twitter-communities-latest-posts-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 '{
  "findBy": "Keyword",
  "keyword": "open source",
  "maxItems": 10
}' |
apify call maximedupre/twitter-communities-latest-posts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,maximedupre/twitter-communities-latest-posts-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/DbpwfmggaNLMF2ZIM/builds/XnWQlHjsmvJDsfeS4/openapi.json
