SuperAPI AI 工具集

scraping-instagram-users-by-keyword

数据与分析

查看项目

更新于 10-15 12:09

技能介绍

用途

该技能用于从 Instagram 批量采集用户资料数据,属于原始数据收集类能力,不假设特定分析目的,返回完整数据集供下游处理。触发场景为:当用户要求按关键词查找 Instagram 用户,或需要提取用户资料、关注者、正在关注列表时使用。

主要能力

支持四种定位用户的方式:关键词(keywords)、Instagram 用户名(handles,不带 @)、个人主页 URL(startUrls)、用户 ID(userIds)。在取得用户资料的基础上,可选择开启关注者列表(getFollowers)和正在关注列表(getFollowings)的提取。此外提供 customMapFunction,允许传入 JavaScript 函数对每条输出对象进行转换。

输出字段包括:id、username、fullName、biography、externalUrl、followerCount、followingCount、postCount、isVerified、isBusinessAccount、businessCategoryName、profilePicUrl、profilePicUrlHd、isPrivate、publicEmail、publicPhoneNumber、contactPhoneNumber。

使用方式

推荐使用 run_actor.js 运行,可输出表格、CSV 或 JSON,例如:

node scripts/run_actor.js --actor "apidojo~instagram-user-scraper" --input '{"handles": ["natgeo"], "getFollowers": false, "maxItems": 50}'

保存为 CSV:

node scripts/run_actor.js --actor "apidojo~instagram-user-scraper" --input '{"handles": ["natgeo"], "getFollowers": false, "maxItems": 50}' --output results.csv --format csv

保存为 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,可使用其 call_actor 工具,actor 为 apidojo~instagram-user-scraper,并传入上述输入。

适用场景

适合需要批量获取 Instagram 用户公开资料、关注关系与基础统计信息的任务,例如用户画像整理、账号信息核对、关注者名单导出等。

限制与边界情况

私密账号会返回资料元数据,但不返回关注者与正在关注列表。没有公开邮箱时 publicEmail 字段会缺失,这在个人账号中属正常情况。关注者列表较大时,应设置 maxItems 上限以避免过高成本。账号未找到时返回空结果,需检查用户名拼写。关键词返回结果过多时,可用 maxItems 限制条数。关于计费方式与价格,资料中暂未提供。