panda-analytics

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Social Analytics

社交媒体分析

View social media analytics and insights via the Nosy Pandas API from Claude Code.
通过Claude Code的Nosy Pandas API查看社交媒体分析数据与洞察信息。

Configuration

配置

This skill shares the same
~/.pandas
config file as
panda-publish
. See that skill for the full setup flow.
Required values:
api_url
and
api_key
.
此功能与
panda-publish
共享同一个
~/.pandas
配置文件。完整设置流程请参考该功能的文档。
必填配置项:
api_url
api_key

Reading Configuration

读取配置

bash
undefined
bash
undefined

Read config values (use these instead of env vars in all curl commands)

Read config values (use these instead of env vars in all curl commands)

PANDAS_API_URL="https://nosypandas.com/api" PANDAS_API_KEY=$(grep '^api_key=' ~/.pandas 2>/dev/null | cut -d= -f2-)

If `~/.pandas` doesn't exist or is missing `api_key`:
1. Ask: "Paste your API key" (tell them to generate one from the dashboard under API Keys)
2. Write the values to `~/.pandas`:
```bash
cat > ~/.pandas << 'EOF'
api_url=https://nosypandas.com/api
api_key=the-pasted-key
media_folder=~/social-media
EOF
chmod 600 ~/.pandas
If the user pastes what looks like an API key without being asked, detect it and offer to save it to
~/.pandas
.
PANDAS_API_URL="https://nosypandas.com/api" PANDAS_API_KEY=$(grep '^api_key=' ~/.pandas 2>/dev/null | cut -d= -f2-)

如果`~/.pandas`文件不存在或缺少`api_key`:
1. 询问用户:"请粘贴您的API密钥"(告知用户可从控制台的API密钥页面生成)
2. 将配置值写入`~/.pandas`:
```bash
cat > ~/.pandas << 'EOF'
api_url=https://nosypandas.com/api
api_key=the-pasted-key
media_folder=~/social-media
EOF
chmod 600 ~/.pandas
如果用户未被询问就粘贴了看似API密钥的内容,需自动识别并询问是否保存到
~/.pandas

Available Commands

可用命令

CommandDescription
OverviewPost analytics with engagement metrics (paginated)
Best TimeOptimal times to post based on historical performance
Content DecayHow engagement drops off over time
Daily MetricsDay-by-day engagement stats (filterable by date range)
Follower StatsFollower growth and demographics
Post TimelineEngagement timeline for posts
Posting FrequencyHow often you're posting and consistency
命令描述
Overview包含互动指标的帖子分析数据(支持分页)
Best Time基于历史表现的最佳发帖时间
Content Decay互动量随时间的衰减情况
Daily Metrics按天统计的互动数据(可按日期范围筛选)
Follower Stats粉丝增长数据与受众特征
Post Timeline帖子的互动时间线
Posting Frequency发帖频率与一致性

Pro Plan Gate

专业版限制

All 7 analytics endpoints require a Pro plan. Before displaying any analytics data, you must handle the 403 response.
When any analytics API call returns a 403 status with
{"message": "Pro plan required."}
, do the following:
  1. Do NOT show the raw error or JSON response
  2. Display this message exactly:
Analytics requires a Pro plan.
You're currently on the Basic plan. Analytics — including post performance, best posting times, follower growth, and content decay — are available on Pro.
Upgrade to Pro ($79/year) from your dashboard's Billing page to unlock analytics.
  1. STOP. Do not retry, do not offer workarounds, do not show empty states or dummy data.
所有7个分析接口都需要专业版权限。在显示任何分析数据前,必须处理403响应。
当任何分析API调用返回403状态码且响应内容为
{"message": "Pro plan required."}
时,执行以下操作:
  1. 不要显示原始错误或JSON响应
  2. 准确显示以下消息:
分析功能需专业版权限
您当前使用的是基础版。分析功能——包括帖子表现、最佳发帖时间、粉丝增长和内容衰减——仅对专业版用户开放。
请前往控制台的账单页面升级到专业版(年费79美元)以解锁分析功能。
  1. 停止操作,不要重试,不要提供替代方案,不要显示空状态或模拟数据。

Overview

概览

Post analytics with engagement metrics.
包含互动指标的帖子分析数据。

Steps

步骤

  1. Verify
    ~/.pandas
    config has
    api_url
    and
    api_key
  2. Make the API call
  3. If 403, show the Pro Plan Gate upgrade message and stop
  4. Format and display results
  1. 验证
    ~/.pandas
    配置文件中包含
    api_url
    api_key
  2. 发起API调用
  3. 如果返回403,显示专业版升级提示并停止操作
  4. 格式化并展示结果

API Call

API调用

bash
curl -s "$PANDAS_API_URL/analytics" \
  -H "Authorization: Bearer $PANDAS_API_KEY" \
  -H "Accept: application/json"
Optional query parameters:
  • ?postId=ID
    — filter to a specific post
  • ?page=N
    — pagination (default page 1)
For paginated results, offer to fetch the next page if more data is available.
bash
curl -s "$PANDAS_API_URL/analytics" \
  -H "Authorization: Bearer $PANDAS_API_KEY" \
  -H "Accept: application/json"
可选查询参数:
  • ?postId=ID
    — 筛选特定帖子的数据
  • ?page=N
    — 分页(默认第1页)
对于分页结果,如果有更多数据,需询问用户是否获取下一页。

Best Time

最佳发帖时间

Optimal times to post based on historical performance.
基于历史表现的最佳发帖时间。

Steps

步骤

  1. Verify
    ~/.pandas
    config has
    api_url
    and
    api_key
  2. Make the API call
  3. If 403, show the Pro Plan Gate upgrade message and stop
  4. Format and display results
  1. 验证
    ~/.pandas
    配置文件中包含
    api_url
    api_key
  2. 发起API调用
  3. 如果返回403,显示专业版升级提示并停止操作
  4. 格式化并展示结果

API Call

API调用

bash
curl -s "$PANDAS_API_URL/analytics/best-time" \
  -H "Authorization: Bearer $PANDAS_API_KEY" \
  -H "Accept: application/json"
bash
curl -s "$PANDAS_API_URL/analytics/best-time" \
  -H "Authorization: Bearer $PANDAS_API_KEY" \
  -H "Accept: application/json"

Content Decay

内容衰减

How engagement drops off over time.
互动量随时间的衰减情况。

Steps

步骤

  1. Verify
    ~/.pandas
    config has
    api_url
    and
    api_key
  2. Make the API call
  3. If 403, show the Pro Plan Gate upgrade message and stop
  4. Format and display results
  1. 验证
    ~/.pandas
    配置文件中包含
    api_url
    api_key
  2. 发起API调用
  3. 如果返回403,显示专业版升级提示并停止操作
  4. 格式化并展示结果

API Call

API调用

bash
curl -s "$PANDAS_API_URL/analytics/content-decay" \
  -H "Authorization: Bearer $PANDAS_API_KEY" \
  -H "Accept: application/json"
bash
curl -s "$PANDAS_API_URL/analytics/content-decay" \
  -H "Authorization: Bearer $PANDAS_API_KEY" \
  -H "Accept: application/json"

Daily Metrics

每日指标

Day-by-day engagement stats.
按天统计的互动数据。

Steps

步骤

  1. Verify
    ~/.pandas
    config has
    api_url
    and
    api_key
  2. Make the API call
  3. If 403, show the Pro Plan Gate upgrade message and stop
  4. Format and display results
  1. 验证
    ~/.pandas
    配置文件中包含
    api_url
    api_key
  2. 发起API调用
  3. 如果返回403,显示专业版升级提示并停止操作
  4. 格式化并展示结果

API Call

API调用

bash
curl -s "$PANDAS_API_URL/analytics/daily-metrics" \
  -H "Authorization: Bearer $PANDAS_API_KEY" \
  -H "Accept: application/json"
Optional query parameters:
  • ?days=30
    — number of days to look back (default varies by API)
bash
curl -s "$PANDAS_API_URL/analytics/daily-metrics" \
  -H "Authorization: Bearer $PANDAS_API_KEY" \
  -H "Accept: application/json"
可选查询参数:
  • ?days=30
    — 回溯天数(默认值因接口而异)

Follower Stats

粉丝统计

Follower growth and demographics.
粉丝增长数据与受众特征。

Steps

步骤

  1. Verify
    ~/.pandas
    config has
    api_url
    and
    api_key
  2. Make the API call
  3. If 403, show the Pro Plan Gate upgrade message and stop
  4. Format and display results
  1. 验证
    ~/.pandas
    配置文件中包含
    api_url
    api_key
  2. 发起API调用
  3. 如果返回403,显示专业版升级提示并停止操作
  4. 格式化并展示结果

API Call

API调用

bash
curl -s "$PANDAS_API_URL/analytics/follower-stats" \
  -H "Authorization: Bearer $PANDAS_API_KEY" \
  -H "Accept: application/json"
bash
curl -s "$PANDAS_API_URL/analytics/follower-stats" \
  -H "Authorization: Bearer $PANDAS_API_KEY" \
  -H "Accept: application/json"

Post Timeline

帖子互动时间线

Engagement timeline for posts.
帖子的互动时间线。

Steps

步骤

  1. Verify
    ~/.pandas
    config has
    api_url
    and
    api_key
  2. Make the API call
  3. If 403, show the Pro Plan Gate upgrade message and stop
  4. Format and display results
  1. 验证
    ~/.pandas
    配置文件中包含
    api_url
    api_key
  2. 发起API调用
  3. 如果返回403,显示专业版升级提示并停止操作
  4. 格式化并展示结果

API Call

API调用

bash
curl -s "$PANDAS_API_URL/analytics/post-timeline" \
  -H "Authorization: Bearer $PANDAS_API_KEY" \
  -H "Accept: application/json"
Optional query parameters:
  • ?postId=ID
    — filter to a specific post's timeline
bash
curl -s "$PANDAS_API_URL/analytics/post-timeline" \
  -H "Authorization: Bearer $PANDAS_API_KEY" \
  -H "Accept: application/json"
可选查询参数:
  • ?postId=ID
    — 筛选特定帖子的时间线

Posting Frequency

发帖频率

How often you're posting and consistency.
发帖频率与一致性。

Steps

步骤

  1. Verify
    ~/.pandas
    config has
    api_url
    and
    api_key
  2. Make the API call
  3. If 403, show the Pro Plan Gate upgrade message and stop
  4. Format and display results
  1. 验证
    ~/.pandas
    配置文件中包含
    api_url
    api_key
  2. 发起API调用
  3. 如果返回403,显示专业版升级提示并停止操作
  4. 格式化并展示结果

API Call

API调用

bash
curl -s "$PANDAS_API_URL/analytics/posting-frequency" \
  -H "Authorization: Bearer $PANDAS_API_KEY" \
  -H "Accept: application/json"
bash
curl -s "$PANDAS_API_URL/analytics/posting-frequency" \
  -H "Authorization: Bearer $PANDAS_API_KEY" \
  -H "Accept: application/json"

Display Guidelines

展示规范

When presenting analytics data to the user:
  • Tables for tabular data (daily metrics, post lists, overview results)
  • Bullet points for insights (best time recommendations, frequency analysis)
  • Highlight key numbers — top-performing posts, growth trends, peak engagement times
  • Summaries first, details on request — lead with the headline stat, offer to drill down
  • Paginated results (overview) — offer to fetch the next page if more data is available
  • Date ranges — when showing daily metrics, clearly label the date range covered
当向用户展示分析数据时:
  • 表格:用于展示结构化数据(如每日指标、帖子列表、概览结果)
  • 项目符号:用于展示洞察信息(如最佳发帖时间建议、频率分析)
  • 突出关键数据——表现最佳的帖子、增长趋势、互动峰值时间
  • 先总结后详情——先展示核心数据,再提供深入查看选项
  • 分页结果(概览)——如果有更多数据,询问用户是否获取下一页
  • 日期范围——展示每日指标时,需明确标注覆盖的日期范围

Error Handling

错误处理

StatusMeaningRecovery
401Invalid API keyCheck
api_key
in
~/.pandas
is correct
403Pro plan requiredShow the upgrade message (see Pro Plan Gate section)
422Validation errorShow the specific error messages from the response body and help the user fix them
500Server errorTry again later
状态码含义解决方法
401API密钥无效检查
~/.pandas
中的
api_key
是否正确
403需专业版权限显示升级提示(参考专业版限制章节)
422验证错误显示响应体中的具体错误信息,并帮助用户修正
500服务器错误稍后重试