scraping-instagram-profile-data
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseScraping Instagram Profile Data
抓取Instagram主页数据
Bulk profile export for any set of Instagram usernames. Returns account-level stats and optional recent post data.
批量导出任意Instagram用户名集合的主页数据。返回账号级统计数据及可选的近期帖子数据。
Prerequisites
前提条件
- environment variable set
APIFY_TOKEN - Optional: Apify MCP server installed
- 已设置环境变量
APIFY_TOKEN - 可选:已安装Apify MCP服务器
Inputs
输入参数
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| array | ✅ | | Instagram URLs — profiles, hashtags, locations, audio pages, reels |
| string | Optional | — | Scrape posts until this date (YYYY-MM-DD) |
| number | Optional | Unlimited | Maximum posts to return |
| string | Optional | — | JavaScript function to transform each output object |
| 参数 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
| 数组 | ✅ | | Instagram链接——主页、话题标签、地点、音频页面、短视频 |
| 字符串 | 可选 | — | 抓取帖子的截止日期(格式:YYYY-MM-DD) |
| 数字 | 可选 | 无限制 | 返回的最大帖子数量 |
| 字符串 | 可选 | — | 用于转换每个输出对象的JavaScript函数 |
Workflow
工作流程
Progress:
- [ ] Step 1: Normalize username list
- [ ] Step 2: Run instagram-scraper
- [ ] Step 3: Poll for SUCCEEDED
- [ ] Step 4: Deliver profile datasetProgress:
- [ ] Step 1: Normalize username list
- [ ] Step 2: Run instagram-scraper
- [ ] Step 3: Poll for SUCCEEDED
- [ ] Step 4: Deliver profile datasetStep 2: Run the Actor
步骤2:运行Actor
Recommended — run_actor.js (handles waiting, output, and file saving automatically):
bash
undefined推荐方式 — run_actor.js(自动处理等待、输出和文件保存):
bash
undefinedQuick answer (prints table to chat)
Quick answer (prints table to chat)
node scripts/run_actor.js
--actor "apidojo~instagram-scraper"
--input '{"param": "value"}'
--actor "apidojo~instagram-scraper"
--input '{"param": "value"}'
node scripts/run_actor.js
--actor "apidojo~instagram-scraper"
--input '{"param": "value"}'
--actor "apidojo~instagram-scraper"
--input '{"param": "value"}'
Save as CSV
Save as CSV
node scripts/run_actor.js
--actor "apidojo~instagram-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.csv --format csv
--actor "apidojo~instagram-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.csv --format csv
node scripts/run_actor.js
--actor "apidojo~instagram-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.csv --format csv
--actor "apidojo~instagram-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.csv --format csv
Save as JSON
Save as JSON
node scripts/run_actor.js
--actor "apidojo~instagram-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.json --format json
--actor "apidojo~instagram-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~instagram-scraper"
Input:
{
"usernames": ["handle1", "handle2"],
"includeRecentPosts": false
}
**REST API fallback:**
```bash
curl -X POST \
"https://api.apify.com/v2/acts/apidojo~instagram-scraper/runs?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"usernames": ["handle1", "handle2"]}'Save as . Poll until :
idRUN_IDstatus = SUCCEEDEDbash
curl "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_TOKEN" | grep '"status"'Fetch results:
bash
curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN&format=json"node scripts/run_actor.js
--actor "apidojo~instagram-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.json --format json
--actor "apidojo~instagram-scraper"
--input '{"param": "value"}'
--output YYYY-MM-DD_results.json --format json
> `APIFY_TOKEN`必须在环境变量或`.env`文件中设置。
**如果Apify MCP可用:**Tool: apify:run-actor
Actor: "apidojo~instagram-scraper"
Input:
{
"usernames": ["handle1", "handle2"],
"includeRecentPosts": false
}
**REST API备选方案:**
```bash
curl -X POST \
"https://api.apify.com/v2/acts/apidojo~instagram-scraper/runs?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"usernames": ["handle1", "handle2"]}'保存为,轮询直到:
idRUN_IDstatus = SUCCEEDEDbash
curl "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_TOKEN" | grep '"status"'获取结果:
bash
curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN&format=json"Step 3: Handle Edge Cases
步骤3:处理边缘情况
- Private accounts: Returns profile stats but no posts — flag .
isPrivate: true - Account not found: Handle may be renamed or deactivated — note in output.
- Business vs personal accounts: Business accounts expose contact info; personal accounts do not.
- 私有账号:返回主页统计数据但无帖子——标记。
isPrivate: true - 账号未找到:账号可能已更名或停用——在输出中注明。
- 商业账号vs个人账号:商业账号会显示联系信息;个人账号则不会。
Output Format
输出格式
undefinedundefinedInstagram Profile Dataset
Instagram Profile Dataset
Accounts requested: N | Returned: N | Private: N | Not found: N
| Username | Followers | Following | Posts | Bio (truncated) | Business | Verified |
|---|---|---|---|---|---|---|
| ... | ... | ... | ... | ... | ... | ... |
Available fields: username, fullName, followersCount, followingCount, postsCount,
biography, isVerified, isBusinessAccount, businessCategory, externalUrl, profilePicUrl
undefinedAccounts requested: N | Returned: N | Private: N | Not found: N
| Username | Followers | Following | Posts | Bio (truncated) | Business | Verified |
|---|---|---|---|---|---|---|
| ... | ... | ... | ... | ... | ... | ... |
Available fields: username, fullName, followersCount, followingCount, postsCount,
biography, isVerified, isBusinessAccount, businessCategory, externalUrl, profilePicUrl
undefinedTroubleshooting
故障排除
Missing accounts: Username changed or account deactivated since list was compiled.
No engagement data: Engagement is per-post; use for post-level data.
includeRecentPosts: true账号缺失:列表编译后用户名已更改或账号已停用。
无互动数据:互动数据是基于单条帖子的;如需帖子级数据,请设置。
includeRecentPosts: true