← 返回 Skills 市场
lycici

Keyapi Twitter Content Analytics

作者 lycici · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
71
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install 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 topi...
使用说明 (SKILL.md)

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

Requirement Details
KEYAPI_TOKEN A 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.js v18 or higher
Dependencies Run 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 Need Node(s) Best For
Full tweet details (metrics, media, quoted content) get_single_tweet_data Tweet audit, engagement snapshot — requires tweet_id from URL
User profile with bio, follower counts, verification get_user_profile Profile overview — accepts screen_name or rest_id
User's tweet timeline get_user_post Content inventory, posting cadence analysis — accepts screen_name or rest_id
User's tweet replies get_user_tweet_replies Reply activity, conversation participation — requires screen_name only
User's media library (photos/videos) get_user_media Visual content audit — requires screen_name only

Comment & Engagement Nodes

User Need Node(s) Best For
Comments under a tweet get_comments Audience sentiment, comment volume analysis
Users who retweeted a tweet retweet_user_list Amplification analysis, retweet network mapping

Search & Discovery Nodes

User Need Node(s) Best For
Search by keyword (multi-type) search Broad discovery — filter by Top, Latest, Media, People, Lists
Trending topics by country trending Real-time trend monitoring — supports 50+ countries

Social Graph Nodes

User Need Node(s) Best For
Users a profile is following user_followings Network affinity, brand partnership signals — requires screen_name only
Users following a profile user_followers Audience 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 \x3Ctool_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 \x3Ctool_name> \
  --params '\x3Cjson_args>' --pretty

# Skip cache for fresh results
node scripts/run.js --platform twitter --tool \x3Ctool_name> \
  --params '\x3Cjson_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":"\x3Cnext_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.

Endpoint Pagination parameter Notes
get_user_post, search, get_comments, get_user_tweet_replies, get_user_media, retweet_user_list, user_followings, user_followers cursor Pass next_cursor value from previous response
get_single_tweet_data, get_user_profile, trending Single-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

Rule Detail
User identification get_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 extraction Extract from URL: x.com/user/status/TWEET_ID or twitter.com/user/status/TWEET_ID.
Search types search supports: Top (default), Latest, Media, People, Lists.
Trending countries trending 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.
Pagination All paginated endpoints use cursor from the next_cursor field in the previous response.
Success check code = 0 → success. Any other value → failure. Always check the response code before processing data.
Retry on 500 If code = 500, retry the identical request up to 3 times with a 2–3 second pause between attempts before reporting the error.
Cache first Always 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

Code Meaning Action
0 Success Continue workflow normally
400 Bad request — invalid or missing parameters Validate input against the tool schema; check tweet_id format, screen_name vs rest_id requirements, and search type values
401 Unauthorized — token missing or expired Confirm KEYAPI_TOKEN is set correctly; visit keyapi.ai to renew
403 Forbidden — plan quota exceeded or feature restricted Review plan limits at keyapi.ai
404 Resource not found — tweet or user may be deleted, suspended, or private Verify the tweet ID or screen name; the content may no longer be available
429 Rate limit exceeded Wait 60 seconds, then retry
500 Internal server error Retry 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-0 Unexpected error Log the full response body and surface the error message to the user
安全使用建议
This skill appears to do what it claims: a Node-based KeyAPI client for Twitter/X analytics that needs a KEYAPI_TOKEN. Before installing: (1) review the KEYAPI_SERVER_URL you use (default is https://mcp.keyapi.ai) — do not point it to unknown servers, (2) be aware the runner will save your token to a .env file in the skill directory and will create a .keyapi-cache directory with API responses, so store the skill in a directory you control and protect those files, (3) inspect scripts/run.js (already included) if you have privacy concerns, and (4) run npm install only from the skill folder and consider running the tool in an isolated environment if you want to limit blast radius.
功能分析
Type: OpenClaw Skill Name: keyapi-twitter-content-analytics Version: 1.0.0 The skill is a legitimate integration for the KeyAPI Twitter MCP service, allowing users to analyze Twitter/X content. The core logic in `scripts/run.js` facilitates communication with the KeyAPI server (mcp.keyapi.ai), handles local caching in `.keyapi-cache/`, and manages API authentication via a user-provided token. While the script can write to a local `.env` file to store the API key, this behavior is transparently logged and is a standard practice for CLI tools. No evidence of data exfiltration, malicious prompt injection, or unauthorized execution was found.
能力标签
crypto
能力评估
Purpose & Capability
Name/description request a KeyAPI token and Node.js and the package.json depends on @modelcontextprotocol/sdk; these are expected for a KeyAPI MCP client that calls Twitter-related tools. No unrelated credentials or binaries are requested.
Instruction Scope
SKILL.md and scripts/run.js limit calls to the KeyAPI MCP server and describe expected operations (list tools, get schema, call tools, pagination, caching). The runner reads a .env file, can prompt for and write KEYAPI_TOKEN into a .env file in the skill directory, and writes cache (.keyapi-cache) and optional output files. These behaviors are reasonable for a CLI client but mean your token and API responses are stored in plain files in the skill directory.
Install Mechanism
No remote archive downloads or obscure installers — the skill is instruction-only with a normal npm dependency (@modelcontextprotocol/sdk). SKILL.md instructs users to run npm install; package.json is small and appropriate for the stated functionality.
Credentials
Only KEYAPI_TOKEN is required (declared as primaryEnv), which is proportional to a third-party API client. However, the runner persists the token to a local .env file in plaintext if prompted and respects KEYAPI_SERVER_URL overrides, so misconfiguring the server URL or leaving the .env file in an unsafe location could expose the token or send requests to an unintended endpoint.
Persistence & Privilege
The skill does not request always:true or global privileges. Its persistent effects are limited to the skill directory (creating a .env file, .keyapi-cache, and optional output files). It does not modify other skills or system-wide agent settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install keyapi-twitter-content-analytics
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /keyapi-twitter-content-analytics 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
keyapi-twitter-content-analytics 1.0.0 - Initial release: Provides large-scale Twitter/X content analysis and discovery via KeyAPI MCP. - Retrieve user profiles, tweets, replies, and media; analyze tweet details, engagement, and comments. - Search by keyword across multiple content types; monitor trending topics globally or by country. - Explore follower/following networks and identify retweet amplifiers. - Cache-first workflow with Node.js CLI for efficient data retrieval and analysis.
元数据
Slug keyapi-twitter-content-analytics
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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 topi... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 71 次。

如何安装 Keyapi Twitter Content Analytics?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install keyapi-twitter-content-analytics」即可一键安装,无需额外配置。

Keyapi Twitter Content Analytics 是免费的吗?

是的,Keyapi Twitter Content Analytics 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Keyapi Twitter Content Analytics 支持哪些平台?

Keyapi Twitter Content Analytics 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Keyapi Twitter Content Analytics?

由 lycici(@lycici)开发并维护,当前版本 v1.0.0。

💬 留言讨论