# X (twitter) Community Posts Search (`datamagnet/community-posts-search`) Actor

Search community posts by keyword and quickly return the latest or top-ranked matches. Get clean post details with pagination for easy browsing through more results.

- **URL**: https://apify.com/datamagnet/community-posts-search.md
- **Developed by:** [Datamagnet](https://apify.com/datamagnet) (community)
- **Categories:** Social media, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## Community Posts Search Scraper

Community Posts Search Scraper helps you quickly find community posts by keyword and return either the latest matches or the top-ranked results. It is built for marketers, researchers, community managers, and analysts who need fast access to community post data without manual searching. Use it to collect community post titles, authors, snippets, community names, timestamps, and ranking details in one clean export. If you want a simple way to monitor conversations and review relevant posts at scale, this actor makes it easy.

### Key Features
- Extract community posts matching any keyword or phrase.
- Collect either the newest posts or the highest-ranked posts based on your goal.
- Return clean, easy-to-review post details including title, community name, author, and text snippet.
- Capture ranking or score information so you can compare post relevance at a glance.
- Continue through more results automatically when there are additional matches.
- Export results in a format that is easy to sort, filter, and share with your team.
- Save time by replacing manual searching with a repeatable search workflow.

### Use Cases

#### Market Research
Researchers can search for a topic like a product name, brand, or trend and review the matching community posts in one place. The returned title, community name, post text snippet, and timestamps help teams understand what people are discussing and when the conversation is happening.

#### Brand Monitoring
Brand and communications teams can look up their company name or campaign keyword to see what community members are saying. By checking the author, post text snippet, and post URL, they can quickly identify important conversations that may need a response or follow-up.

#### Content Discovery
Content creators and social media managers can search for topics their audience cares about and find the most active or most recent discussions. The score or ranking information helps them spot posts that are gaining attention, while the community name shows where the conversation is strongest.

#### Competitive Analysis
Analysts can search for competitor names, product lines, or industry terms to see how often they appear in community discussions. The combination of title, snippet, and ranking details makes it easier to compare which topics are getting traction and which communities are driving the conversation.

#### Community Engagement
Community managers can use this actor to find posts that mention a specific topic, feature request, or support issue. The author, timestamps, and post URL make it easier to review context, prioritize replies, and keep track of important discussions.

#### Trend Tracking
Teams that watch emerging topics can search for a keyword regularly and compare the latest results over time. Because the actor can return newer posts or top posts, it supports both real-time monitoring and broader trend review.

### Input

| Field | Type | Required | Description | Example |
|---|---|---:|---|---|
| query | string | Yes | The word or phrase you want to search for in community posts. | superman |
| post_type | string | No | Choose whether you want the newest posts or the top-ranked posts. | latest |
| max_results | integer | No | The maximum number of posts you want returned. | 10 |

### Output

| Field | Type | Description |
|---|---|---|
| search_keyword | string | The keyword you searched for, so you can remember what the results are based on. |
| post_type | string | Shows whether the results were returned as latest posts or top posts. |
| total_results | integer | The number of posts returned in the final result set. |
| posts | array | A list of matching posts with the most useful details for review and comparison. |
| posts[].title | string | The post title, which helps you quickly understand the topic. |
| posts[].community_name | string | The community where the post was found. |
| posts[].author | string | The person who created the post. |
| posts[].post_text_snippet | string | A short preview of the post content so you can judge relevance fast. |
| posts[].score_or_ranking | string or number | The score, rank, or similar popularity detail shown for the post. |
| posts[].post_url | string | A direct link to the post for deeper review. |
| posts[].timestamp | string | Any available date or time information for when the post was created or published. |
| next_cursor | string | A continuation token that can be used to load the next batch of results when available. |

### Sample Output

```json
{
  "search_keyword": "superman",
  "post_type": "latest",
  "total_results": 1,
  "posts": [
    {
      "title": "Looking for Superman comic recommendations",
      "community_name": "Comic Fans Hub",
      "author": "daily_reader",
      "post_text_snippet": "I’m trying to find the best Superman story arcs to start with. Any suggestions for newer readers?",
      "score_or_ranking": 42,
      "post_url": "https://example.com/community/posts/superman-recommendations",
      "timestamp": "2026-07-06T10:15:00Z"
    }
  ],
  "next_cursor": "eyJwYWdlIjoyfQ=="
}
````

### How It Works

1. You enter a search keyword that matches the community posts you want to find.
2. You choose whether you want the latest results or the top-ranked results.
3. You set how many posts you want returned, or keep the default if you only need a quick sample.
4. The actor searches for matching posts and gathers the most useful details into a clean list.
5. If more results are available, it continues automatically and provides a continuation token for the next batch.

### Getting Started

Getting started is simple and does not require coding knowledge. Click **Try for free**, enter your search keyword, choose whether you want latest or top posts, and set the maximum number of results if needed. Then click **Run** and let the actor do the work for you. When it finishes, you can review and download the results as JSON, CSV, or Excel.

### Frequently Asked Questions

#### Do I need technical skills?

No. This actor is designed for business users who want results without dealing with complicated setup. You only need to enter a keyword, choose the post type, and run it.

#### How fast does it run?

It usually runs quickly for small searches and may take a bit longer when you request more results. The exact time depends on how many matching posts are available and how many you ask for.

#### What format is the output?

You can work with the results in JSON, CSV, or Excel. That makes it easy to review the data yourself, share it with teammates, or import it into your reporting workflow.

#### Is this legal to use?

It is intended for lawful research, monitoring, and analysis of publicly available community post data. You should always make sure your use follows the rules of the communities you are reviewing and any applicable laws or policies.

#### Can I schedule it to run automatically?

Yes, you can set it up to run on a schedule if you want regular updates. This is useful for ongoing monitoring, trend tracking, and brand watch workflows where fresh results matter.

# Actor input Schema

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

The search term to look up.

## `post_type` (type: `string`):

Choose whether to search the newest posts or the top posts.

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

How many results to return at most.

## Actor input object example

```json
{
  "query": "superman",
  "post_type": "latest",
  "max_results": 10
}
```

# 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 = {
    "query": "superman"
};

// Run the Actor and wait for it to finish
const run = await client.actor("datamagnet/community-posts-search").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 = { "query": "superman" }

# Run the Actor and wait for it to finish
run = client.actor("datamagnet/community-posts-search").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "query": "superman"
}' |
apify call datamagnet/community-posts-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=datamagnet/community-posts-search",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "X (twitter) Community Posts Search",
        "description": "Search community posts by keyword and quickly return the latest or top-ranked matches. Get clean post details with pagination for easy browsing through more results.",
        "version": "0.0",
        "x-build-id": "bQ7Q9xbcqvAvwtLGm"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/datamagnet~community-posts-search/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-datamagnet-community-posts-search",
                "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/datamagnet~community-posts-search/runs": {
            "post": {
                "operationId": "runs-sync-datamagnet-community-posts-search",
                "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/datamagnet~community-posts-search/run-sync": {
            "post": {
                "operationId": "run-sync-datamagnet-community-posts-search",
                "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",
                "required": [
                    "query"
                ],
                "properties": {
                    "query": {
                        "title": "Search query",
                        "type": "string",
                        "description": "The search term to look up."
                    },
                    "post_type": {
                        "title": "Post type",
                        "enum": [
                            "latest",
                            "top"
                        ],
                        "type": "string",
                        "description": "Choose whether to search the newest posts or the top posts.",
                        "default": "latest"
                    },
                    "max_results": {
                        "title": "Maximum results",
                        "type": "integer",
                        "description": "How many results to return at most.",
                        "default": 10
                    }
                }
            },
            "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
                                    }
                                }
                            },
                            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
