应用评论工具
一个Python工具,用于从谷歌应用商店(Android)和应用商店(iOS)获取应用评论。可作为CLI工具和MCP(模型上下文协议)服务器用于AI集成。
特性
- 从Google Play商店和app Store按应用ID获取评论
- 多种过滤选项(评级、日期、语言、国家、开发人员响应状态)
- JSON输出格式
- 双接口:CLI和MCP服务器
- 评论数量没有上限
安装
来自PyPI(即将推出)
pip install reviews-tool来源
git clone https://github.com/alvaromurillo/reviews-tool.git
cd reviews-tool
pip install -r requirements.txt
pip install -e .开发设置
要设置开发环境,您需要创建一个虚拟环境并安装所需的依赖项。
- 创建并激活虚拟环境:
python3 -m venv venv
source venv/bin/activate- 安装依赖项:
pip install -r requirements.txt现在,您可以在此激活的环境中运行该工具和测试。
运行测试
要运行测试套件,请确保已激活虚拟环境并运行:
pytest用法
CLI接口
# Basic usage
reviews-tool search com.whatsapp --store android
# With filters
reviews-tool search com.whatsapp --store android --limit 50 --min-rating 4
reviews-tool search com.instagram.android --store android --since 2024-01-01 --language es
reviews-tool search 310633997 --store ios --developer-response no --country US
# Output to file
reviews-tool search com.example.app --store android --output reviews.jsonMCP服务器
启动MCP服务器以集成AI工具:
reviews-tool serve --port 8000命令行选项
必需参数
app_id:应用ID(例如。,com.whatsapp对于Android,310633997适用于iOS)--store {android,ios}:目标商店(必填)
可选过滤器
--limit N:要获取的评论数(默认值:20,没有最大值)--min-rating {1,2,3,4,5}:最小额定值过滤器--max-rating {1,2,3,4,5}:最大额定值过滤器--since YYYY-MM-DD:自即日起的评论--until YYYY-MM-DD:评论到此日期--language CODE:语言代码(例如,es、en、fr)--country CODE:国家代码(例如,欧洲、美国、法国)--developer-response {any,yes,no}:按开发人员响应状态筛选
- any:所有评论(默认) - yes:仅评论开发者响应 - no:仅评论,无开发者回应
--output FILE:将输出保存到JSON文件
输出格式
该工具返回一个具有以下结构的JSON对象:
Android示例
{
"app_id": "com.whatsapp",
"app_name": "WhatsApp Messenger",
"store": "android",
"total_reviews": 6,
"reviews_fetched": 2,
"next_page_token": "",
"filters_applied": {},
"timestamp": "2025-08-01T19:19:24.147005",
"reviews": [
{
"id": "aa21be45-8c87-4794-ad84-1a4da3155e1f",
"user_name": "Theodora Moyo",
"rating": 5,
"title": null,
"text": "Very good app. keep me connected with my friend and family...",
"date": "2025-07-31T19:09:10",
"helpful_count": 0,
"language": null,
"country": null,
"version": "2.25.11.75",
"developer_response": null
}
]
}iOS示例
{
"app_id": "310633997",
"app_name": "WhatsApp Messenger",
"store": "ios",
"total_reviews": 50,
"reviews_fetched": 2,
"next_page_token": "3",
"filters_applied": {},
"timestamp": "2025-08-01T19:19:30.930237",
"reviews": [
{
"id": "ios_137760121362959920_1754068770",
"user_name": "Laweezy reviews",
"rating": 5,
"title": "Excellent",
"text": "I love the great job from your company at the moment please keep it up",
"date": "2025-08-01T19:19:30.921529",
"helpful_count": null,
"language": null,
"country": "US",
"version": "25.21.3",
"developer_response": null
}
]
}用例
- 情感分析:分析用户情绪和满意度
- 竞争监控:跟踪竞争对手的应用程序评论和评级
- 营销内容:查找登录页面和营销材料的正面评价
- 客户支持:识别人工智能生成的回复中未答复的评论
- 产品改进:提取功能开发的反馈
项目结构
reviews-tool/
├── src/
│ ├── reviews_tool/
│ │ ├── __init__.py
│ │ ├── cli.py # CLI interface
│ │ ├── mcp_server.py # MCP server implementation
│ │ ├── scrapers/
│ │ │ ├── __init__.py
│ │ │ ├── android.py # Google Play Store scraper
│ │ │ └── ios.py # App Store scraper
│ │ ├── models.py # Data models
│ │ └── utils.py # Common utilities
├── tests/
├── requirements.txt
├── setup.py
├── CLAUDE.md # AI assistant guidance
└── README.md发展
需求
- Python 3.8+
- 中列出的依赖关系
requirements.txt
常用命令
# Install dependencies
pip install -r requirements.txt
# Run tests
pytest
# Run linting
flake8 src/
black src/
# Type checking
mypy src/
# Install in development mode
pip install -e .应用程序ID示例
安卓(谷歌应用商店)
- WhatsApp
com.whatsapp - Instagram:
com.instagram.android - Spotify:
com.spotify.music
iOS(应用商店)
- WhatsApp
310633997 - Instagram:
389801252 - Spotify:
324684580
API费率限制
请注意商店的价格限制:
- Google Play商店:推荐约100个请求/小时
- App Store:推荐约50个请求/小时
该工具包括自动速率限制和重试机制。
许可证
MIT许可证
贡献
- 分叉存储库
- 创建要素分支
- 进行更改
- 添加测试
- 运行linting和测试
- 提交拉取请求#trigger-ci
