instagram-scraper

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Instagram 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 wantsScraperPrice
Stories that are live now (they vanish after 24 hours)
intropix/instagram-stories-scraper
$2.50 per 1,000 stories
Posts, reels, carousels with captions, likes, comments, views, dates
intropix/instagram-posts-reels-scraper
$1.90 per 1,000 posts
Also music, shares, location, sponsor brand names, partner sizes, the account's public email, phone, address and website
intropix/instagram-posts-reels-scraper-pro
$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-stories
,
save-instagram-reels
,
save-instagram-posts
,
download-competitor-instagram
,
track-instagram-brand-deals
,
get-instagram-business-contacts
.
用户需求抓取器价格
当前正在发布的 Stories(24 小时后会消失)
intropix/instagram-stories-scraper
每 1,000 条 Stories $2.50
含文案、点赞数、评论数、观看次数和日期的帖子、Reels、轮播帖子
intropix/instagram-posts-reels-scraper
每 1,000 条帖子 $1.90
还需要音乐、分享次数、地点、赞助品牌名称、合作伙伴规模、账号公开邮箱、电话、地址和网站
intropix/instagram-posts-reels-scraper-pro
每 1,000 条帖子 $3.90
选择具备所需字段且费用最低的抓取器。每次运行另需 $0.005,每个扫描账号另需 $0.002;失败的查询不收费。
如果已安装以下某个 skill,且它更适合当前任务,则优先使用:
save-instagram-stories
、
save-instagram-reels
、
save-instagram-posts
、
download-competitor-instagram
、
track-instagram-brand-deals
、
get-instagram-business-contacts
。

2. Build the input

2. 构建输入

Stories:
json
{"usernames": ["natgeo"], "maxResults": 10}
maxResults
is the most story items to deliver (default 10).
Posts and reels (standard and PRO take the same input):
json
{"usernames": ["nike"], "maxPosts": 10}
FieldUse
usernames
Account handles without
@
.
postUrls
Instead of or besides usernames: links like
https://www.instagram.com/p/<code>/
or
/reel/<code>/
. Every valid link is delivered.
maxPosts
How many of the newest posts to read. Default 10. One shared total for the whole run.
maxPostsPerAccount
Instead of
maxPosts
: up to this many of EACH account's newest posts. Use it whenever there are several accounts.
sinceDate
,
untilDate
Optional
YYYY-MM-DD
(UTC) bounds.
mediaType
any
(default),
image
or
video
. With a filter,
maxPosts
counts posts read, not posts delivered, and every match among them is delivered and billed: for N reels set
maxPosts
to about 1.5 times N (2 for one reel), and save everything delivered.
includeOffGridReels
true
also returns reels shown only on the reels tab.
enrichPartners
PRO only:
true
adds follower count, category and verification for each co-author and sponsor brand ($0.005 per profile, paid Apify plans only).
For the public contact details of accounts, run PRO with
maxPostsPerAccount: 1
; the
owner_*
fields of each post carry them.
Several accounts: for posts, use
maxPostsPerAccount
;
maxPosts
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.
Ask 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
是最多交付的 Stories 条目数(默认 10)。
帖子和 Reels(标准版与 PRO 版使用相同输入):
json
{"usernames": ["nike"], "maxPosts": 10}
字段用途
usernames
不带
@
的账号 handle。
postUrls
可替代或同时使用
usernames
:链接,例如
https://www.instagram.com/p/<code>/
或
/reel/<code>/
。每个有效链接都会被返回。
maxPosts
要读取的最新帖子数量。默认 10。整个运行共用一个总数。
maxPostsPerAccount
替代
maxPosts
:每个账号最多读取其最新帖子中的指定数量。有多个账号时始终使用此字段。
sinceDate
、
untilDate
可选的
YYYY-MM-DD
(UTC)时间范围。
mediaType
any
(默认)、
image
或
video
。使用筛选器时,
maxPosts
统计的是读取的帖子数,而非交付的帖子数;其中每个匹配项都会交付并计费:要获取 N 个 Reels,可将
maxPosts
设为约为 N 的 1.5 倍(获取 1 个 Reels 时设为 2),并保存所有交付内容。
includeOffGridReels
true
还会返回仅出现在 Reels 标签页中的 Reels。
enrichPartners
仅限 PRO:设为
true
时,为每位协作帖共同作者和赞助品牌添加粉丝数、类别和认证状态(每个资料 $0.005,仅限付费 Apify 套餐)。
若要获取账号的公开联系方式,请使用 PRO 并设置
maxPostsPerAccount: 1
;每条帖子的
owner_*
字段会包含这些信息。
**多个账号:**对于帖子,使用
maxPostsPerAccount
;仅使用
maxPosts
时,它会按照输入顺序共用一个总配额,因此第一个账号就可能用完全部配额。付费套餐的一次运行最多保存 1,000 条帖子(免费套餐为 10 条),并按账号顺序填充。Stories 抓取器没有每账号限制:对于 Stories,每个账号启动一次运行。
如果用户未说明数量,则询问所需数量;否则使用 10。Apify 免费套餐每次运行最多返回 10 条结果,每天最多返回 40 条。

3. Run the scraper

3. 运行抓取器

Use the first path that is available.
A. Apify tools are connected (tools named
call-actor
and
get-dataset-items
, from the Apify connector or
https://mcp.apify.com
): call
call-actor
with the scraper id and the input. If the run is not finished when the call returns, poll
get-actor-run
until it is. Then read the results with
get-dataset-items
using the run's dataset id, and set
limit
to the run's item count (the default is 20). With a shell, write the returned items, as one JSON array, to
items.json
for step 4.
B. A shell with the Apify CLI (
apify --version
prints 1.5 or later): write the input to
input.json
, then run
bash
apify actors call <scraper id> --input-file input.json --json 2>/dev/null
Take
storage.defaultDatasetId
and
storage.defaultKeyValueStoreId
from the printed JSON (do not add
--silent
: together with
--json
it prints nothing). Then save the results:
bash
apify datasets get-items <defaultDatasetId> --format json > items.json
If the CLI says you are not logged in, ask the user to run
apify login
themselves (it opens a browser). Never ask the user to paste an API token into the conversation.
C. Neither is available: tell the user to either connect Apify (
https://mcp.apify.com
) or install the CLI (
npm install -g apify-cli
, then
apify login
). An Apify account is free to create. Stop there.
使用以下第一条可用路径。
A. 已接入 Apify 工具(工具名为
call-actor
和
get-dataset-items
,来自 Apify connector 或
https://mcp.apify.com
): 使用抓取器 id 和输入调用
call-actor
。如果调用返回时运行尚未完成,轮询
get-actor-run
,直至运行完成。然后使用该运行的 dataset id 调用
get-dataset-items
读取结果,并将
limit
设置为该运行的条目数(默认值为 20)。使用 shell 时,将返回的条目写入
items.json
,格式为一个 JSON 数组,以供步骤 4 使用。
B. 带 Apify CLI 的 shell(
apify --version
会输出 1.5 或更高版本): 将输入写入
input.json
,然后运行
bash
apify actors call <scraper id> --input-file input.json --json 2>/dev/null
从打印出的 JSON 中获取
storage.defaultDatasetId
和
storage.defaultKeyValueStoreId
(不要添加
--silent
:它与
--json
同时使用时不会输出任何内容)。然后保存结果:
bash
apify datasets get-items <defaultDatasetId> --format json > items.json
如果 CLI 提示你尚未登录,请让用户自行运行
apify login
(该命令会打开浏览器)。绝不要要求用户将 API token 粘贴到对话中。
**C. 两者均不可用:**告知用户可以接入 Apify(
https://mcp.apify.com
)或安装 CLI(
npm install -g apify-cli
,然后运行
apify login
)。Apify 账户可免费创建。到此停止。

4. 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
(
${CLAUDE_SKILL_DIR}
is this skill's folder; use its real path if the variable is not set.) This writes
instagram/<username>/<date>_<id>[_<slide>].jpg|mp4
, reel covers beside the videos, and appends each item once to
instagram/<username>/items.jsonl
, so repeated runs only add what is new.
Without Python, download each
media_url
(stories) or
media[].media_url
(posts) with
curl -L -o
. Without a shell, show the links and say they expire.
For a spreadsheet, write a CSV from
items.json
with the columns the user asked for.
如果用户只需要数据,请跳过此步骤。媒体链接指向 Instagram 的 CDN,会在数日内过期,因此运行后应立即下载。 使用 shell 和 Python 3:
bash
python3 ${CLAUDE_SKILL_DIR}/scripts/save_media.py items.json instagram --covers
(
${CLAUDE_SKILL_DIR}
是此 skill 的文件夹;如果未设置该变量,请使用其实际路径。)这会写入
instagram/<username>/<date>_<id>[_<slide>].jpg|mp4
,将 Reels 封面保存在视频旁边,并将每个条目仅追加一次到
instagram/<username>/items.jsonl
,因此重复运行只会新增内容。
没有 Python 时,使用
curl -L -o
下载每个
media_url
(Stories)或
media[].media_url
(帖子)。没有 shell 时,显示链接并说明它们会过期。
对于电子表格,请从
items.json
写入 CSV,并使用用户要求的列。

5. 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
OUTPUT
record (
apify key-value-stores get-value <defaultKeyValueStoreId> OUTPUT
, or
get-key-value-store-record
with key
OUTPUT
):
not_found
(wrong handle),
user_daily_exhausted
(free plan daily limit reached),
temporarily_unavailable
or
upstream_outage
(retry later).
Scraper pages:
说明保存了什么以及保存位置,然后根据数据回答用户的问题。Null 表示“不可用”,绝不能视为 0。
**结果少于预期或没有结果:**如果账号在过去 24 小时内未发布 Stories,Stories 会返回空结果。否则,读取该运行的
OUTPUT
记录(
apify key-value-stores get-value <defaultKeyValueStoreId> OUTPUT
,或使用
get-key-value-store-record
并将键设为
OUTPUT
):
not_found
(账号 handle 错误)、
user_daily_exhausted
(达到免费套餐每日上限)、
temporarily_unavailable
或
upstream_outage
(稍后重试)。
抓取器页面: