Skip to main content
skill CX Codex

scraping-twitter-profiles — Claude Code skill: how to install

Extracts Twitter/X profile metadata through Apify actors. Useful for pulling follower counts, bios, and verification flags across user lists.

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

What scraping-twitter-profiles does

The skill automates collecting public Twitter/X profile data through Apify's apidojo/twitter-user-scraper actor. It normalizes input handles before scraping. The agent strips @ symbols and removes duplicate usernames. Returned fields include follower counts, bio text, and verification badges.

Execution runs through the scripts/run_actor.js helper or an Apify MCP tool. You can export datasets to CSV or JSON. If a task exceeds 1000 profiles, the scraper requires splitting the list into batches of 500 handles. Without a valid APIFY_TOKEN in your environment or .env file, the actor fails to authenticate.

Private accounts get flagged automatically. They return account metadata marked with isPrivate: true without tweets. Suspended or deactivated usernames return empty objects and get dropped from the final output.

What it helps with

  • Export Twitter/X profile stats and bios for a list of handles
  • Save follower counts and verification badges to CSV or JSON
  • Filter out suspended or private accounts during audience research
  • Normalize username lists by removing @ symbols and duplicates

Example prompts for the agent

  • Scrape profile details for elonmusk and sama using Apify and export to CSV
  • Fetch follower counts and bios for the list in handles.txt
  • Check verification status and account creation dates for these Twitter usernames

How to install scraping-twitter-profiles

1Skills CLI (Vercel)

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

2Manually: put the files in place

~/.claude/skills/scraping-twitter-profiles/SKILL.md

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

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

Questions about scraping-twitter-profiles

How do I install scraping-twitter-profiles in Claude Code?

Run npx skills add apidojo-io/apidojo-skills --skill scraping-twitter-profiles -a claude-code. The skill configuration saves to ~/.claude/skills/scraping-twitter-profiles/SKILL.md.

What does the scraping-twitter-profiles skill do?

It triggers the apidojo/twitter-user-scraper Apify actor to retrieve public Twitter/X profile data in bulk. Output records include follower counts, bio text, verification status, and account creation timestamps.

What is required before running the scraper?

You need an Apify API token exported as APIFY_TOKEN or saved in a .env file. For lists larger than 1000 handles, split them into batches of 500.

Source text

SKILL.md · Apache-2.0
---
name: scraping-twitter-profiles
description: >
  Scrapes Twitter/X profile data for any list of usernames using apidojo's Twitter User
  scraper on Apify. Triggers when the user asks to: get profile data for Twitter accounts,
  fetch follower counts for a list of usernames, scrape Twitter bio and stats for multiple
  users, export Twitter profile metadata, check account details for a set of handles,
  or bulk-fetch Twitter user information. Returns username, display name, bio, follower
  count, following count, tweet count, verified status, and profile URL.
  Ideal for data analysts, list enrichment pipelines, and market researchers.
license: Apache-2.0
metadata:
  author: apidojo
  version: "1.0"
  apify-actor: apidojo/twitter-user-scraper
---

# Scraping Twitter Profiles

Bulk profile data export for any set of Twitter/X usernames. Returns account-level metadata: follower counts, bios, join dates, verification status.

## Prerequisites

- `APIFY_TOKEN` environment variable set
- Optional: Apify MCP server installed

## Inputs

| Parameter | Type | Required | Default | Notes |
|-----------|------|----------|---------|-------|
| `startUrls` | array | Optional | `[]` | Twitter profile or tweet URLs |
| `twitterHandles` | array | Optional | `[]` | Twitter usernames (without @) |
| `twitterUserIds` | array | Optional | `[]` | Twitter user IDs |
| `getFollowers` | boolean | Optional | `false` | Extract follower lists |
| `getFollowing` | boolean | Optional | `false` | Extract following lists |
| `getRetweeters` | boolean | Optional | `false` | Extract retweeters of a tweet URL |
| `includeUnavailableUsers` | boolean | Optional | `false` | Include unavailable/suspended users |
| `maxItems` | number | Optional | Unlimited | Maximum users to return |
| `customMapFunction` | string | Optional | — | JavaScript function to transform each output object |

## Workflow

```
Progress:
- [ ] Step 1: Normalize username list
- [ ] Step 2: Run twitter-user-scraper
- [ ] Step 3: Poll for SUCCEEDED
- [ ] Step 4: Deliver profile dataset
```

### Step 1: Normalize

Remove `@` symbols, deduplicate, validate no empty strings.

### Step 2: Run the Actor


**Recommended — run_actor.js (handles waiting, output, and file saving automatically):**
```bash
# Quick answer (prints table to chat)
node scripts/run_actor.js \
  --actor "apidojo~twitter-user-scraper" \
  --input '{"param": "value"}'

# Save as CSV
node scripts/run_actor.js \
  --actor "apidojo~twitter-user-scraper" \
  --input '{"param": "value"}' \
  --output YYYY-MM-DD_results.csv --format csv

# Save as JSON
node scripts/run_actor.js \
  --actor "apidojo~twitter-user-scraper" \
  --input '{"param": "value"}' \
  --output YYYY-MM-DD_results.json --format json
```
> `APIFY_TOKEN` must be set in environment or `.env` file.

**If Apify MCP is available:**
```
Tool: apify:run-actor
Actor: "apidojo~twitter-user-scraper"
Input:
{
  "usernames": ["handle1", "handle2", "handle3"]
}
```

**REST API fallback:**
```bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~twitter-user-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"usernames": ["handle1", "handle2"]}'
```

Save `id` as `RUN_ID`. Poll until `status = SUCCEEDED`:
```bash
curl "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_TOKEN" | grep '"status"'
```

Fetch results:
```bash
curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN&format=json"
```

### Step 3: Handle Edge Cases

- **Missing accounts in results**: Account suspended, deleted, or handle changed. Note missing handles in output.
- **Private accounts**: Returns profile metadata but no tweet content — flag `isPrivate: true` rows.
- **Deactivated accounts**: Returns null or empty object — exclude from final dataset.

## Output Format

```
# Twitter Profile Dataset
Accounts requested: N | Accounts returned: N | Missing: N

| Username | Display Name | Followers | Following | Tweets | Verified | Bio (truncated) | Joined |
|----------|-------------|-----------|-----------|--------|----------|-----------------|--------|
| ...      | ...         | ...       | ...       | ...    | ...      | ...             | ...    |

Available fields: username, displayName, followersCount, followingCount, tweetCount,
isVerified, isBlueVerified, description, location, url, profileImageUrl, createdAt, isPrivate
```

## Troubleshooting

**Some handles missing from results:** Accounts may be suspended or renamed — cross-reference manually.
**Large lists (> 1000):** Break into batches of 500 and run sequentially.

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

Similar skills

All skills for Browser and scraping →

From the same set82

finding-hospitality-brands-on-instagram Finds hotels and resorts on Instagram via Apify, scoring hospitality accounts into lead tiers for B2B sales. CX Codex +1 774installs analyzing-competitor-tiktok-content-strategy This skill examines a competitor’s TikTok account, covering videos, posting cadence, hashtags, hooks, and engagement. Use it for content strategy research. CX Codex +1 771installs tracking-competitor-social-media-growth Pulls follower counts and engagement for competitor accounts on Twitter/X, TikTok and Instagram, then lines them up side by side. Useful when you need to compare how accounts grow. CX Codex +1 771installs monitoring-brand-mentions-on-twitter Collects public brand mentions on Twitter/X via Apify, sorts them by sentiment, and builds an engagement report. CX Codex +1 771installs finding-affiliate-marketers-on-social-media Finds affiliate marketers and performance creators on Instagram and TikTok through apidojo scrapers. Useful when you are building a recruitment list for an affiliate program. CX Codex +1 770installs discovering-tiktok-shop-sellers-by-niche Maps TikTok Shop sellers and products in a niche: who promotes what, which items move, where the gaps are. CX Codex +1 770installs tracking-startup-founders-on-twitter Finds startup founders on Twitter by industry or niche and gathers details about their companies and activity. Use it to build a list of accounts to follow. CX Codex +1 769installs finding-content-gaps-from-google-serp This skill reviews Google results for target keywords and spots topics with weak coverage. Use it to decide which content ideas deserve attention. CX Codex +1 767installs

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