brightdata-sdk
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBright Data SDKs
Bright Data SDKs
Two published packages, one skill. The request is the same in both languages, so follow the language the repo already uses.
| Language | Package | Registry | Install |
|---|---|---|---|
| Python | | PyPI | |
| Node.js | | npm | |
两个已发布的包,一个 skill。两种语言中的请求相同,因此应遵循代码仓库已经使用的语言。
| 语言 | 包 | 注册表 | 安装 |
|---|---|---|---|
| Python | | PyPI | |
| Node.js | | npm | |
Which reference to open
应打开哪个参考文件
- A , a
pyproject.tomlorrequirements.txtfiles are in the project: open.py.references/python.md - A or
package.json,.jsand.mjsfiles are in the project: open.ts.references/nodejs.md - Both languages are present and neither clearly owns the job: ask which runtime will run it, then open that one file.
- 项目中存在 、
pyproject.toml或requirements.txt文件:打开.py。references/python.md - 项目中存在 或
package.json、.js、.mjs文件:打开.ts。references/nodejs.md - 项目中同时存在两种语言,且没有明确哪一种负责运行:询问用户将使用哪个 runtime,然后打开对应的文件。
When the SDK is the right surface
何时应使用 SDK
The user keeps the code. A cron job, a backend service, an ETL step, an enrichment pipeline: anything where the same call runs again and again from a file under version control. Reach for the SDK the moment a Bright Data call is going to live in a repo rather than in a terminal.
Two neighbours own the other cases. A one-off check typed at a shell is . An AI app that picks its tools at run time is .
brightdata-clibrightdata-mcp用户会保留代码。定时任务、后端服务、ETL 步骤、数据增强流水线:任何从版本控制中的文件反复执行同一次调用的场景。只要 Bright Data 调用将放在代码仓库中而不是终端里,就应使用 SDK。
另外两个相邻 skill 分别负责其他场景。在 shell 中临时输入的一次性检查使用 。在运行时自主选择工具的 AI 应用使用 。
brightdata-clibrightdata-mcpAuth
身份验证
Install, login and API key problems belong to , which owns credential paths and what a refused call means. See its .
agent-onboardingreferences/auth.mdThe one fact this skill needs: both SDKs read first, accept as an alternate, and fall back to the credentials the Bright Data CLI stored at login. Never write a key into source. Both reference files show the key coming from the environment. To check that a key exists, run from the skill; never , or the credentials file or the variable, because whatever a command prints lands in the conversation and its logs.
BRIGHTDATA_API_TOKENBRIGHTDATA_API_KEYnode scripts/check-auth.mjsagent-onboardingcatechojq安装、登录和 API key 问题属于 ,该 skill 负责凭据路径以及调用被拒绝时的含义。参阅它的 。
agent-onboardingreferences/auth.md本 skill 只需要了解一件事:两个 SDK 都会优先读取 ,接受 作为替代项,并在找不到它们时回退到 Bright Data CLI 登录时保存的凭据。切勿将 key 写入源代码。两份参考文件都展示了如何从环境变量获取 key。要检查 key 是否存在,请从 skill 中运行 ;切勿使用 、 或 输出凭据文件或变量内容,因为命令打印的任何内容都会进入对话及其日志。
BRIGHTDATA_API_TOKENBRIGHTDATA_API_KEYagent-onboardingnode scripts/check-auth.mjscatechojqWhat both packages cover
两个包涵盖的功能
Page fetch, SERP search, per-platform scrapers, a crawler, dataset access, Browser API connect strings, and a Scraper Studio namespace. The shape differs by language: Python is async first and uses snake_case, Node.js uses camelCase and has to be closed, either with by hand or with on modern runtimes. Read the reference file rather than translating method names by hand.
close()await usingBy default both SDKs create the zones and in the account when they are missing: Python when the client opens, Node on the first call that uses each zone. Tell the user before running code that will do that. Each reference file shows how to turn auto-creation off and use the account's own zones.
sdk_unlockersdk_serp页面获取、SERP 搜索、各平台 scraper、crawler、数据集访问、Browser API connect string,以及 Scraper Studio namespace。两种语言的接口形态不同:Python 以 async 为优先,并使用 snake_case;Node.js 使用 camelCase,并且必须关闭客户端,可以手动调用 ,也可以在现代 runtime 中使用 。请阅读对应的参考文件,不要手工翻译方法名称。
close()await using默认情况下,如果账户中不存在 和 ,两个 SDK 都会创建它们:Python 在客户端打开时创建,Node.js 在首次调用使用相应 zone 的功能时创建。运行将执行此操作的代码前,应先告知用户。每份参考文件都展示了如何关闭自动创建并使用账户自己的 zones。
sdk_unlockersdk_serp