# X (Twitter) Profile Posts Scraper

**Use case:** 

Gather the latest 30 posts from specified X (Twitter) profiles, including URLs, content, publication dates, text, and engagement metrics. Perfect for social media analysis, user tracking, and monitoring trends across profiles like @valormental and relevant communities.

## Input

```json
{
  "profileUrls": [
    "https://x.com/valormental",
    "https://x.com/i/communities/1794041896316154138"
  ],
  "resultsLimit": 30
}
```

## Output

```json
{
  "inputUrl": {
    "label": "Original input URL",
    "format": "string"
  },
  "postUrl": {
    "label": "Post URL",
    "format": "link"
  },
  "profileUrl": {
    "label": "Profile URL",
    "format": "link"
  },
  "postId": {
    "label": "Post ID",
    "format": "text"
  },
  "postText": {
    "label": "Post Text",
    "format": "text"
  },
  "timestamp": {
    "label": "Timestamp",
    "format": "number"
  },
  "conversationId": {
    "label": "Conversation ID",
    "format": "text"
  },
  "media": {
    "label": "Media",
    "format": "object"
  },
  "author": {
    "label": "Author",
    "format": "object"
  },
  "replyCount": {
    "label": "Reply Count",
    "format": "number"
  },
  "quoteCount": {
    "label": "Quote Count",
    "format": "number"
  },
  "repostCount": {
    "label": "Repost Count",
    "format": "number"
  },
  "favouriteCount": {
    "label": "Favourite Count",
    "format": "number"
  },
  "viewCount": {
    "label": "View Count",
    "format": "number"
  },
  "error": {
    "label": "URL error",
    "format": "string"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The X (Twitter) Profile Posts Scraper Actor is ready to run with the inputs already set for "X (Twitter) Profile Posts Scraper". [Sign up or log in](https://console.apify.com/create-task-from-example/akNDheCDO7i9GxJcu) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "X (Twitter) Profile Posts Scraper" task

The X (Twitter) Profile Posts Scraper Actor will start running based on the input automatically. You can also change all the input fields, like profile urls and results limit, to match your specific use case.

### 3. Receive the "X (Twitter) Profile Posts Scraper" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as original input url, post url, profile url, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "X (Twitter) Profile Posts Scraper" task via API](https://apify.com/scraper_one/x-profile-posts-scraper.md).

## FAQ

### What data is returned for each post scraped from X profiles?

The X (Twitter) Profile Posts Scraper returns the post URL, post text, timestamp, profile URL, post ID, engagement metrics like reply count, quote count, repost count, favourite count, and view count.

### How many posts can be retrieved from each profile?

The task can retrieve up to 30 posts per profile, with the option to set a different limit using the resultsLimit input.

### What happens if a profile URL is invalid or unavailable?

If a profile URL is invalid or unavailable, the output will include the original input URL and an error message indicating the issue.

### Can this task run automatically on a schedule?

Yes, the task can be scheduled to run automatically through the Apify Console.

### Is it possible to use this task via the Apify API?

Yes, the task can be executed via the Apify API, allowing integration with other applications or scripts.

### What kind of URLs does the task support as input?

The task supports X (Twitter) profile URLs, such as those formatted as https://x.com/username or community URLs like https://x.com/i/communities/123.

### Does this task require a login to access content?

No, the task does not require login credentials to access public X profile posts.

## About this Actor

This example demonstrates how to use [X (Twitter) Profile Posts Scraper](https://apify.com/scraper_one/x-profile-posts-scraper.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/scraper_one/x-profile-posts-scraper.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/scraper_one/x-profile-posts-scraper.md

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