Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBright Data - Instagram
Bright Data - Instagram
Four datasets: profiles, posts, reels, comments. Three routes into them. Pick by
what the user has and wants. The SDK lines were verified on 2026-09-11 against
2.5.2; the CLI and MCP lines follow 0.4.1 and
4.1.0.
brightdata-sdk@brightdata/cli@brightdata/mcp| Dataset | dataset_id | Methods |
|---|---|---|
| Profiles | | |
| Posts | | |
| Reels | | |
| Comments | | |
四个数据集:个人资料、帖子、Reels、评论。共有三条调用路径。根据用户拥有的信息和需求进行选择。SDK 相关命令已于 2026-09-11 基于 2.5.2 验证;CLI 和 MCP 相关命令遵循 0.4.1 和 4.1.0。
brightdata-sdk@brightdata/cli@brightdata/mcp| 数据集 | dataset_id | 方法 |
|---|---|---|
| 个人资料 | | |
| 帖子 | | |
| Reels | | |
| 评论 | | |
Pick your route
选择调用路径
| You have | You want | Route |
|---|---|---|
| a profile URL | the account's recent posts | CLI |
| a profile URL | the account's recent reels | CLI |
| a profile URL | the profile | CLI |
| a username, no URL | the profile | CLI |
| a post URL | that post | CLI |
| a reel URL | that reel | CLI |
| a post or reel URL | its comments | CLI |
| no terminal (hosted assistant) | any of the above | MCP |
Every route is an asynchronous job on the API: trigger, poll, return. Expect
one to three minutes per call. One credit per record; 5,000 credits are free
each month. Always pass on a discovery call: without it the
number of posts collected, and billed, has no limit.
num_of_posts| 你拥有 | 你需要 | 路径 |
|---|---|---|
| 个人资料 URL | 账号最近的帖子 | CLI |
| 个人资料 URL | 账号最近的 Reels | CLI |
| 个人资料 URL | 个人资料 | CLI |
| 用户名,没有 URL | 个人资料 | CLI |
| 帖子 URL | 该帖子 | CLI |
| Reel URL | 该 Reel | CLI |
| 帖子或 Reel URL | 其评论 | CLI |
| 没有终端(托管助手) | 以上任意一项 | MCP |
所有路径在 API 上都是异步任务:触发、轮询、返回。每次调用预计需要 1 至 3 分钟。每条记录消耗 1 个积分;每月免费提供 5,000 个积分。发现类调用务必传入 :如果不传,采集和计费的帖子数量将不受限制。
num_of_postsSetup gate (run first)
身份验证前置检查(首先运行)
Run .
Exit means ready. Any other exit, a missing CLI, or a missing login is the
skill's job. These datasets need no zone, only the key.
node <agent-onboarding skill folder>/scripts/check-auth.mjs --for instagram0agent-onboardingFor the SDK route: . The SDK reads the token from
or , then from a file found by searching upward from
its own install folder, then from the CLI's stored login. After
nothing else is needed.
pip install brightdata-sdkBRIGHTDATA_API_TOKENBRIGHTDATA_API_KEY.envbdata login运行 。
退出码为 表示已就绪。任何其他退出码、CLI 缺失或未登录,都属于 skill 的处理范围。这些数据集不需要 zone,只需要 API key。
node <agent-onboarding skill folder>/scripts/check-auth.mjs --for instagram0agent-onboarding对于 SDK 路径:执行 。SDK 会先从 或 读取 token,然后从其自身安装目录向上搜索并找到的 文件中读取,最后从 CLI 保存的登录信息中读取。执行 后,无需再进行其他操作。
pip install brightdata-sdkBRIGHTDATA_API_TOKENBRIGHTDATA_API_KEY.envbdata loginCLI: run a dataset by id
CLI:通过 ID 运行数据集
bash
bdata pipelines run gd_l1vikfch901nx3by4 collect_by_url "https://www.instagram.com/nasa/" --pretty
bdata pipelines run gd_lk5ns7kz21pck8jpis collect_by_url "https://www.instagram.com/p/Dc1W1uFj-CW/" --format csv -o posts.csv
bdata pipelines run gd_lyclm20il4r5helnj collect_by_url "https://www.instagram.com/reel/DcMXl1IPNtB/" --pretty
bdata pipelines run gd_ltppn085pokosxh13 collect_by_url "https://www.instagram.com/p/Dc1W1uFj-CW/" --pretty
bdata pipelines run gd_lk5ns7kz21pck8jpis discover_by_url "https://www.instagram.com/nasa/" --num_of_posts 5 --prettybdata pipelines info <dataset_id> <method>--<field> <value>--format json|csv|ndjson|jsonl-o FILE--timeout SECONDSbash
bdata pipelines run gd_l1vikfch901nx3by4 collect_by_url "https://www.instagram.com/nasa/" --pretty
bdata pipelines run gd_lk5ns7kz21pck8jpis collect_by_url "https://www.instagram.com/p/Dc1W1uFj-CW/" --format csv -o posts.csv
bdata pipelines run gd_lyclm20il4r5helnj collect_by_url "https://www.instagram.com/reel/DcMXl1IPNtB/" --pretty
bdata pipelines run gd_ltppn085pokosxh13 collect_by_url "https://www.instagram.com/p/Dc1W1uFj-CW/" --pretty
bdata pipelines run gd_lk5ns7kz21pck8jpis discover_by_url "https://www.instagram.com/nasa/" --num_of_posts 5 --prettybdata pipelines info <dataset_id> <method>--<field> <value>--format json|csv|ndjson|jsonl-o FILE--timeout SECONDSSDK: recent posts of an account
SDK:账号最近的帖子
python
from brightdata import SyncBrightDataClient
with SyncBrightDataClient(auto_create_zones=False) as client:
result = client.search.instagram.posts("https://www.instagram.com/nasa/", num_of_posts=5)
for post in result.data:
print(post["likes"], post["num_comments"], post["url"])Rules that are not in the SDK docstrings:
- Always pass . Left on, the client tries to create Web Unlocker and SERP zones on entry, which Instagram never uses and which fails with a 403 on accounts without a payment method (sdk-python#57).
auto_create_zones=False - Many URLs in one call is one job. Pass a list rather than looping.
- Shapes: calls always return a list in
search.*.result.datacalls with one URL return one record as a dict, several as a list.scrape.* - Date window: , format
start_date="08-01-2026", end_date="09-07-2026".MM-DD-YYYYkeeps posts only,post_type="Post"keeps reels only. The docstring'spost_type="Reels"returns an error row and no reels (sdk-python#59)."Reel" - Reels discovery needs . The 180-second default expires.
timeout=420 - An empty window is a success with zero records: it arrives as a row whose
contains
error. Match the message; a dead account uses the sameThere are no public posts in the profile for the specified period.error_code - A dead account is a row with an key and varying text, for example
errororSorry, this page isn't available.. The other rows in the same result are fine.Crawler error: Cannot read properties of null - A timeout is with
result.success == False.result.status == "timeout" - Collaborative posts carry the co-author's handle in , so a post fetched from
user_postedcan saynasa.nasajohnsonlists everyone.coauthor_producers - costs one credit per reel the account has ever posted. Check
reels_all(url)on the profile first. Comments cost one per comment; checkposts_counton the post first.num_comments - Never hardcode a field list. The schema changes without notice. Read it
with , a dict keyed by field name. A post carries 34 to 36 of the 44 fields.
client.datasets.instagram_posts.get_metadata().fields - Big runs: ,
posts_trigger,posts_status. Keep the snapshot id; snapshots stay downloadable for 30 days.posts_fetch
The other seven SDK calls, each with a complete snippet, are in
.
references/sdk.mdpython
from brightdata import SyncBrightDataClient
with SyncBrightDataClient(auto_create_zones=False) as client:
result = client.search.instagram.posts("https://www.instagram.com/nasa/", num_of_posts=5)
for post in result.data:
print(post["likes"], post["num_comments"], post["url"])SDK 文档字符串中未说明的规则:
- 务必传入 。 如果保持开启状态,客户端在初始化时会尝试创建 Web Unlocker 和 SERP zone,而 Instagram 从不使用这些资源;对于没有付款方式的账号,该操作会因 403 失败(sdk-python#57)。
auto_create_zones=False - 一次调用传入多个 URL 属于同一个任务。 应传入列表,而不是循环调用。
- 返回结构: 调用始终在
search.*中返回列表。result.data调用传入一个 URL 时,返回一条记录(dict);传入多个 URL 时,返回列表。scrape.* - 日期范围: ,格式为
start_date="08-01-2026", end_date="09-07-2026"。MM-DD-YYYY仅保留帖子,post_type="Post"仅保留 Reels。文档字符串中的post_type="Reels"会返回错误行且没有 Reels(sdk-python#59)。"Reel" - Reels 发现调用需要 。 默认的 180 秒会超时。
timeout=420 - 空时间范围是成功结果,零条记录: 它会表现为一行记录,其 包含
error。应匹配该消息;失效账号使用相同的There are no public posts in the profile for the specified period。error_code - 失效账号表现为带有 键的行,错误文本各不相同,例如
error或Sorry, this page isn't available.。同一结果中的其他行仍然正常。Crawler error: Cannot read properties of null - 超时表现为 且
result.success == False。result.status == "timeout" - 合作帖会在 中携带共同作者的账号名,因此从
user_posted抓取的帖子可能显示为nasa。nasajohnson会列出所有共同作者。coauthor_producers - 的费用为该账号历史上发布过的每条 Reel 1 个积分。 先检查个人资料上的
reels_all(url)。评论每条消耗 1 个积分;先检查帖子上的posts_count。num_comments - 切勿硬编码字段列表。 Schema 可能在不通知的情况下发生变化。通过 读取,该字段为以字段名为键的 dict。一条帖子包含 44 个字段中的 34 至 36 个。
client.datasets.instagram_posts.get_metadata().fields - 大规模运行: 使用 、
posts_trigger、posts_status。保留快照 ID;快照在 30 天内可下载。posts_fetch
其他七个 SDK 调用的完整代码片段位于 。
references/sdk.mdMCP: no terminal
MCP:无需终端
The Bright Data MCP server reaches the same datasets through its scraper tools,
which are on by default: with a dataset id and method from the
table at the top, and an input such as .
on the posts dataset gives an account's recent posts; pass
in the input and . and
look the ids and fields up. The skill
covers setup.
run_scraper[{"url": "https://www.instagram.com/nasa/"}]discover_by_urlnum_of_postslimit_per_inputsearch_scrapersget_scraper_detailsbrightdata-mcpBright Data MCP 服务器通过默认启用的抓取工具访问相同数据集:使用 ,并传入顶部表格中的数据集 ID 和方法,输入示例为 。在帖子数据集上使用 可获取账号最近的帖子;需在输入中传入 和 。可通过 和 查找 ID 和字段。 skill 涵盖安装配置。
run_scraper[{"url": "https://www.instagram.com/nasa/"}]discover_by_urlnum_of_postslimit_per_inputsearch_scrapersget_scraper_detailsbrightdata-mcpHand-offs
转交处理
- Unsupported URL, or an Instagram page these datasets do not cover: .
scrape - Need to find the profile or post URL first: .
search - Other platforms: .
scrape
- 不支持的 URL,或这些数据集未覆盖的 Instagram 页面:使用 。
scrape - 需要先查找个人资料或帖子 URL:使用 。
search - 其他平台:使用 。
scrape
Docs
文档
- Instagram Scraper API: https://docs.brightdata.com/products/scrapers/instagram/introduction
- Posts, discover by URL (the recent-posts call): https://docs.brightdata.com/api-reference/web-scraper-api/social-media-apis/instagram-posts-discover-by-url
- Free tier: https://docs.brightdata.com/general/account/billing-and-pricing/free-tier