# Twitter User Tweets Scraper | X Profile Scraper (`lance_api/x-twitter-user-tweets-scraper`) Actor

Scrape public X/Twitter user timelines with Tweets, author data, engagement, replies, quotes, reposts, media, date filters, and batch processing.

- **URL**: https://apify.com/lance_api/x-twitter-user-tweets-scraper.md
- **Developed by:** [LanceAPI](https://apify.com/lance_api) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

## X / Twitter User Tweets Scraper

**Turn public X/Twitter profiles into rich, ready-to-use Tweet datasets.**

Enter usernames or profile links to collect timeline posts with text, author profiles, engagement, media, replies, quotes, and repost context. Export JSON or CSV, or feed the results into your own research and automation workflows.

- **Rich context:** quoted and reposted Tweets stay attached to the parent result, including available author and media details.
- **Clean datasets:** one row represents one real Tweet. Duplicate Tweet IDs are saved once per run.
- **Batch profiles:** submit up to 200 profile entries, with per-profile and run-wide result controls.
- **Tweet result charge protection:** pay the Tweet result fee only for unique Tweets saved as Dataset rows. Quoted and reposted context stays nested instead of creating extra Tweet result charges. Platform usage charges are separate.
- **Focused collections:** choose a date range and whether to include replies and reposts.
- **Honest missing values:** unavailable metrics remain `null`, not invented zeroes.

### Quick start

1. Enter a public username or profile URL in **Profiles**.
2. Keep **Results per profile** at 15 for a first run, then click **Start**.
3. Open **Tweet results** to view or export the Dataset. Open **Run summary** for empty profiles, errors, and collection statistics.

```json
{
  "profiles": ["https://x.com/elonmusk"],
  "maxResultsPerProfile": 15
}
```

No X login or cookies are required. Private accounts are not supported.

### Input reference

| Field                  | Type         | Required | Default / prefill                                        | Meaning                                                                                                                                                           |
| ---------------------- | ------------ | -------- | -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `profiles`             | string array | Yes      | UI prefill: `https://x.com/elonmusk`; no runtime default | 1–200 usernames, @usernames, or X/Twitter profile URLs.                                                                                                           |
| `maxResultsPerProfile` | integer      | No       | 15                                                       | Maximum final unique Tweets per profile, after filtering: 1–500 for all plans. Free allowance, availability, filters and scan limits may reduce the result count. |
| `maxItems`             | integer      | No       | Unset                                                    | Positive run-wide unique Tweet limit. Stops remaining collection once reached.                                                                                    |
| `dateRange`            | string       | No       | `latest`                                                 | `latest`, `last_24_hours`, `last_7_days`, `last_30_days`, or `since_date`. Date-filtered collections always end at run time.                                      |
| `startDate`            | string       | No       | Unset                                                    | Optional starting date. When filled, overrides `dateRange` and collects from this date until run time. Clear it to use a recent preset.                           |
| `timezone`             | string       | No       | `UTC`                                                    | IANA time zone for calendar dates and relative months/years, for example `Asia/Shanghai`.                                                                         |
| `includeReplies`       | boolean      | No       | `true`                                                   | Include reply Tweets. Turn off to exclude replies.                                                                                                                |
| `includeRetweets`      | boolean      | No       | `true`                                                   | Include reposts. Quoted Tweets remain eligible.                                                                                                                   |

Accepted profile forms include `elonmusk`, `@elonmusk`, `https://x.com/elonmusk`, and `https://twitter.com/elonmusk`. Equivalent profiles are processed once, case-insensitively. Numeric-looking usernames are treated as usernames, not account IDs. Tweet links and search queries are not inputs for this Actor.

Choose a **Time range** directly in the form: latest Tweets by result count, last 24 hours, last 7 days, last 30 days, or **From a date until now**. Alternatively, fill **From date** and it automatically takes precedence over the dropdown, including its default selection. Clear that date to return to a recent preset. There is no separate end date or Absolute/Relative pair to configure.

Select **Time zone** from the labelled choices, such as China — Beijing / Shanghai, or enter another valid IANA zone. The default is UTC. For `since_date`, a `YYYY-MM-DD` starts at local midnight and ends at run time. Explicit ISO timestamps with Z or an offset still represent the same instant; output `createdAt` remains UTC. Future starting dates are rejected.

Recent presets are rolling 24-hour, 7-day, or 30-day windows, calculated from one stable run reference time. The Actor scans a limited recent timeline window and may return fewer Tweets than requested. It does not search an arbitrary historical date interval or guarantee every Tweet since an old starting date. `endDate` is no longer supported: old API requests that include it fail input validation before collection. Any non-empty `startDate` selects `since_date`, even if `dateRange` contains a preset; an empty or null date uses the preset. Tweets without usable creation times cannot match a date filter.

```json
{
  "profiles": ["elonmusk", "aviationbrk"],
  "maxResultsPerProfile": 100,
  "maxItems": 150,
  "dateRange": "last_7_days",
  "includeReplies": false,
  "includeRetweets": false
}
```

Result limits apply to **final unique Tweet rows**, not unfiltered candidates. Restrictive filters can require more collection work and still yield fewer results. `maxItems` is a result-volume guardrail, not a cap on all platform charges.

### Output

Each Dataset row is a real top-level timeline Tweet. Tweets are sorted newest-first within each processed profile. Profiles are processed in input order; the entire Dataset is not globally sorted across profiles.

Quotes and reposts preserve full nested Tweet context up to two levels deep. Nested context does not create extra rows or separate result charges. Separately attached pinned posts are excluded. A pinned post that also appears naturally in the ordinary timeline remains eligible.

#### Short example

The following is a reduced excerpt from a captured public Tweet response. Metrics are a snapshot, not current values.

```json
{
  "tweetId": "2112039275344941371",
  "url": "https://x.com/thsottiaux/status/2112039275344941371",
  "text": "I bought a new domain and I’m very excited for it. Very",
  "createdAt": "2026-10-19T04:32:57.000Z",
  "authorUsername": "thsottiaux",
  "type": "tweet",
  "likesCount": 5477,
  "viewsCount": 821206,
  "bookmarksCount": 179
}
```

#### Complete Tweet example

This full canonical example was normalized from a captured public response. The parent repost contains a structured mention and the original post's photo. Snapshot metrics and media availability can change.

<details>
<summary>Expand full JSON example</summary>

```json
{
  "tweetId": "2112413088943423581",
  "url": "https://x.com/elonmusk/status/2112413088943423581",
  "text": "Researchers gave 2,000 unemployed people €560/month for two years and tracked them to see how they differed from otherwise eligible nonrecipients.\n\nThey didn't do any more or less crime. Nothing changed. https://t.co/pFJOot3puq",
  "createdAt": "2026-10-20T05:18:21.000Z",
  "language": "en",
  "conversationId": "2112413088943423581",
  "type": "retweet",
  "isReply": false,
  "isRetweet": true,
  "isQuote": false,
  "source": "Twitter for iPhone",
  "possiblySensitive": false,
  "authorId": "44196397",
  "authorUsername": "elonmusk",
  "authorName": "Elon Musk",
  "likesCount": 0,
  "repliesCount": 0,
  "retweetsCount": 315,
  "quotesCount": 0,
  "bookmarksCount": 0,
  "viewsCount": 277723,
  "author": {
    "id": "44196397",
    "username": "elonmusk",
    "name": "Elon Musk",
    "description": "https://t.co/ZdBx5WABYx",
    "verified": false,
    "blueVerified": true,
    "verifiedType": null,
    "followersCount": 241524300,
    "followingCount": 1419,
    "tweetCount": 110544,
    "mediaCount": 4744,
    "favouritesCount": 254238,
    "listedCount": 171036,
    "profileImageUrl": "https://pbs.twimg.com/profile_images/2103567689515954176/aR-Kjpp4_normal.jpg",
    "profileBannerUrl": "https://pbs.twimg.com/profile_banners/44196397/1774145451/1500x500",
    "location": null,
    "website": null,
    "createdAt": "2009-06-02T20:12:29.000Z",
    "protected": false,
    "professionalType": "Creator"
  },
  "engagement": {
    "likes": 0,
    "replies": 0,
    "retweets": 315,
    "quotes": 0,
    "bookmarks": 0,
    "views": 277723
  },
  "replyTo": null,
  "quotedTweet": null,
  "retweetedTweet": {
    "tweetId": "2112290361947410842",
    "url": "https://x.com/cremieuxrecueil/status/2112290361947410842",
    "text": "Researchers gave 2,000 unemployed people €560/month for two years and tracked them to see how they differed from otherwise eligible nonrecipients.\n\nThey didn't do any more or less crime. Nothing changed. https://x.com/cremieuxrecueil/status/2112290361947410842/photo/1",
    "createdAt": "2026-10-19T21:10:41.000Z",
    "language": "en",
    "conversationId": "2112290361947410842",
    "type": "tweet",
    "isReply": false,
    "isRetweet": false,
    "isQuote": false,
    "source": null,
    "possiblySensitive": false,
    "authorId": "1637507099558027267",
    "authorUsername": "cremieuxrecueil",
    "authorName": "Crémieux",
    "likesCount": 3079,
    "repliesCount": 86,
    "retweetsCount": 316,
    "quotesCount": 23,
    "bookmarksCount": 603,
    "viewsCount": 82589,
    "author": {
      "id": "1637507099558027267",
      "username": "cremieuxrecueil",
      "name": "Crémieux",
      "description": "I write about genetics, 'metrics, and demographics.\n\nRead my long-form writing at https://t.co/8hgA4nNS2A.",
      "verified": false,
      "blueVerified": true,
      "verifiedType": null,
      "followersCount": 342610,
      "followingCount": 2309,
      "tweetCount": 78339,
      "mediaCount": 18059,
      "favouritesCount": 372070,
      "listedCount": 2325,
      "profileImageUrl": "https://pbs.twimg.com/profile_images/1637507712983375875/EQHiqVq8_normal.jpg",
      "profileBannerUrl": "https://pbs.twimg.com/profile_banners/1637507099558027267/1679247968/1500x500",
      "location": "Earth",
      "website": "https://www.cremieux.xyz/subscribe",
      "createdAt": "2023-03-19T17:31:37.000Z",
      "protected": false,
      "professionalType": null
    },
    "engagement": {
      "likes": 3079,
      "replies": 86,
      "retweets": 316,
      "quotes": 23,
      "bookmarks": 603,
      "views": 82589
    },
    "replyTo": null,
    "quotedTweet": null,
    "retweetedTweet": null,
    "media": [
      {
        "id": "2112290358151593984",
        "mediaKey": "3_2112290358151593984",
        "type": "photo",
        "url": "https://pbs.twimg.com/media/HVBc46wbwAA6Vwk.jpg",
        "thumbnailUrl": "https://pbs.twimg.com/media/HVBc46wbwAA6Vwk.jpg",
        "expandedUrl": "https://x.com/cremieuxrecueil/status/2112290361947410842/photo/1",
        "width": 1080,
        "height": 1643,
        "aspectRatio": [1080, 1643],
        "durationSeconds": null,
        "hlsUrl": null,
        "variants": [],
        "allowDownload": true,
        "altText": null
      }
    ],
    "hashtags": [],
    "mentions": [],
    "urls": [],
    "cashtags": [],
    "card": null,
    "inputProfile": null,
    "profileUsername": null,
    "scrapedAt": "2026-10-20T05:38:29.308Z"
  },
  "media": [],
  "hashtags": [],
  "mentions": [
    {
      "userId": "1637507099558027267",
      "username": "cremieuxrecueil",
      "name": "Crémieux"
    }
  ],
  "urls": [],
  "cashtags": [],
  "card": null,
  "inputProfile": "elonmusk",
  "profileUsername": "elonmusk",
  "scrapedAt": "2026-10-20T05:38:29.308Z"
}
```

</details>

#### Field reference

| Fields                                                                                       | Type / meaning                                                                                                                          |
| -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `tweetId`                                                                                    | Exact string identity, suitable for database joins and deduplication.                                                                   |
| `url`, `text`, `createdAt`, `language`, `conversationId`                                     | Public source link, fullest available text, UTC ISO timestamp, language code, and conversation identity; unavailable values are `null`. |
| `type`                                                                                       | `tweet`, `reply`, `retweet`, or `quote`. Primary classification prioritizes retweet, then reply, then quote.                            |
| `isReply`, `isRetweet`, `isQuote`                                                            | Independent factual relationship booleans; more than one may be true.                                                                   |
| `source`, `possiblySensitive`                                                                | Available posting-client label and sensitivity flag. Missing values are `null`.                                                         |
| `authorId`, `authorUsername`, `authorName`                                                   | Convenient author identity fields.                                                                                                      |
| `likesCount`, `repliesCount`, `retweetsCount`, `quotesCount`, `bookmarksCount`, `viewsCount` | Numeric counts or `null`; an explicit zero stays zero.                                                                                  |
| `engagement`                                                                                 | The same counts under `likes`, `replies`, `retweets`, `quotes`, `bookmarks`, and `views`.                                               |
| `author`                                                                                     | See author fields below.                                                                                                                |
| `replyTo`                                                                                    | Target `tweetId`, `userId`, and `username`, with unavailable parts `null`; `null` for non-replies.                                      |
| `quotedTweet`, `retweetedTweet`                                                              | Full canonical nested Tweets or `null`. Relationships deeper than two levels are `null`.                                                |
| `media`                                                                                      | Array of media records; see below.                                                                                                      |
| `hashtags`, `cashtags`                                                                       | String arrays.                                                                                                                          |
| `mentions`                                                                                   | Array of `{userId, username, name}` objects; unavailable parts are `null`.                                                              |
| `urls`                                                                                       | Array of `{url, expandedUrl, displayUrl}` objects; unavailable parts are `null`.                                                        |
| `card`                                                                                       | Available `name`, `url`, `title`, `description`, and `imageUrl`, or `null`.                                                             |
| `inputProfile`, `profileUsername`                                                            | The original input reference and normalized collection username, so multi-profile results remain attributable.                          |
| `scrapedAt`                                                                                  | UTC ISO collection timestamp.                                                                                                           |

**Author fields:** `id`, `username`, `name`, `description`, `verified`, `blueVerified`, `verifiedType`, `followersCount`, `followingCount`, `tweetCount`, `mediaCount`, `favouritesCount`, `listedCount`, `profileImageUrl`, `profileBannerUrl`, `location`, `website`, `createdAt`, `protected`, and `professionalType`. Unavailable fields are `null`. Traditional verification and blue verification are separate signals; one does not imply the other.

**Media fields:** `id`, `mediaKey`, `type` (`photo`, `video`, or `animated_gif`), `url`, `thumbnailUrl`, `expandedUrl`, `width`, `height`, `aspectRatio` (a two-number array), `durationSeconds`, `hlsUrl`, `variants`, `allowDownload`, and `altText`. Each variant has `url`, `contentType`, and nullable `bitrate`. For video, `url` prefers the highest-bitrate available MP4, otherwise HLS. Dimensions are pixels, duration is seconds, and bitrate is bits per second. Availability varies by Tweet.

The default table emphasizes text, author, type, creation time, engagement, source link, and profile attribution. Open a row or export JSON for nested details; CSV exports may encode nested objects as JSON.

### Run summary and errors

Empty or unavailable profiles do **not** create placeholder Dataset rows. One unavailable profile does not stop the rest of the batch. Successfully collected Tweets are retained if a later collection step fails.

The **Run summary** contains `requestedProfiles`, `uniqueProfiles`, `successfulProfiles`, `emptyProfiles`, `failedProfiles`, `skippedProfiles`, `tweetsDelivered`, `duplicatesRemoved`, `filteredOut`, and `profiles`. Each profile includes its status, delivered count, pages fetched, and stop reason. `requestedProfiles` counts submitted entries; equivalent profiles are processed once. A partially successful profile counts as successful and retains an explicit `partial_success` status.

Common stop reasons include `limit_reached`, `global_limit_reached`, `timeline_exhausted`, `no_new_unique_tweets`, `repeated_cursor`, `scan_budget_reached`, `page_safety_limit`, `not_found`, `private_profile`, `suspended`, and `upstream_error`. `scan_budget_reached` means the recent scanning window ended; saved results are retained and a full historical archive is not implied.

| Error code                             | What to do                                              |
| -------------------------------------- | ------------------------------------------------------- |
| `INVALID_INPUT`                        | Check the profile format and input types.               |
| `PROFILE_NOT_FOUND`                    | Verify the username still exists.                       |
| `PRIVATE_PROFILE`, `PROFILE_SUSPENDED` | Try another publicly accessible account.                |
| `TWEETS_UNAVAILABLE`                   | Temporary access or data-format issue; try again later. |
| `FREE_USAGE_LIMIT_EXCEEDED`            | Your free allowance has been reached.                   |
| `FREE_USAGE_CHECK_FAILED`              | The allowance could not be verified; retry later.       |

Malformed run-wide configuration, such as an invalid date range, fails input validation before collection.

### Pricing

The result-billing unit is **one unique Tweet successfully saved to the Dataset**. Duplicate, filtered, nested, separately attached pinned, failed, private, and empty results do not create a Tweet result charge.

Formal dollar pricing is pending the product owner's rates and configuration. Check the Actor's **Pricing** tab for the current terms before running it; no dollar rate is promised here. Platform usage charges may apply independently. Use `maxResultsPerProfile` and `maxItems` to control result volume.

### Practical uses

- **Creator research:** compare public posting patterns and engagement in your own analysis tools.
- **Brand monitoring:** collect posts from a known list of public accounts for review.
- **News tracking:** keep source-linked timeline records from public news profiles.
- **Media research:** inspect available photos, video variants, and quoted-post context.
- **Dataset building:** join exact Tweet and author IDs with your own records.
- **AI workflows:** feed text and relationship context into your own summarization, clustering, or retrieval pipeline. The Actor does not perform those analyses itself.

### API integration

Set `APIFY_TOKEN` in your own environment. Do not put tokens in URLs or public code.

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('lance_api/x-twitter-user-tweets-scraper').call({
  profiles: ['elonmusk'],
  maxResultsPerProfile: 15,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('lance_api/x-twitter-user-tweets-scraper').call(run_input={
    'profiles': ['elonmusk'],
    'maxResultsPerProfile': 15,
})
for tweet in client.dataset(run['defaultDatasetId']).iterate_items():
    print(tweet['tweetId'], tweet['text'])
```

#### REST / cURL

Requires cURL and `jq`. Start a run, wait for completion, then fetch its Dataset:

```bash
set -eu
: "${APIFY_TOKEN:?Set APIFY_TOKEN first}"
run=$(curl --fail --silent --show-error \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  --data '{"profiles":["elonmusk"],"maxResultsPerProfile":15}' \
  'https://api.apify.com/v2/acts/lance_api~x-twitter-user-tweets-scraper/runs')
run_id=$(echo "$run" | jq -er '.data.id')
while :; do
  run=$(curl --fail --silent --show-error \
    -H "Authorization: Bearer $APIFY_TOKEN" \
    "https://api.apify.com/v2/actor-runs/$run_id?waitForFinish=60")
  status=$(echo "$run" | jq -er '.data.status')
  case "$status" in
    SUCCEEDED) break ;;
    READY|RUNNING|TIMING-OUT|ABORTING) ;;
    *) echo "Run ended with status: $status" >&2; exit 1 ;;
  esac
done
dataset_id=$(echo "$run" | jq -er '.data.defaultDatasetId')
curl --fail --silent --show-error \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  "https://api.apify.com/v2/datasets/$dataset_id/items?format=json&clean=true"
```

Schedule runs in Apify or integrate the Actor into your own application and automation tools. Deduplication applies within a run, not across separate runs.

### Related tools

For Tweet details and keyword search, use the [X (Twitter) Tweet Scraper](https://apify.com/lance_api/x-tweet-scraper-api). Explore more tools on the [lance_api profile](https://apify.com/lance_api).

### FAQ

**Can I retrieve a complete account history?** No fixed historical depth is guaranteed. The requested count is a maximum, not a promise; X may expose only part of the history.

**Do I need to log into X?** No X login or cookies are required for the supported public collection workflow.

**Why are some values null?** Certain posts do not expose every metric or metadata field. A missing value is kept distinct from an actual zero or false.

**Are quoted and reposted Tweets billed twice?** No. Nested context stays in the parent row and does not create a separate result charge.

**Does a failed collection use my free Tweet allowance?** Where a Tweet allowance applies, only successfully saved unique Tweet results count. An attempt with no saved result does not consume that allowance. Platform usage charges are separate.

**Can I collect several profiles?** Yes, up to 200 submitted profile entries. Use a run-wide limit when you do not want the full per-profile maximum from every profile.

**What happens if I submit the same profile twice?** Equivalent usernames, @usernames, and profile URLs are canonicalized and deduplicated case-insensitively. The profile is processed once in this run.

**Can I exclude replies or reposts?** Yes, with the two include flags. Quotes are not independently switchable; ordinary date and reply/repost filters still apply.

### Limitations and responsible use

Only publicly accessible data can be returned. Protected, suspended, deleted, or restricted accounts may return no Tweets. Historical depth and optional metadata can vary, and media links can expire. Filtering may reduce results below the requested maximum. The Actor does not guarantee a complete archive or a fixed count.

Collect only data you are permitted to access and use. Respect privacy, copyright, applicable law, and platform terms. Do not use the results for spam or harassment.

### Support

Open an issue on the Actor page or email **lanceapi2026@hotmail.com**. Include the Run ID, non-sensitive input, expected result, and actual summary/error code. Never send tokens, passwords, cookies, API keys, session credentials, proxy credentials, or authorization headers.

# Actor input Schema

## `profiles` (type: `array`):

Usernames, @usernames, or X/Twitter profile URLs. Repeated references are processed once. Up to 200 entries.

## `maxResultsPerProfile` (type: `integer`):

Maximum final, filtered, unique Tweets per profile, from 1 to 500 (default 15). Free allowance, availability, filters and scan limits may reduce the result count.

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

Optional run-wide unique Tweet limit. Collection stops when reached.

## `includeReplies` (type: `boolean`):

Keep reply Tweets from the timeline. Disable for a more focused collection.

## `includeRetweets` (type: `boolean`):

Keep reposts, including original Tweet context. Quoted Tweets remain included unless excluded by other filters.

## `dateRange` (type: `string`):

Choose recent Tweets, not a historical archive. A filled From date below overrides this choice; clear From date to use a preset. All date filters end at run time. Collection scans a limited recent timeline window and may return fewer results than requested.

## `startDate` (type: `string`):

Choose a date to automatically collect from that date until now, regardless of the Time range selection. Clear this field to use a recent preset. Starts at local midnight in the selected time zone. Future dates are not allowed; a complete historical archive is not guaranteed.

## `timezone` (type: `string`):

Choose the time zone used for calendar dates. For Beijing time, choose China — Beijing / Shanghai. You can also enter another valid IANA time zone. UTC is used when omitted.

## Actor input object example

```json
{
  "profiles": [
    "https://x.com/elonmusk"
  ],
  "maxResultsPerProfile": 15,
  "includeReplies": true,
  "includeRetweets": true,
  "dateRange": "latest",
  "timezone": "UTC"
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

No description

# 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 = {
    "profiles": [
        "https://x.com/elonmusk"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("lance_api/x-twitter-user-tweets-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 = { "profiles": ["https://x.com/elonmusk"] }

# Run the Actor and wait for it to finish
run = client.actor("lance_api/x-twitter-user-tweets-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 '{
  "profiles": [
    "https://x.com/elonmusk"
  ]
}' |
apify call lance_api/x-twitter-user-tweets-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lance_api/x-twitter-user-tweets-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/8vdEsghfSkpKdA24H/builds/dIYmD8AQtIiv3WN6l/openapi.json
