详细分析 ▾
运行时依赖
版本
Octolens 1.0.0 – Initial Release - Query and analyze brand mentions from the Octolens API across platforms like Twitter, Reddit, GitHub, LinkedIn, and more. - Filter mentions by source, sentiment, follower count, engagement, date range, tags, and complex AND/OR logic. - Support for keyword tracking, bookmarks, and advanced filtering (including exclusions). - List available keywords and saved views for streamlined queries. - Includes ready-to-use Node.js scripts for common API operations and custom queries. - Requires user-supplied API key (Bearer token) for authentication.
安装命令 点击复制
技能文档
当...时 到 使用 skill
Use this skill when the user needs to:
- 获取 brand mentions 从 social media 和 其他 platforms
- 过滤 mentions 由 source (Twitter, Reddit, GitHub, LinkedIn, YouTube, HackerNews, DevTO, StackOverflow, Bluesky, newsletters, podcasts)
- Analyze sentiment (positive, neutral, negative)
- 过滤 由 author follower 计数 或 engagement
- 搜索 对于 specific keywords 或 tags
- 查询 mentions 由 日期 range
- 列表 可用 keywords 或 saved views
- Apply complex filtering logic 带有 和/或 conditions
API Authentication
The Octolens API requires a Bearer token for authentication. The user should provide their API key, which you'll use in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Important: Always ask 用户 对于 API 键 之前 making 任何 API calls. Store 在...中 变量 对于 subsequent requests.
Base URL
All API endpoints use the base URL: https://app.octolens.com/api/v1
Rate Limits
- Limit: 500 requests per hour
- Check headers:
X-RateLimit-headers indicate current usage
可用 Endpoints
1. POST /mentions
Fetch mentions matching keywords with optional filtering. Returns posts sorted by timestamp (newest first).
键 Parameters:
limit(数字, 1-100): Maximum results 到 return (默认: 20)cursor(字符串): 分页 cursor 从 上一个 响应includeAll(布尔值): Include low-relevance posts (默认: 假)视图(数字): 视图 ID 到 使用 对于 filteringfilters(对象): 过滤 criteria (see filtering section)
示例 响应:
{
"data": [
{
"id": "abc123",
"url": "https://twitter.com/user/status/123",
"body": "Just discovered @YourProduct - this is exactly what I needed!",
"source": "twitter",
"timestamp": "2024-01-15T10:30:00Z",
"author": "user123",
"authorName": "John Doe",
"authorFollowers": 5420,
"relevance": "relevant",
"sentiment": "positive",
"language": "en",
"tags": ["feature-request"],
"keywords": [{ "id": 1, "keyword": "YourProduct" }],
"bookmarked": false,
"engaged": false
}
],
"cursor": "eyJsYXN0SWQiOiAiYWJjMTIzIn0="
}
2. 获取 /keywords
List all keywords configured for the organization.
示例 响应:
{
"data": [
{
"id": 1,
"keyword": "YourProduct",
"platforms": ["twitter", "reddit", "github"],
"color": "#6366f1",
"paused": false,
"context": "Our main product name"
}
]
}
3. 获取 /views
List all saved views (pre-configured filters).
示例 响应:
{
"data": [
{
"id": 1,
"name": "High Priority",
"icon": "star",
"filters": {
"sentiment": ["positive", "negative"],
"source": ["twitter"]
},
"createdAt": "2024-01-01T00:00:00Z"
}
]
}
Filtering Mentions
The /mentions endpoint supports powerful filtering with two modes:
Simple Mode (Implicit 和)
Put fields directly in filters. All conditions are ANDed together.
{
"filters": {
"source": ["twitter", "linkedin"],
"sentiment": ["positive"],
"minXFollowers": 1000
}
}
→ source IN (twitter, linkedin) AND sentiment = positive AND followers ≥ 1000Exclusions
Prefix any array field with ! to exclude values:
{
"filters": {
"source": ["twitter"],
"!keyword": [5, 6]
}
}
→ source = twitter AND keyword NOT IN (5, 6)Advanced Mode (和/或 Groups)
Use operator and groups for complex logic:
{
"filters": {
"operator": "AND",
"groups": [
{
"operator": "OR",
"conditions": [
{ "source": ["twitter"] },
{ "source": ["linkedin"] }
]
},
{
"operator": "AND",
"conditions": [
{ "sentiment": ["positive"] },
{ "!tag": ["spam"] }
]
}
]
}
}
→ (source = twitter OR source = linkedin) AND (sentiment = positive AND tag ≠ spam)可用 过滤 Fields
| Field | Type | Description |
|---|---|---|
source | string[] | Platforms: twitter, reddit, github, linkedin, youtube, hackernews, devto, stackoverflow, bluesky, newsletter, podcast |
sentiment | string[] | Values: positive, neutral, negative |
keyword | string[] | Keyword IDs (get from /keywords endpoint) |
language | string[] | ISO 639-1 codes: en, es, fr, de, pt, it, nl, ja, ko, zh |
tag | string[] | Tag names |
bookmarked | boolean | Filter bookmarked (true) or non-bookmarked (false) posts |
engaged | boolean | Filter engaged (true) or non-engaged (false) posts |
minXFollowers | number | Minimum Twitter follower count |
maxXFollowers | number | Maximum Twitter follower count |
startDate | string | ISO 8601 format (e.g., "2024-01-15T00:00:00Z") |
endDate | string | ISO 8601 format |
使用 Bundled Scripts
This skill includes helper scripts for common operations. Use them to quickly interact with the API:
获取 Mentions
node scripts/fetch-mentions.js YOUR_API_KEY [limit] [includeAll]
列表 Keywords
node scripts/list-keywords.js YOUR_API_KEY
列表 Views
node scripts/list-views.js YOUR_API_KEY
Custom 过滤 查询
node scripts/query-mentions.js YOUR_API_KEY '{"source": ["twitter"], "sentiment": ["positive"]}' [limit]
Advanced 查询
node scripts/advanced-query.js YOUR_API_KEY [limit]
Best Practices
- Always ask 对于 API 键 之前 making requests
- 使用 views 当...时 possible 到 leverage pre-configured filters
- 开始 带有 simple filters 和 添加 complexity 作为 needed
- Check rate limits 在...中 响应 headers (
X-RateLimit-) - 使用 分页 带有 cursor 对于 large 结果 sets
- Dates 必须 ISO 8601 格式 (e.g., "2024-01-15T00:00:00Z")
- 获取 keyword IDs 从
/keywordsendpoint 之前 filtering 由 keyword - 使用 exclusions (!) 到 过滤 out unwanted content
- Combine includeAll=假 带有 relevance filtering 对于 quality results
Common 使用 Cases
查找 positive Twitter mentions 带有 high followers
{
"limit": 20,
"filters": {
"source": ["twitter"],
"sentiment": ["positive"],
"minXFollowers": 1000
}
}
Exclude spam 和 获取 Reddit + GitHub mentions
{
"limit": 50,
"filters": {
"source": ["reddit", "github"],
"!tag": ["spam", "irrelevant"]
}
}
Complex 查询: (Twitter 或 LinkedIn) 和 positive sentiment, 最后的 7 days
{
"limit": 30,
"filters": {
"operator": "AND",
"groups": [
{
"operator": "OR",
"conditions": [
{ "source": ["twitter"] },
{ "source": ["linkedin"] }
]
},
{
"operator": "AND",
"conditions": [
{ "sentiment": ["positive"] },
{ "startDate": "2024-01-20T00:00:00Z" }
]
}
]
}
}
错误 Handling
| Status | Error | Description |
|---|---|---|
| 401 | unauthorized | Missing or invalid API key |
| 403 | forbidden | Valid key but no permission |
| 404 | not_found | Resource (e.g., view ID) not found |
| 429 | rate_limit_exceeded | Too many requests |
| 400 | invalid_request | Malformed request body |
| 500 | internal_error | Server error, retry later |
Step-由-Step Workflow
When a user asks to query Octolens data:
- Ask 对于 API 键 如果 不 已经 provided
- Understand 请求: 什么 它们 looking 对于?
- Determine filters needed: Source, sentiment, 日期 range, etc.
- Check 如果 视图 applies: 列表 views 第一个 如果 用户 mentions saved filters
- Build 查询: 使用 simple mode 第一个, advanced mode 对于 complex logic
- Execute 请求: 使用 bundled 节点.js scripts 或 获取 API directly
- 解析 results: Extract 键 information (author, body, sentiment, source)
- Handle 分页: 如果 更多 results needed, 使用 cursor 从 响应
- Present findings: Summarize insights, highlight patterns
Examples
示例 1: Simple 查询
用户: "Show me positive mentions 从 Twitter 在...中 最后的 7 days"Action (使用 bundled script):
node scripts/query-mentions.js YOUR_API_KEY '{"source": ["twitter"], "sentiment": ["positive"], "startDate": "2024-01-20T00:00:00Z"}'
Alternative (使用 获取 API directly):
const response = await fetch('https://app.octolens.com/api/v1/mentions', {
method: 'POST',
headers: {
'Authorization': Bearer ${API_KEY},
'Content-Type': 'application/json',
},
body: JSON.stringify({
limit: 20,
filters: {
source: ['twitter'],
sentiment: ['positive'],
startDate: '2024-01-20T00:00:00Z',
},
}),
});
const data = await response.json();
示例 2: Advanced 查询
用户: "查找 mentions 从 Reddit 或 GitHub, exclude spam tag, 带有 positive 或 neutral sentiment"Action (使用 bundled script):
node scripts/query-mentions.js YOUR_API_KEY '{"operator": "AND", "groups": [{"operator": "OR", "conditions": [{"source": ["reddit"]}, {"source": ["github"]}]}, {"operator": "OR", "conditions": [{"sentiment": ["positive"]}, {"sentiment": ["neutral"]}]}, {"operator": "AND", "conditions": [{"!tag": ["spam"]}]}]}'
Alternative (使用 获取 API directly):
const response = await fetch('https://app.octolens.com/api/v1/mentions', {
method: 'POST',
headers: {
'Authorization': Bearer ${API_KEY},
'Content-Type': 'application/json',
},
body: JSON.stringify({
limit: 30,
filters: {
operator: 'AND',
groups: [
{
operator: 'OR',
conditions: [
{ source: ['reddit'] },
{ source: ['github'] },
],
},
{
operator: 'OR',
conditions: [
{ sentiment: ['positive'] },
{ sentiment: ['neutral'] },
],
},
{
operator: 'AND',
conditions: [
{ '!tag': ['spam'] },
],
},
],
},
}),
});
const data = await response.json();
示例 3: 获取 Keywords 第一个
用户: "Show mentions 对于 main product keyword"Actions:
- 第一个, 列表 keywords:
node scripts/list-keywords.js YOUR_API_KEY
- 然后 查询 mentions 带有 keyword ID:
node scripts/query-mentions.js YOUR_API_KEY '{"keyword": [1]}'
Tips 对于 Agents
- 使用 bundled scripts: 节点.js scripts handle JSON parsing automatically
- 缓存 keywords: 之后 fetching keywords once, remember them 对于 会话
- Explain filters: 当...时 使用 complex filters, explain logic 到 用户
- Show examples: 当...时 users unsure, show 示例 过滤 structures
- Paginate wisely: Ask 如果 用户 wants 更多 results 之前 fetching 下一个 page
- Summarize insights: Don't 只是 dump data, provide analysis (sentiment trends, top authors, platform distribution)
免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制