monitoring-brand-mentions-on-twitter
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMonitoring Brand Mentions on Twitter
监控Twitter上的品牌提及内容
Collects all public tweets mentioning a brand, product, or keyword on Twitter/X within a date range. Groups by sentiment, surfaces top complaints and praise, and provides engagement totals.
收集指定日期范围内Twitter/X上所有提及品牌、产品或关键词的公开推文。按舆情分类,展示最受关注的投诉与好评,并提供总互动数据。
Prerequisites
前置条件
- environment variable set
APIFY_TOKEN - Optional: Apify MCP server installed
- 已设置环境变量
APIFY_TOKEN - 可选:已安装Apify MCP服务器
Inputs
输入参数
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| array | ✅ | | Twitter advanced search queries (e.g. |
| string | Optional | | Sort order: |
| string | Optional | — | ISO 639-1 language code (e.g. |
| number | Optional | Unlimited | Maximum tweets to return |
| boolean | Optional | | Only tweets from verified users |
| boolean | Optional | | Only Twitter Blue subscribers |
| boolean | Optional | | Only tweets with images |
| boolean | Optional | | Only tweets with videos |
| boolean | Optional | | Only quote tweets |
| string | Optional | — | Filter to a specific author handle |
| string | Optional | — | Tweets replying to a specific handle |
| string | Optional | — | Tweets mentioning a specific handle |
| string | Optional | — | Tweets near a location |
| string | Optional | — | Radius around geotaggedNear |
| string | Optional | — | Lat/lng + radius string |
| string | Optional | — | Tweets tagged with a place |
| number | Optional | — | Minimum retweet count |
| number | Optional | — | Minimum like count |
| number | Optional | — | Minimum reply count |
| string | Optional | — | Tweets after this date (YYYY-MM-DD) |
| string | Optional | — | Tweets before this date (YYYY-MM-DD) |
| boolean | Optional | | Add the matched search term to each tweet |
| string | Optional | — | JavaScript function to transform each output object |
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| array | ✅ | | Twitter高级搜索查询语句(例如 |
| string | Optional | | 排序方式: |
| string | Optional | — | ISO 639-1语言代码(例如 |
| number | Optional | Unlimited | 最多返回的推文数量 |
| boolean | Optional | | 仅保留已验证用户的推文 |
| boolean | Optional | | 仅保留Twitter Blue订阅用户的推文 |
| boolean | Optional | | 仅保留含图片的推文 |
| boolean | Optional | | 仅保留含视频的推文 |
| boolean | Optional | | 仅保留引用推文 |
| string | Optional | — | 筛选特定作者的推文(账号名) |
| string | Optional | — | 筛选回复特定账号的推文 |
| string | Optional | — | 筛选提及特定账号的推文 |
| string | Optional | — | 筛选指定地点附近的推文 |
| string | Optional | — | |
| string | Optional | — | 经纬度+半径字符串 |
| string | Optional | — | 筛选标记特定地点的推文 |
| number | Optional | — | 最小转发量 |
| number | Optional | — | 最小点赞量 |
| number | Optional | — | 最小回复量 |
| string | Optional | — | 此日期之后的推文(格式:YYYY-MM-DD) |
| string | Optional | — | 此日期之前的推文(格式:YYYY-MM-DD) |
| boolean | Optional | | 为每条推文添加匹配的搜索关键词 |
| string | Optional | — | 用于转换每个输出对象的JavaScript函数 |
Workflow
工作流程
Progress:
- [ ] Step 1: Define brand terms and date range
- [ ] Step 2: Run tweet-scraper
- [ ] Step 3: Retrieve dataset
- [ ] Step 4: Classify sentiment (positive/negative/neutral)
- [ ] Step 5: Deliver structured reportProgress:
- [ ] Step 1: Define brand terms and date range
- [ ] Step 2: Run tweet-scraper
- [ ] Step 3: Retrieve dataset
- [ ] Step 4: Classify sentiment (positive/negative/neutral)
- [ ] Step 5: Deliver structured reportStep 1: Clarify Parameters
步骤1:确认参数
Ask the user for:
- Brand terms — brand name, handle, product name, hashtag, and common misspellings. Build a list.
Example:
["@Nike", "Nike", "#Nike", "Nike shoes"] - Date range — e.g., "last 7 days" or specific dates
- Exclude retweets? (default: yes — filters noise)
- Min engagement (optional — e.g., tweets with ≥10 likes only)
- Language (default: all)
向用户确认以下信息:
- 品牌关键词 — 品牌名称、账号名、产品名称、话题标签及常见拼写错误,整理成列表。
示例:
["@Nike", "Nike", "#Nike", "Nike shoes"] - 日期范围 — 例如“过去7天”或具体日期
- 是否排除转发?(默认:是 — 过滤无效信息)
- 最低互动量(可选 — 例如仅保留点赞≥10的推文)
- 语言(默认:所有语言)
Step 2: Run tweet-scraper
步骤2:运行tweet-scraper
Run once per major search term to maximize coverage. Combine results after.
Recommended — run_actor.js (handles waiting, output, and file saving automatically):
bash
undefined针对每个主要搜索关键词分别运行,以扩大覆盖范围。之后合并结果。
推荐方式 — run_actor.js(自动处理等待、输出和文件保存):
bash
undefinedQuick answer (prints table to chat)
快速输出(在聊天窗口打印表格)
node scripts/run_actor.js
--actor "apidojo~tweet-scraper"
--input '{"param": "value"}'
--actor "apidojo~tweet-scraper"
--input '{"param": "value"}'
node scripts/run_actor.js
--actor "apidojo~tweet-scraper"
--input '{"param": "value"}'
--actor "apidojo~tweet-scraper"
--input '{"param": "value"}'
Save as CSV
保存为CSV
node scripts/run_actor.js
--actor "apidojo~tweet-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.csv --format csv
--actor "apidojo~tweet-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.csv --format csv
node scripts/run_actor.js
--actor "apidojo~tweet-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.csv --format csv
--actor "apidojo~tweet-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.csv --format csv
Save as JSON
保存为JSON
node scripts/run_actor.js
--actor "apidojo~tweet-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.json --format json
--actor "apidojo~tweet-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.json --format json
> `APIFY_TOKEN` must be set in environment or `.env` file.
**If Apify MCP is available:**Tool: apify:run-actor
Actor: "apidojo~tweet-scraper"
Input:
{
"searchTerms": ["[BRAND_TERM]"],
"maxItems": 500,
"includeReplies": true,
"tweetLanguage": "en",
"since": "[YYYY-MM-DD]",
"until": "[YYYY-MM-DD]"
}
**If Apify MCP is not available:**
```bash
curl -X POST \
"https://api.apify.com/v2/acts/apidojo~tweet-scraper/runs?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"searchTerms": ["[BRAND_TERM]"],
"maxItems": 500,
"includeReplies": true,
"since": "[YYYY-MM-DD]",
"until": "[YYYY-MM-DD]"
}'Run for each brand term in the list. Wait for , collect all results.
SUCCEEDEDnode scripts/run_actor.js
--actor "apidojo~tweet-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.json --format json
--actor "apidojo~tweet-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.json --format json
> 需在环境变量或`.env`文件中设置`APIFY_TOKEN`。
**若Apify MCP可用:**Tool: apify:run-actor
Actor: "apidojo~tweet-scraper"
Input:
{
"searchTerms": ["[BRAND_TERM]"],
"maxItems": 500,
"includeReplies": true,
"tweetLanguage": "en",
"since": "[YYYY-MM-DD]",
"until": "[YYYY-MM-DD]"
}
**若Apify MCP不可用:**
```bash
curl -X POST \
"https://api.apify.com/v2/acts/apidojo~tweet-scraper/runs?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"searchTerms": ["[BRAND_TERM]"],
"maxItems": 500,
"includeReplies": true,
"since": "[YYYY-MM-DD]",
"until": "[YYYY-MM-DD]"
}'针对列表中的每个品牌关键词运行。等待任务状态变为后,收集所有结果。
SUCCEEDEDStep 3: Fetch and Merge Results
步骤3:获取并合并结果
bash
curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN"Merge datasets from all runs. Deduplicate by tweet . Result: unified list of all mentions.
idbash
curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN"合并所有任务运行的数据集,按推文去重。最终得到统一的品牌提及列表。
idStep 4: Classify Sentiment
步骤4:舆情分类
For each tweet's field, apply a simple classification pass:
textPositive signals: words like "love", "great", "amazing", "best", "recommend", "thank", "perfect"
Negative signals: words like "hate", "awful", "broken", "scam", "worst", "never again", "disappointed", "avoid"
Neutral: everything else (announcements, news, questions)
Group tweets into three buckets: Positive, Negative, Neutral.
Identify top 5 most-engaged negative tweets (these need the fastest response).
Identify top 5 most-engaged positive tweets (retweet candidates / testimonial material).
针对每条推文的字段,执行简单分类:
text正面信号: 包含“love”、“great”、“amazing”、“best”、“recommend”、“thank”、“perfect”等词汇
负面信号: 包含“hate”、“awful”、“broken”、“scam”、“worst”、“never again”、“disappointed”、“avoid”等词汇
中性: 其他内容(公告、新闻、问题等)
将推文分为三类:正面、负面、中性。
找出互动量最高的5条负面推文(这些需要最快响应)。
找出互动量最高的5条正面推文(可作为转发素材或客户证言)。
Step 5: Format Report
步骤5:生成报告
Use the output template below.
使用以下输出模板。
Output Format
输出格式
undefinedundefinedBrand Mention Report: [BRAND]
Brand Mention Report: [BRAND]
Period: [START_DATE] – [END_DATE] | Total mentions: [N] | Analyzed: [DATE]
Period: [START_DATE] – [END_DATE] | Total mentions: [N] | Analyzed: [DATE]
Sentiment Summary
Sentiment Summary
| Sentiment | Count | % of Total | Avg Engagement |
|---|---|---|---|
| Positive | [N] | [X%] | [likes+RT avg] |
| Negative | [N] | [X%] | [likes+RT avg] |
| Neutral | [N] | [X%] | [likes+RT avg] |
| Sentiment | Count | % of Total | Avg Engagement |
|---|---|---|---|
| Positive | [N] | [X%] | [likes+RT avg] |
| Negative | [N] | [X%] | [likes+RT avg] |
| Neutral | [N] | [X%] | [likes+RT avg] |
🔴 Top Negative Mentions (Action Required)
🔴 Top Negative Mentions (Action Required)
- @[handle] ([likes] likes): "[tweet text excerpt]" → [url]
- @[handle] ([likes] likes): "[tweet text excerpt]" → [url]
- @[handle] ([likes] likes): "[tweet text excerpt]" → [url]
- @[handle] ([likes] likes): "[tweet text excerpt]" → [url]
- @[handle] ([likes] likes): "[tweet text excerpt]" → [url]
- @[handle] ([likes] likes): "[tweet text excerpt]" → [url]
🟢 Top Positive Mentions (Amplify These)
🟢 Top Positive Mentions (Amplify These)
- @[handle] ([likes] likes): "[tweet text excerpt]" → [url]
- @[handle] ([likes] likes): "[tweet text excerpt]" → [url]
- @[handle] ([likes] likes): "[tweet text excerpt]" → [url]
- @[handle] ([likes] likes): "[tweet text excerpt]" → [url]
- @[handle] ([likes] likes): "[tweet text excerpt]" → [url]
- @[handle] ([likes] likes): "[tweet text excerpt]" → [url]
Volume Over Time
Volume Over Time
[Day 1]: [N] mentions | [Day 2]: [N] mentions | [Day 3]: [N] mentions...
[Day 1]: [N] mentions | [Day 2]: [N] mentions | [Day 3]: [N] mentions...
Key Themes in Negative Mentions
Key Themes in Negative Mentions
- [Theme 1]: [N] tweets (e.g., "shipping delays")
- [Theme 2]: [N] tweets (e.g., "customer service")
- [Theme 1]: [N] tweets (e.g., "shipping delays")
- [Theme 2]: [N] tweets (e.g., "customer service")
Key Themes in Positive Mentions
Key Themes in Positive Mentions
- [Theme 1]: [N] tweets
- [Theme 2]: [N] tweets
undefined- [Theme 1]: [N] tweets
- [Theme 2]: [N] tweets
undefinedTroubleshooting
故障排除
Too many results for popular brands: Increase filter to 5 or 10 to focus on influential mentions.
Missing mentions: Twitter search API has ~7-10 day lookback limit for free tier. For historical data, reduce date range.
Sentiment misclassification: Sarcasm is hard to catch with keyword matching — flag high-engagement tweets for manual review.
minLikes热门品牌结果过多: 将筛选条件提高至5或10,聚焦有影响力的提及内容。
遗漏提及内容: Twitter搜索API免费版的回溯期约为7-10天。如需历史数据,请缩小日期范围。
舆情分类错误: 基于关键词匹配难以识别讽刺内容 — 标记高互动量推文进行人工审核。
minLikes