scraping-instagram-users-by-keyword

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Scraping Instagram Users By Keyword

按关键词抓取Instagram用户

Raw data collection. No assumed use case — returns the full dataset for downstream analysis.

原始数据收集,不预设使用场景——返回完整数据集以供下游分析。

Inputs

输入参数

ParameterTypeRequiredDefaultNotes
keywords
arrayOptional
[]
Keywords to search for users
handles
arrayOptional
[]
Instagram usernames (without @)
startUrls
arrayOptional
[]
Instagram profile URLs
userIds
arrayOptional
[]
Instagram user IDs
getFollowers
booleanOptional
false
Extract follower lists for each profile
getFollowings
booleanOptional
false
Extract following lists for each profile
maxItems
numberOptionalUnlimitedMaximum users to return
customMapFunction
stringOptionalJavaScript function to transform each output object
参数类型是否必填默认值说明
keywords
数组可选
[]
用于搜索用户的关键词
handles
数组可选
[]
Instagram用户名(不含@)
startUrls
数组可选
[]
Instagram个人主页URL
userIds
数组可选
[]
Instagram用户ID
getFollowers
布尔值可选
false
提取每个账号的粉丝列表
getFollowings
布尔值可选
false
提取每个账号的关注列表
maxItems
数字可选无限制返回的最大用户数量
customMapFunction
字符串可选用于转换每个输出对象的JavaScript函数

How to Run

运行方式

Using run_actor.js (recommended)

使用run_actor.js(推荐)

bash
undefined
bash
undefined

Quick answer (table)

Quick answer (table)

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

Save as CSV

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
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

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
undefined
node scripts/run_actor.js --actor "apidojo~instagram-user-scraper" --input '{"handles": ["natgeo"], "getFollowers": false, "maxItems": 50}' --output results.json --format json
undefined

REST API fallback

备用REST API方式

bash
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}'
If Apify MCP is available: Use the Apify MCP
call_actor
tool with actor
apidojo~instagram-user-scraper
and the input above.

bash
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
并传入上述输入参数。

Output Fields

输出字段

FieldTypeDescription
id
stringInstagram user ID
username
string@username
fullName
stringDisplay name
biography
stringProfile bio text
externalUrl
stringLink in bio (website)
followerCount
numberFollower count
followingCount
numberFollowing count
postCount
numberTotal posts
isVerified
booleanVerification status
isBusinessAccount
booleanBusiness account flag
businessCategoryName
stringBusiness category
profilePicUrl
stringProfile picture URL
profilePicUrlHd
stringHigh-resolution profile picture URL
isPrivate
booleanPrivate account flag
publicEmail
stringPublic email (if available)
publicPhoneNumber
stringPublic phone (if available)
contactPhoneNumber
stringContact phone (if available)
字段类型说明
id
字符串Instagram用户ID
username
字符串@用户名
fullName
字符串显示名称
biography
字符串个人简介文本
externalUrl
字符串简介中的链接(网站)
followerCount
数字粉丝数量
followingCount
数字关注数量
postCount
数字帖子总数
isVerified
布尔值认证状态
isBusinessAccount
布尔值商业账号标识
businessCategoryName
字符串商业分类
profilePicUrl
字符串头像URL
profilePicUrlHd
字符串高清头像URL
isPrivate
布尔值私人账号标识
publicEmail
字符串公开邮箱(如有)
publicPhoneNumber
字符串公开电话(如有)
contactPhoneNumber
字符串联系电话(如有)

Edge Cases

边缘情况

  • Private account: Returns profile metadata but no followers/following.
  • No public email: publicEmail field absent — normal for personal accounts.
  • Large follower list: Set maxItems limit to avoid excessive cost.
  • Account not found: Returns empty result. Check handle spelling.
  • Keyword returns many: Use maxItems to cap results.
  • 私人账号:返回账号元数据,但无法获取粉丝/关注列表。
  • 无公开邮箱:publicEmail字段不存在——个人账号通常如此。
  • 粉丝列表庞大:设置maxItems限制以避免过高成本。
  • 账号未找到:返回空结果,请检查用户名拼写。
  • 关键词返回结果过多:使用maxItems限制结果数量。