关于 scraping-instagram-users-by-keyword
通过 Apify 按关键词、用户名、个人资料 URL 或用户 ID 收集 Instagram 用户数据,供后续分析使用。还可选择抓取个人资料的关注者或关注列表。
主要功能
- 01按关键词或用户名查找用户
- 02支持资料 URL 和用户 ID
- 03提取个人资料信息与账号指标
- 04可选抓取关注者或关注列表
- 05设置结果上限并自定义映射
适用场景
- 01按主题建立 Instagram 用户列表
- 02整理账号资料及关注者规模
- 03收集指定账号的关注者或关注列表
MCP 相关
可使用 Apify MCP 的 call_actor 工具调用 apidojo~instagram-user-scraper。
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ apidojo-io/ apidojo-skills --skill scraping-instagram-users-by-keyword安装后在 Claude Code 中输入/scraping-instagram-users-by-keyword确认已加载。
详细介绍
按关键词抓取 Instagram 用户
原始数据收集。不假设具体用途——返回完整数据集,供下游分析使用。
输入
| 参数 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
keywords | array | 可选 | [] | 用于搜索用户的关键词 |
handles | array | 可选 | [] | Instagram 用户名(不带 @) |
startUrls | array | 可选 | [] | Instagram 个人资料 URL |
userIds | array | 可选 | [] | Instagram 用户 ID |
getFollowers | boolean | 可选 | false | 提取每个个人资料的粉丝列表 |
getFollowings | boolean | 可选 | false | 提取每个个人资料的关注列表 |
maxItems | number | 可选 | 不限 | 最多返回的用户数量 |
customMapFunction | string | 可选 | — | 用于转换每个输出对象的 JavaScript 函数 |
运行方法
使用 run_actor.js(推荐)
# Quick answer (table)
node scripts/run_actor.js --actor "apidojo~instagram-user-scraper" --input '{"handles": ["natgeo"], "getFollowers": false, "maxItems": 50}'
# Save as CSV
node scripts/run_actor.js --actor "apidojo~instagram-user-scraper" --input '{"handles": ["natgeo"], "getFollowers": false, "maxItems": 50}' --output results.csv --format csv
# Save as JSON
node scripts/run_actor.js --actor "apidojo~instagram-user-scraper" --input '{"handles": ["natgeo"], "getFollowers": false, "maxItems": 50}' --output results.json --format json
REST API 备用方法
curl -X POST "https://api.apify.com/v2/acts/apidojo~instagram-user-scraper/runs" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"handles": ["natgeo"], "getFollowers": false, "maxItems": 50}'
如果可以使用 Apify MCP:
使用 Apify MCP 的 call_actor 工具,指定 actor apidojo~instagram-user-scraper 和上述输入。
输出字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | Instagram 用户 ID |
username | string | @用户名 |
fullName | string | 显示名称 |
biography | string | 个人资料简介文本 |
externalUrl | string | 简介中的链接(网站) |
followerCount | number | 粉丝数 |
followingCount | number | 关注数 |
postCount | number | 帖子总数 |
isVerified | boolean | 认证状态 |
isBusinessAccount | boolean | 是否为商业账号 |
businessCategoryName | string | 商业类别 |
profilePicUrl | string | 个人资料图片 URL |
profilePicUrlHd | string | 高清个人资料图片 URL |
isPrivate | boolean | 是否为私密账号 |
publicEmail | string | 公开邮箱(如有) |
publicPhoneNumber | string | 公开电话(如有) |
contactPhoneNumber | string | 联系电话(如有) |
边界情况
- 私密账号:返回个人资料元数据,但不包含粉丝和关注列表。
- 没有公开邮箱:publicEmail 字段缺失,这是个人账号的正常情况。
- 粉丝列表过大:设置 maxItems 限制,以避免产生过高费用。
- 未找到账号:返回空结果。请检查用户名拼写。
- 关键词匹配结果过多:使用 maxItems 限制结果数量。
评论
支持 Markdown