panda-analytics
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSocial 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 config file as . See that skill for the full setup flow.
~/.pandaspanda-publishRequired values: and .
api_urlapi_key此功能与共享同一个配置文件。完整设置流程请参考该功能的文档。
panda-publish~/.pandas必填配置项:和。
api_urlapi_keyReading Configuration
读取配置
bash
undefinedbash
undefinedRead 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 ~/.pandasIf the user pastes what looks like an API key without being asked, detect it and offer to save it to .
~/.pandasPANDAS_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密钥的内容,需自动识别并询问是否保存到。
~/.pandasAvailable Commands
可用命令
| Command | Description |
|---|---|
| Overview | Post analytics with engagement metrics (paginated) |
| Best Time | Optimal times to post based on historical performance |
| Content Decay | How engagement drops off over time |
| Daily Metrics | Day-by-day engagement stats (filterable by date range) |
| Follower Stats | Follower growth and demographics |
| Post Timeline | Engagement timeline for posts |
| Posting Frequency | How 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 , do the following:
{"message": "Pro plan required."}- Do NOT show the raw error or JSON response
- 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.
- STOP. Do not retry, do not offer workarounds, do not show empty states or dummy data.
所有7个分析接口都需要专业版权限。在显示任何分析数据前,必须处理403响应。
当任何分析API调用返回403状态码且响应内容为时,执行以下操作:
{"message": "Pro plan required."}- 不要显示原始错误或JSON响应
- 准确显示以下消息:
分析功能需专业版权限您当前使用的是基础版。分析功能——包括帖子表现、最佳发帖时间、粉丝增长和内容衰减——仅对专业版用户开放。请前往控制台的账单页面升级到专业版(年费79美元)以解锁分析功能。
- 停止操作,不要重试,不要提供替代方案,不要显示空状态或模拟数据。
Overview
概览
Post analytics with engagement metrics.
包含互动指标的帖子分析数据。
Steps
步骤
- Verify config has
~/.pandasandapi_urlapi_key - Make the API call
- If 403, show the Pro Plan Gate upgrade message and stop
- Format and display results
- 验证配置文件中包含
~/.pandas和api_urlapi_key - 发起API调用
- 如果返回403,显示专业版升级提示并停止操作
- 格式化并展示结果
API Call
API调用
bash
curl -s "$PANDAS_API_URL/analytics" \
-H "Authorization: Bearer $PANDAS_API_KEY" \
-H "Accept: application/json"Optional query parameters:
- — filter to a specific post
?postId=ID - — pagination (default page 1)
?page=N
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 - — 分页(默认第1页)
?page=N
对于分页结果,如果有更多数据,需询问用户是否获取下一页。
Best Time
最佳发帖时间
Optimal times to post based on historical performance.
基于历史表现的最佳发帖时间。
Steps
步骤
- Verify config has
~/.pandasandapi_urlapi_key - Make the API call
- If 403, show the Pro Plan Gate upgrade message and stop
- Format and display results
- 验证配置文件中包含
~/.pandas和api_urlapi_key - 发起API调用
- 如果返回403,显示专业版升级提示并停止操作
- 格式化并展示结果
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
步骤
- Verify config has
~/.pandasandapi_urlapi_key - Make the API call
- If 403, show the Pro Plan Gate upgrade message and stop
- Format and display results
- 验证配置文件中包含
~/.pandas和api_urlapi_key - 发起API调用
- 如果返回403,显示专业版升级提示并停止操作
- 格式化并展示结果
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
步骤
- Verify config has
~/.pandasandapi_urlapi_key - Make the API call
- If 403, show the Pro Plan Gate upgrade message and stop
- Format and display results
- 验证配置文件中包含
~/.pandas和api_urlapi_key - 发起API调用
- 如果返回403,显示专业版升级提示并停止操作
- 格式化并展示结果
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:
- — number of days to look back (default varies by API)
?days=30
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
步骤
- Verify config has
~/.pandasandapi_urlapi_key - Make the API call
- If 403, show the Pro Plan Gate upgrade message and stop
- Format and display results
- 验证配置文件中包含
~/.pandas和api_urlapi_key - 发起API调用
- 如果返回403,显示专业版升级提示并停止操作
- 格式化并展示结果
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
步骤
- Verify config has
~/.pandasandapi_urlapi_key - Make the API call
- If 403, show the Pro Plan Gate upgrade message and stop
- Format and display results
- 验证配置文件中包含
~/.pandas和api_urlapi_key - 发起API调用
- 如果返回403,显示专业版升级提示并停止操作
- 格式化并展示结果
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:
- — filter to a specific post's timeline
?postId=ID
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
步骤
- Verify config has
~/.pandasandapi_urlapi_key - Make the API call
- If 403, show the Pro Plan Gate upgrade message and stop
- Format and display results
- 验证配置文件中包含
~/.pandas和api_urlapi_key - 发起API调用
- 如果返回403,显示专业版升级提示并停止操作
- 格式化并展示结果
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
错误处理
| Status | Meaning | Recovery |
|---|---|---|
| 401 | Invalid API key | Check |
| 403 | Pro plan required | Show the upgrade message (see Pro Plan Gate section) |
| 422 | Validation error | Show the specific error messages from the response body and help the user fix them |
| 500 | Server error | Try again later |
| 状态码 | 含义 | 解决方法 |
|---|---|---|
| 401 | API密钥无效 | 检查 |
| 403 | 需专业版权限 | 显示升级提示(参考专业版限制章节) |
| 422 | 验证错误 | 显示响应体中的具体错误信息,并帮助用户修正 |
| 500 | 服务器错误 | 稍后重试 |