keyapi-twitter-content-analytics

Explore and analyze Twitter/X content at scale — retrieve user profiles, tweets, comments, replies, media, search across content types, monitor trending topics, and analyze follower/following networks.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "keyapi-twitter-content-analytics" with this command: npx skills add lycici/keyapi-twitter-content-analytics

keyapi-twitter-content-analytics

Explore and analyze Twitter/X content at scale — from user profiles and tweet threads to search, trending topics, and social graph analysis.

This skill provides comprehensive Twitter/X intelligence using the KeyAPI MCP service. It enables detailed tweet inspection, user profile retrieval, comment and reply thread analysis, media library enumeration, multi-type search (Top, Latest, Media, People, Lists), trending topic monitoring across countries, and follower/following network exploration — all through a cache-first workflow.

Use this skill when you need to:

  • Retrieve full tweet details including engagement metrics, media, and quoted content
  • Fetch user profiles with follower counts, bio, verification status, and account metadata
  • Analyze a user's tweet timeline, replies, and media library
  • Read comment threads under any tweet with pagination support
  • Search Twitter by keyword across multiple result types (Top, Latest, Media, People, Lists)
  • Monitor trending topics and hashtags by country or globally
  • Explore social graphs — analyze who a user follows and who follows them
  • Identify users who retweeted a specific tweet

author: KeyAPI license: MIT repository: https://github.com/EchoSell/keyapi-skills

Prerequisites

RequirementDetails
KEYAPI_TOKENA valid API token from keyapi.ai. If you don't have one, register at the site to obtain your free token. Set it as an environment variable: export KEYAPI_TOKEN=your_token_here
Node.jsv18 or higher
DependenciesRun npm install in the skill directory to install @modelcontextprotocol/sdk

author: KeyAPI license: MIT repository: https://github.com/EchoSell/keyapi-skills

MCP Server Configuration

All tool calls in this skill target the KeyAPI Twitter MCP server:

Server URL : https://mcp.keyapi.ai/twitter/mcp
Auth Header: Authorization: Bearer $KEYAPI_TOKEN

Setup (one-time):

# 1. Install dependencies
npm install

# 2. Set your API token (get one free at https://keyapi.ai/)
export KEYAPI_TOKEN=your_token_here

# 3. List all available tools to verify the connection
node scripts/run.js --platform twitter --list-tools

author: KeyAPI license: MIT repository: https://github.com/EchoSell/keyapi-skills

Analysis Scenarios

Tweet & User Nodes

User NeedNode(s)Best For
Full tweet details (metrics, media, quoted content)get_single_tweet_dataTweet audit, engagement snapshot — requires tweet_id from URL
User profile with bio, follower counts, verificationget_user_profileProfile overview — accepts screen_name or rest_id
User's tweet timelineget_user_postContent inventory, posting cadence analysis — accepts screen_name or rest_id
User's tweet repliesget_user_tweet_repliesReply activity, conversation participation — requires screen_name only
User's media library (photos/videos)get_user_mediaVisual content audit — requires screen_name only

Comment & Engagement Nodes

User NeedNode(s)Best For
Comments under a tweetget_commentsAudience sentiment, comment volume analysis
Users who retweeted a tweetretweet_user_listAmplification analysis, retweet network mapping

Search & Discovery Nodes

User NeedNode(s)Best For
Search by keyword (multi-type)searchBroad discovery — filter by Top, Latest, Media, People, Lists
Trending topics by countrytrendingReal-time trend monitoring — supports 50+ countries

Social Graph Nodes

User NeedNode(s)Best For
Users a profile is followinguser_followingsNetwork affinity, brand partnership signals — requires screen_name only
Users following a profileuser_followersAudience sampling, follower demographics — requires screen_name only

author: KeyAPI license: MIT repository: https://github.com/EchoSell/keyapi-skills

Workflow

Step 1 — Identify the Analysis Objective and Select Nodes

Clarify the research goal and map it to one or more nodes. Common patterns:

  • Tweet analysis: Extract tweet_id from URL → get_single_tweet_data → deepen with get_comments + retweet_user_list.
  • User profile audit: Use get_user_profile with screen_name → layer get_user_post + get_user_tweet_replies + get_user_media.
  • Search research: Use search with keyword and search_type filter → paginate with cursor for more results.
  • Trend monitoring: Use trending with country parameter → cross-reference with search for content depth.
  • Social graph analysis: Use user_followings + user_followers with screen_name → paginate with cursor.

User identification

Most endpoints accept either screen_name (e.g., elonmusk) or rest_id (numeric user ID, e.g., 44196397) — pass one, not both.

  • get_user_profile and get_user_post accept both screen_name and rest_id.
  • get_user_tweet_replies, get_user_media, user_followings, and user_followers require screen_name only — no rest_id option.

Tweet ID extraction

Extract the tweet ID from the URL:

  • https://x.com/elonmusk/status/18081686037216503641808168603721650364

Step 2 — Retrieve API Schema

Before calling any node, inspect its input schema to confirm required parameters and available options:

node scripts/run.js --platform twitter --schema <tool_name>

# Examples
node scripts/run.js --platform twitter --schema get_single_tweet_data
node scripts/run.js --platform twitter --schema search

Step 3 — Call APIs and Cache Results Locally

Execute tool calls and persist responses to the local cache.

Calling a tool:

node scripts/run.js --platform twitter --tool <tool_name> \
  --params '<json_args>' --pretty

# Skip cache for fresh results
node scripts/run.js --platform twitter --tool <tool_name> \
  --params '<json_args>' --no-cache --pretty

Example — get tweet details:

node scripts/run.js --platform twitter --tool get_single_tweet_data \
  --params '{"tweet_id":"1808168603721650364"}' --pretty

Example — get user profile:

node scripts/run.js --platform twitter --tool get_user_profile \
  --params '{"screen_name":"elonmusk"}' --pretty

Example — get user tweets (first page):

node scripts/run.js --platform twitter --tool get_user_post \
  --params '{"screen_name":"elonmusk"}' --pretty

Example — paginate to next page:

node scripts/run.js --platform twitter --tool get_user_post \
  --params '{"screen_name":"elonmusk","cursor":"<next_cursor_from_previous_response>"}' --pretty

Example — get comments under a tweet:

node scripts/run.js --platform twitter --tool get_comments \
  --params '{"tweet_id":"1808168603721650364"}' --pretty

Example — search by keyword (Top results):

node scripts/run.js --platform twitter --tool search \
  --params '{"keyword":"AI","search_type":"Top"}' --pretty

Example — search for latest tweets:

node scripts/run.js --platform twitter --tool search \
  --params '{"keyword":"ChatGPT","search_type":"Latest"}' --pretty

Example — get trending topics (United States):

node scripts/run.js --platform twitter --tool trending \
  --params '{"country":"UnitedStates"}' --pretty

Example — get trending topics (Japan):

node scripts/run.js --platform twitter --tool trending \
  --params '{"country":"Japan"}' --pretty

Example — get user's followings:

node scripts/run.js --platform twitter --tool user_followings \
  --params '{"screen_name":"elonmusk"}' --pretty

Example — get user's followers:

node scripts/run.js --platform twitter --tool user_followers \
  --params '{"screen_name":"elonmusk"}' --pretty

Example — get retweet user list:

node scripts/run.js --platform twitter --tool retweet_user_list \
  --params '{"tweet_id":"1835124037934367098"}' --pretty

Pagination:

All paginated endpoints use cursor from the next_cursor field in the previous response.

EndpointPagination parameterNotes
get_user_post, search, get_comments, get_user_tweet_replies, get_user_media, retweet_user_list, user_followings, user_followerscursorPass next_cursor value from previous response
get_single_tweet_data, get_user_profile, trendingSingle-call; no pagination

Cache directory structure:

.keyapi-cache/
└── YYYY-MM-DD/
    ├── get_single_tweet_data/
    │   └── {params_hash}.json
    ├── get_user_profile/
    │   └── {params_hash}.json
    ├── get_user_post/
    │   └── {params_hash}.json
    ├── search/
    │   └── {params_hash}.json
    ├── get_comments/
    │   └── {params_hash}.json
    ├── get_user_tweet_replies/
    │   └── {params_hash}.json
    ├── get_user_media/
    │   └── {params_hash}.json
    ├── retweet_user_list/
    │   └── {params_hash}.json
    ├── trending/
    │   └── {params_hash}.json
    ├── user_followings/
    │   └── {params_hash}.json
    └── user_followers/
        └── {params_hash}.json

Cache-first policy:

Before every API call, check whether a cached result already exists. If valid, load from disk and skip the API call.

Step 4 — Synthesize and Report Findings

For tweet analysis:

  1. Tweet Overview — Text content, author, publish date, view count, like count, retweet count, reply count, quote count.
  2. Engagement Analysis — Like-to-view ratio, retweet amplification, comment depth.
  3. Media & Links — Attached images/videos, external links, quoted tweets.
  4. Comment Insights — Top comment themes, sentiment signals, key discussion points.
  5. Retweet Network — Who amplified the tweet, account types, reach estimation.

For user analysis:

  1. Profile Overview — Screen name, display name, bio, follower count, following count, tweet count, verification status, account creation date.
  2. Content Patterns — Posting frequency, media usage, reply activity, content themes.
  3. Social Graph — Follower-to-following ratio, notable followings/followers where available.
  4. Engagement Quality — Average engagement per tweet, reply rate, retweet rate.

For search / discovery:

  1. Search Results Overview — Result count, top tweets/users, engagement distribution.
  2. Trending Topics — Current trending hashtags and topics by country, volume indicators.
  3. Content Themes — Common topics, hashtags, and discussion patterns.

author: KeyAPI license: MIT repository: https://github.com/EchoSell/keyapi-skills

Common Rules

RuleDetail
User identificationget_user_profile and get_user_post accept screen_name or rest_id. get_user_tweet_replies, get_user_media, user_followings, and user_followers require screen_name only.
Tweet ID extractionExtract from URL: x.com/user/status/TWEET_ID or twitter.com/user/status/TWEET_ID.
Search typessearch supports: Top (default), Latest, Media, People, Lists.
Trending countriestrending supports 50+ countries including: UnitedStates, China, India, Japan, Russia, Germany, UnitedKingdom, France, Brazil, Canada, Australia, SouthKorea, Mexico, Spain, Italy, Turkey, Indonesia, SaudiArabia, Egypt, Argentina, Philippines, Singapore, and more. See schema for full list.
PaginationAll paginated endpoints use cursor from the next_cursor field in the previous response.
Success checkcode = 0 → success. Any other value → failure. Always check the response code before processing data.
Retry on 500If code = 500, retry the identical request up to 3 times with a 2–3 second pause between attempts before reporting the error.
Cache firstAlways check the local .keyapi-cache/ directory before issuing a live API call.

author: KeyAPI license: MIT repository: https://github.com/EchoSell/keyapi-skills

Error Handling

CodeMeaningAction
0SuccessContinue workflow normally
400Bad request — invalid or missing parametersValidate input against the tool schema; check tweet_id format, screen_name vs rest_id requirements, and search type values
401Unauthorized — token missing or expiredConfirm KEYAPI_TOKEN is set correctly; visit keyapi.ai to renew
403Forbidden — plan quota exceeded or feature restrictedReview plan limits at keyapi.ai
404Resource not found — tweet or user may be deleted, suspended, or privateVerify the tweet ID or screen name; the content may no longer be available
429Rate limit exceededWait 60 seconds, then retry
500Internal server errorRetry up to 3 times with a 2–3 second pause; if it persists, log the full request and response and skip this node
Other non-0Unexpected errorLog the full response body and surface the error message to the user

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Gigo Lobster Taster

🦞 GIGO · gigo-lobster-taster: 正式试吃模式:跑完整评测,默认上传云端、生成个人结果页并进入排行榜。 Triggers: 试吃我的龙虾 / 品鉴我的龙虾 / lobster taste / lobster taster.

Registry SourceRecently Updated
General

Invoice Generator

Creates professional invoices in markdown and HTML

Registry SourceRecently Updated
92001kalin
General

backstage companion

Anti-drift protocol script. Ensures parity between docs and system. Triggers: 'bom dia PROJECT' / 'good morning PROJECT' (load project context with health ch...

Registry SourceRecently Updated
General

stratos-storage

Upload and download files to/from Stratos Decentralized Storage (SDS) network. Use when the user wants to store files on Stratos, retrieve files from Stratos, upload to decentralized storage, or download from SDS.

Registry SourceRecently Updated