Skip to main content
skill CX Codex

scraping-twitter-profile-tweets — Claude Code skill

Extracts tweets, replies, and engagement metrics from Twitter/X accounts via Apify. Useful for audience analysis and timeline archiving.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add apidojo-io/apidojo-skills --skill scraping-twitter-profile-tweets -a claude-code
Open on GitHub

What scraping-twitter-profile-tweets does

This skill triggers Apify's apidojo~twitter-profile-scraper actor via scripts/run_actor.js or through the Apify MCP call_actor tool. It accepts user handles without the @ symbol, profile URLs, and timeframe boundaries using start and end. Parameters also let you isolate image posts, include replies, or cap total items with maxItems.

Returned datasets provide tweet text, IDs, direct links, and counters for likes, bookmarks, quotes, and retweets. Author metadata includes follower counts and verification status. Data exports to JSON or CSV.

REST execution requires an $APIFY_TOKEN environment variable. When filtering by date, queries need at least 50 matching tweets in the chosen range to execute successfully.

What it helps with

  • export tweet timelines and reply chains from target X accounts
  • track engagement numbers including bookmarks, retweets, and likes
  • filter account posts by date intervals or media attachments
  • save scraped tweet datasets directly to CSV or JSON files

Example prompts for the agent

  • Fetch the latest 100 tweets from elonmusk and export them to results.json
  • Collect all posts with images from a specific Twitter handle
  • Scrape tweet history with reply counts and bookmarks for a target profile

How to install scraping-twitter-profile-tweets

1Skills CLI (Vercel)

npx skills add apidojo-io/apidojo-skills --skill scraping-twitter-profile-tweets -a claude-code

2Manually: put the files in place

~/.claude/skills/scraping-twitter-profile-tweets/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/scraping-twitter-profile-tweets/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about scraping-twitter-profile-tweets

How do I install scraping-twitter-profile-tweets in Claude Code?

Run npx skills add apidojo-io/apidojo-skills --skill scraping-twitter-profile-tweets -a claude-code in your terminal.

What data does scraping-twitter-profile-tweets return?

It outputs raw tweet text, timestamps, language codes, bookmark counts, like and retweet tallies, and author profile details.

What happens when scraping private or suspended profiles?

Private accounts return zero tweets, while suspended handles trigger an explicit error response from the scraper.

Source text

SKILL.md · Apache-2.0
---
name: scraping-twitter-profile-tweets
description: >
  Extracts tweets, reply threads, and engagement metrics from a specific Twitter/X profile
  using apidojo's Twitter Profile Scraper on Apify. Triggers when the user asks to: get all tweets
  from a Twitter account, scrape tweets from a specific user's profile, export tweet history from
  a Twitter handle, get recent tweets from a Twitter account with engagement stats, fetch tweet
  timeline for a specific user, or collect posts from a Twitter profile by username. Returns tweet
  text, likes, retweets, replies, views, bookmarks, and author info per tweet.
  Ideal for social media monitors, journalists, and competitive intelligence teams.
license: Apache-2.0
metadata:
  author: apidojo
  version: "1.0"
  apify-actor: apidojo/twitter-profile-scraper
---

# Scraping Twitter Profile Tweets

Raw data collection. No assumed use case — returns the full dataset for downstream analysis.

---

## Inputs

| Parameter | Type | Required | Default | Notes |
|-----------|------|----------|---------|-------|
| `startUrls` | array | Optional | `[]` | Twitter profile URLs (x.com or twitter.com formats) |
| `twitterHandles` | array | Optional | `[]` | Twitter usernames (without @) |
| `start` | string | Optional | — | Tweets after this date (YYYY-MM-DD or YYYY-MM-DD_HH:MM:SS_UTC) |
| `end` | string | Optional | — | Tweets before this date (YYYY-MM-DD or YYYY-MM-DD_HH:MM:SS_UTC) |
| `includeNativeRetweets` | boolean | Optional | `false` | Include native retweets in results |
| `onlyImages` | boolean | Optional | `false` | Only tweets containing images |
| `getReplies` | boolean | Optional | `false` | Include tweet replies |
| `minReplyCount` | number | Optional | — | Minimum reply count threshold |
| `getAboutData` | boolean | Optional | `false` | Fetch full profile about data |
| `maxItems` | number | Optional | Unlimited | Maximum tweets to return |
| `customMapFunction` | string | Optional | — | JavaScript function to transform each output object |

## How to Run

### Using run_actor.js (recommended)

```bash
# Quick answer (table)
node scripts/run_actor.js --actor "apidojo~twitter-profile-scraper" --input '{"twitterHandles": ["elonmusk"], "maxItems": 100}'

# Save as CSV
node scripts/run_actor.js --actor "apidojo~twitter-profile-scraper" --input '{"twitterHandles": ["elonmusk"], "maxItems": 100}' --output results.csv --format csv

# Save as JSON
node scripts/run_actor.js --actor "apidojo~twitter-profile-scraper" --input '{"twitterHandles": ["elonmusk"], "maxItems": 100}' --output results.json --format json
```

### REST API fallback

```bash
curl -X POST "https://api.apify.com/v2/acts/apidojo~twitter-profile-scraper/runs" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"twitterHandles": ["elonmusk"], "maxItems": 100}'
```

If Apify MCP is available:
Use the Apify MCP `call_actor` tool with actor `apidojo~twitter-profile-scraper` and the input above.

---

## Output Fields

| Field | Type | Description |
|-------|------|-------------|
| `type` | string | Always `tweet` |
| `id` | string | Tweet ID |
| `url` | string | Tweet URL (x.com) |
| `twitterUrl` | string | Tweet URL (twitter.com) |
| `text` | string | Tweet text content |
| `retweetCount` | number | Retweet count |
| `replyCount` | number | Reply count |
| `likeCount` | number | Like count |
| `quoteCount` | number | Quote tweet count |
| `bookmarkCount` | number | Bookmark count |
| `createdAt` | string | Creation timestamp |
| `lang` | string | Detected language |
| `isReply` | boolean | Whether this is a reply |
| `isRetweet` | boolean | Whether this is a retweet |
| `isQuote` | boolean | Whether this is a quote tweet |
| `source` | string | Twitter client used |
| `author.userName` | string | Author @username |
| `author.name` | string | Author display name |
| `author.isVerified` | boolean | Legacy verification |
| `author.isBlueVerified` | boolean | Twitter Blue verification |
| `author.profilePicture` | string | Author profile picture URL |
| `author.followers` | number | Author follower count |

## Edge Cases

- **Private account**: Returns 0 tweets. Tell user the account is private.
- **Account suspended**: Returns error. Handle may be banned.
- **Very active account**: Use maxItems to cap and control cost ($0.0004 per extra tweet).
- **Date range**: Minimum 50 results needed for the query to run. If few tweets in range, widen date range.
- **Retweets in results**: Actor returns all public tweets including retweets.

© apidojo · Apache-2.0 · apidojo-io/apidojo-skills

Similar skills

All skills for Browser and scraping →

From the same set96

scraping-youtube-playlist Collects video details from a YouTube playlist through an Apify scraper. Use it to export playlist metadata and stats for analysis. CX Codex +1 759installs scraping-google-search-results Pulls Google search results for any query: URLs, titles, snippets, positions and SERP feature types. Handy when you need raw SERP data for SEO or competitor work. CX Codex +1 759installs finding-tiktok-ugc-creators-for-brands Discovers TikTok UGC creators through Apify scrapers and ranks them by engagement. Designed for brands building influencer outreach rosters. CX Codex +1 758installs benchmarking-instagram-influencer-engagement Pulls recent Instagram posts and turns them into engagement benchmarks: followers, average likes and comments, ER, posting frequency. CX Codex +1 757installs extracting-tiktok-comments-for-research Collects TikTok comments and supports sentiment, theme, and top-reaction analysis. Useful for audience research, product feedback, and content studies. CX Codex +1 757installs finding-fitness-brands-on-tiktok Finds gym businesses, fitness studios, and wellness brands on TikTok using Apify. Extracts engagement metrics and handles lead tiering for sales prospecting. CX Codex +1 756installs monitoring-trending-topics-twitter-by-niche Search Twitter for emerging discussions in a chosen niche, then classify topics by tweet velocity. Useful for spotting shifts in an industry conversation. CX Codex +1 755installs discovering-tiktok-creators-by-niche Discovers and ranks TikTok creators across niches using Apify scrapers. Computes engagement metrics and builds structured profile lists for influencer outreach. CX Codex +1 755installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor