instagram-scraper
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseInstagram scraper
Instagram 抓取器
Runs the Intropix Instagram scrapers on Apify and saves what they return. One
skill for any Instagram job; it picks the right scraper, runs it, and saves
the files.
在 Apify 上运行 Intropix Instagram 抓取器并保存其返回的数据。一个 skill 可处理所有 Instagram 任务;它会选择合适的抓取器、运行抓取并保存文件。
Rules
规则
- Public business, creator and brand accounts only. If the user asks for a private person's account, say the scrapers' terms do not allow it and stop. Private accounts are never readable.
- Tagged accounts, mentions and partners in the results can be private people: do not scrape them in turn or build profiles of them.
- Keep the results only as long as the user's purpose needs them (the terms suggest at most 30 days), and do not republish them as a dataset.
- 仅限公开的商业、创作者和品牌账号。如果用户要求抓取私人用户的账号,请说明抓取器条款不允许这样做并停止。私人账号绝不可读取。
- 结果中被标记的账号、提及的账号和合作伙伴可能是私人用户:不要转而抓取他们,也不要为其建立资料档案。
- 只在满足用户目的所需的时间内保留结果(条款建议最多保留 30 天),且不得将结果重新发布为数据集。
1. Pick the scraper
1. 选择抓取器
| The user wants | Scraper | Price |
|---|---|---|
| Stories that are live now (they vanish after 24 hours) | | $2.50 per 1,000 stories |
| Posts, reels, carousels with captions, likes, comments, views, dates | | $1.90 per 1,000 posts |
| Also music, shares, location, sponsor brand names, partner sizes, the account's public email, phone, address and website | | $3.90 per 1,000 posts |
Use the cheapest scraper that has the fields the user needs. Every run also
costs $0.005, plus $0.002 per account scanned; failed lookups are not charged.
If one of these skills is installed and fits the job better, use it instead:
, , ,
, ,
.
save-instagram-storiessave-instagram-reelssave-instagram-postsdownload-competitor-instagramtrack-instagram-brand-dealsget-instagram-business-contacts| 用户需求 | 抓取器 | 价格 |
|---|---|---|
| 当前正在发布的 Stories(24 小时后会消失) | | 每 1,000 条 Stories $2.50 |
| 含文案、点赞数、评论数、观看次数和日期的帖子、Reels、轮播帖子 | | 每 1,000 条帖子 $1.90 |
| 还需要音乐、分享次数、地点、赞助品牌名称、合作伙伴规模、账号公开邮箱、电话、地址和网站 | | 每 1,000 条帖子 $3.90 |
选择具备所需字段且费用最低的抓取器。每次运行另需 $0.005,每个扫描账号另需 $0.002;失败的查询不收费。
如果已安装以下某个 skill,且它更适合当前任务,则优先使用:
、、、
、、
。
save-instagram-storiessave-instagram-reelssave-instagram-postsdownload-competitor-instagramtrack-instagram-brand-dealsget-instagram-business-contacts2. Build the input
2. 构建输入
Stories:
json
{"usernames": ["natgeo"], "maxResults": 10}maxResultsPosts and reels (standard and PRO take the same input):
json
{"usernames": ["nike"], "maxPosts": 10}| Field | Use |
|---|---|
| Account handles without |
| Instead of or besides usernames: links like |
| How many of the newest posts to read. Default 10. One shared total for the whole run. |
| Instead of |
| Optional |
| |
| |
| PRO only: |
For the public contact details of accounts, run PRO with
; the fields of each post carry them.
maxPostsPerAccount: 1owner_*Several accounts: for posts, use ; alone
is one shared total spent in input order, so the first account can use it
all. A run holds at most 1,000 posts on a paid plan (10 on the free plan),
filled account by account. The stories scraper has no per-account limit: for
stories, start one run per account.
maxPostsPerAccountmaxPostsAsk how many items if the user did not say; otherwise use 10. A free Apify
plan delivers at most 10 results per run and 40 per day.
Stories:
json
{"usernames": ["natgeo"], "maxResults": 10}maxResults帖子和 Reels(标准版与 PRO 版使用相同输入):
json
{"usernames": ["nike"], "maxPosts": 10}| 字段 | 用途 |
|---|---|
| 不带 |
| 可替代或同时使用 |
| 要读取的最新帖子数量。默认 10。整个运行共用一个总数。 |
| 替代 |
| 可选的 |
| |
| |
| 仅限 PRO:设为 |
若要获取账号的公开联系方式,请使用 PRO 并设置 ;每条帖子的 字段会包含这些信息。
maxPostsPerAccount: 1owner_***多个账号:**对于帖子,使用 ;仅使用 时,它会按照输入顺序共用一个总配额,因此第一个账号就可能用完全部配额。付费套餐的一次运行最多保存 1,000 条帖子(免费套餐为 10 条),并按账号顺序填充。Stories 抓取器没有每账号限制:对于 Stories,每个账号启动一次运行。
maxPostsPerAccountmaxPosts如果用户未说明数量,则询问所需数量;否则使用 10。Apify 免费套餐每次运行最多返回 10 条结果,每天最多返回 40 条。
3. Run the scraper
3. 运行抓取器
Use the first path that is available.
A. Apify tools are connected (tools named and
, from the Apify connector or ):
call with the scraper id and the input. If the run is not
finished when the call returns, poll until it is. Then read
the results with using the run's dataset id, and set
to the run's item count (the default is 20). With a shell, write the
returned items, as one JSON array, to for step 4.
call-actorget-dataset-itemshttps://mcp.apify.comcall-actorget-actor-runget-dataset-itemslimititems.jsonB. A shell with the Apify CLI ( prints 1.5 or later):
write the input to , then run
apify --versioninput.jsonbash
apify actors call <scraper id> --input-file input.json --json 2>/dev/nullTake and from the
printed JSON (do not add : together with it prints nothing).
Then save the results:
storage.defaultDatasetIdstorage.defaultKeyValueStoreId--silent--jsonbash
apify datasets get-items <defaultDatasetId> --format json > items.jsonIf the CLI says you are not logged in, ask the user to run
themselves (it opens a browser). Never ask the user to paste an API token into
the conversation.
apify loginC. Neither is available: tell the user to either connect Apify
() or install the CLI (, then
). An Apify account is free to create. Stop there.
https://mcp.apify.comnpm install -g apify-cliapify login使用以下第一条可用路径。
A. 已接入 Apify 工具(工具名为 和 ,来自 Apify connector 或 ):
使用抓取器 id 和输入调用 。如果调用返回时运行尚未完成,轮询 ,直至运行完成。然后使用该运行的 dataset id 调用 读取结果,并将 设置为该运行的条目数(默认值为 20)。使用 shell 时,将返回的条目写入 ,格式为一个 JSON 数组,以供步骤 4 使用。
call-actorget-dataset-itemshttps://mcp.apify.comcall-actorget-actor-runget-dataset-itemslimititems.jsonB. 带 Apify CLI 的 shell( 会输出 1.5 或更高版本):
将输入写入 ,然后运行
apify --versioninput.jsonbash
apify actors call <scraper id> --input-file input.json --json 2>/dev/null从打印出的 JSON 中获取 和 (不要添加 :它与 同时使用时不会输出任何内容)。然后保存结果:
storage.defaultDatasetIdstorage.defaultKeyValueStoreId--silent--jsonbash
apify datasets get-items <defaultDatasetId> --format json > items.json如果 CLI 提示你尚未登录,请让用户自行运行 (该命令会打开浏览器)。绝不要要求用户将 API token 粘贴到对话中。
apify login**C. 两者均不可用:**告知用户可以接入 Apify()或安装 CLI(,然后运行 )。Apify 账户可免费创建。到此停止。
https://mcp.apify.comnpm install -g apify-cliapify login4. Save the files
4. 保存文件
Skip this step when the user wants data only. Media links point at
Instagram's CDN and expire within days, so download right after the run.
With a shell and Python 3:
bash
python3 ${CLAUDE_SKILL_DIR}/scripts/save_media.py items.json instagram --covers( is this skill's folder; use its real path if the variable
is not set.) This writes ,
reel covers beside the videos, and appends each item once to
, so repeated runs only add what is new.
${CLAUDE_SKILL_DIR}instagram/<username>/<date>_<id>[_<slide>].jpg|mp4instagram/<username>/items.jsonlWithout Python, download each (stories) or
(posts) with . Without a shell, show the links and say they expire.
media_urlmedia[].media_urlcurl -L -oFor a spreadsheet, write a CSV from with the columns the user
asked for.
items.json如果用户只需要数据,请跳过此步骤。媒体链接指向 Instagram 的 CDN,会在数日内过期,因此运行后应立即下载。
使用 shell 和 Python 3:
bash
python3 ${CLAUDE_SKILL_DIR}/scripts/save_media.py items.json instagram --covers( 是此 skill 的文件夹;如果未设置该变量,请使用其实际路径。)这会写入 ,将 Reels 封面保存在视频旁边,并将每个条目仅追加一次到 ,因此重复运行只会新增内容。
${CLAUDE_SKILL_DIR}instagram/<username>/<date>_<id>[_<slide>].jpg|mp4instagram/<username>/items.jsonl没有 Python 时,使用 下载每个 (Stories)或 (帖子)。没有 shell 时,显示链接并说明它们会过期。
curl -L -omedia_urlmedia[].media_url对于电子表格,请从 写入 CSV,并使用用户要求的列。
items.json5. Report
5. 汇报
Say what was saved and where, then answer the user's question from the data.
Null means "not available", never zero.
Fewer results than expected or none: stories return nothing when the
account posted none in the last 24 hours. Otherwise read the run's
record (, or
with key ): (wrong handle),
(free plan daily limit reached),
or (retry later).
OUTPUTapify key-value-stores get-value <defaultKeyValueStoreId> OUTPUTget-key-value-store-recordOUTPUTnot_founduser_daily_exhaustedtemporarily_unavailableupstream_outageScraper pages:
说明保存了什么以及保存位置,然后根据数据回答用户的问题。Null 表示“不可用”,绝不能视为 0。
**结果少于预期或没有结果:**如果账号在过去 24 小时内未发布 Stories,Stories 会返回空结果。否则,读取该运行的 记录(,或使用 并将键设为 ):(账号 handle 错误)、(达到免费套餐每日上限)、 或 (稍后重试)。
OUTPUTapify key-value-stores get-value <defaultKeyValueStoreId> OUTPUTget-key-value-store-recordOUTPUTnot_founduser_daily_exhaustedtemporarily_unavailableupstream_outage抓取器页面: