DRAFT tutorial. Not indexed by search engines. Not yet listed on the tutorials hub. Review + iterate in the Claude Code session, then merge the "Publish tutorial" PR to make it public.

How to Collect and Analyze Tweets from Any Public Account

Grab tweet text, engagement counts (likes, retweets, views), author profile data, and hashtag entities from any public Twitter/X account. No developer account, no API key, no login. Each item comes back as structured JSON you can pipe straight into Excel, Python, R, or a database. About $0.31 per 1,000 tweets.

Apify dataset table showing collected tweets with engagement counts, author data, and tweet text side by side
Each row is one tweet with full engagement metrics and the author profile embedded.
Difficulty: Beginner
Time: 10 minutes
Cost: $0.31 per 1,000 tweets (free tier covers ~16,000 tweets/month)
Tools: Apify
Try the Twitter/X Scraper free Browse all NanoScrape actors

In this tutorial

  1. What data you can analyze
  2. Prerequisites
  3. Step 1: Open the actor
  4. Step 2: Pick accounts and options
  5. Step 3: Run and collect
  6. Step 4: Export your dataset
  7. Analysis workflows
  8. Automate recurring collection with n8n
  9. What it costs

What data you can analyze

Each tweet comes back as one JSON item with three top-level keys: item_type, tweet, and author. The tweet object holds everything you need for content and engagement analysis. The author object holds the account profile, so you get follower counts and bio data alongside every tweet without a second lookup.

Tweet fields

{
  "item_type": "tweet",
  "tweet": {
    "id": "2071963996576743795",
    "text": "We just 10x'd agent tool access to 20,000+",
    "lang": "en",
    "created_at": "2026-06-30T14:28:06Z",
    "url": "https://x.com/apify/status/2071963996576743795",
    "is_quote": false,
    "is_retweet": false,
    "is_reply": false,
    "is_pinned": true,
    "engagement": {
      "reply_count": 117,
      "retweet_count": 82,
      "like_count": 554,
      "quote_count": 98,
      "bookmark_count": 269,
      "view_count": 826768
    },
    "entities": {
      "hashtags": [],
      "mentions": [{ "username": "coinbase" }],
      "urls": []
    }
  },
  "author": {
    "username": "apify",
    "display_name": "Apify",
    "followers_count": 10347,
    "tweet_count": 4219,
    "verified": false,
    "blue_verified": false
  },
  "scraped_at": "2026-06-30T15:00:00Z"
}

Prerequisites

STEP 1

Step 1: Open the actor

  1. Go to apify.com/santamaria-automations/twitter-x-profiles-tweets-scraper and click Try for free.
  2. Sign in or create your free Apify account.
  3. The actor opens directly in Apify Console on the Input tab.
Twitter X Profiles and Tweets Scraper actor information page on Apify showing description, pricing model, and Try for free button
The actor page shows current pricing and a description of what fields you get back.
STEP 2

Step 2: Pick accounts and options

In the Input tab, switch to JSON editor and paste a configuration like this one. You can add as many usernames as you need in a single run.

{
  "usernames": [
    "openai",
    "@AnthropicAI",
    "https://x.com/Google"
  ],
  "tweetsPerUser": 50,
  "includeReplies": false,
  "includeRetweets": false
}

Input fields and what each one does:

Analysis tip: For engagement benchmarking or sentiment analysis, start with "includeReplies": false and "includeRetweets": false. That gives you only original tweets, which is the cleanest signal for both topics.
Apify Console input editor showing usernames field populated with three Twitter accounts and tweetsPerUser set to 50
You can enter handles in any format. The actor normalizes them automatically.
STEP 3

Step 3: Run and collect

Click Start at the top right. The actor boots, authenticates against X without needing your credentials, fetches each user's profile and tweets, and streams results into the dataset as it goes. A run over three accounts with 50 tweets each typically finishes in under a minute.

Apify run log showing the Twitter scraper completing successfully with tweet items pushed to the dataset
The log shows each account as it is processed and the total item count at the end.

When the run finishes, the status changes to Succeeded. Click the Results tab to see the collected items in table view. The item count in the header tells you exactly how many tweets were returned.

STEP 4

Step 4: Export your dataset

From the Results tab, click Export and choose your format:

Using the API: You can also pull the data programmatically via the Apify dataset API. The URL follows this pattern: https://api.apify.com/v2/datasets/{datasetId}/items?format=json&token={apiToken}. This is useful for automated pipelines that need fresh data each day.

Analysis workflows

Engagement benchmarking across accounts

Load the CSV into a spreadsheet. Add a computed column: like_count / view_count * 100 for a like rate per impression. Group by author.username and compare. Because the actor embeds the author in every row, you can pivot directly without a join.

Hashtag frequency and trending topics

The tweet.entities.hashtags field is a pre-parsed array of strings. In Python, flatten across all tweets and use collections.Counter to get a frequency table in three lines:

import json
from collections import Counter

tweets = json.load(open("tweets.json"))
tags = [tag for item in tweets for tag in item["tweet"]["entities"]["hashtags"]]
print(Counter(tags).most_common(20))

Sentiment scoring with an LLM

Pass the tweet.text field to any LLM API (or a local model) and ask it to classify sentiment as positive, neutral, or negative. Because you have created_at, you can then plot sentiment over time to catch how a brand's tone changed around a product launch or news event.

Influencer reach comparison

The author.followers_count and engagement.view_count fields let you compare actual reach against follower count. Accounts with a high view-to-follower ratio have strong algorithmic amplification, which is a better signal than raw follower count for influencer selection.

Automate recurring collection with n8n

To track accounts on a schedule (daily or weekly), use n8n to trigger runs and pipe the results into a Google Sheet or database automatically. Sign up at n8n, then build a workflow with:

  1. Schedule Trigger - set it to run daily at a fixed time.
  2. HTTP Request node - POST to https://api.apify.com/v2/acts/santamaria-automations~twitter-x-profiles-tweets-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN with your JSON input as the body. The endpoint runs the actor and returns items in one call.
  3. Google Sheets node (or any database node) - append the returned rows to your tracking sheet.
{
  "usernames": ["openai", "@AnthropicAI", "Google"],
  "tweetsPerUser": 20,
  "includeReplies": false,
  "includeRetweets": false
}

Because each run timestamp-stamps the scraped_at field on every item, you can store all runs in the same sheet and filter by date for trend charts.

What it costs

Quick cost estimates:

FAQ

Do I need a Twitter/X API key or developer account?

No. The actor calls X's public endpoints without requiring your credentials, API keys, or a Twitter developer app. You only need an Apify account.

Can I collect tweets from multiple accounts in one run?

Yes. Add as many usernames as you need to the usernames array. All accounts are processed in the same run, and results go into a single dataset.

What does tweetsPerUser: 0 do?

It collects only the author profile (bio, follower counts, verified status, etc.) with no tweets. Useful if you need to build a profile dataset for influencer research without paying for tweet items.

Can I filter tweets by date or keyword?

The actor does not filter by date or keyword at collection time. Download the full dataset and filter locally. Because created_at is an ISO 8601 timestamp on every item, date filtering in a spreadsheet or with pandas is straightforward.

What happens with protected or suspended accounts?

Protected accounts return only the profile object with no tweets (their timeline is private). Suspended accounts return no data. The actor continues to the next username without failing the whole run.

How fresh is the data?

The actor fetches data live from X at the time you run it. There is no caching. The scraped_at field on each item records the exact UTC timestamp.

Can I use this for sentiment analysis?

Yes. The tweet.text field contains the raw tweet text, which you can pass to any sentiment library or LLM. The lang field tells you which language X detected, which is useful for routing multilingual datasets to the right model.

Related resources

Start collecting tweets free Browse all NanoScrape actors