beian
Query ICP beian like whois
Query ICP registration info from MIIT's official system. Solves CAPTCHA automatically.
Install
uvx beian --help
Or install permanently:
uv tool install beian
Browser Setup
ICP filing queries drive a real browser under the hood. On first use beian
picks a browser automatically:
- System Chrome / Edge (if installed) — zero download, most authentic.
- Playwright-managed Chromium — downloaded by Playwright itself into
its own cache on first use (~380 MB). Runs via the
chromiumchannel (new headless mode), so one binary serves both headless and headed (--no-headless) runs.
No manual download step needed in the common case. You can pre-install it:
uvx --from beian python -m playwright install --no-shell chromium
Policy flags (env):
| Env | Values | Meaning |
|---|---|---|
BEIAN_BROWSER |
auto (default), system, managed |
Force system browser or Playwright-managed browser |
BEIAN_SKIP_BROWSER_DOWNLOAD |
1 |
Never download; error with instructions instead |
Notes:
- The managed browser uses Playwright's new headless mode (real full Chromium), which is more authentic and reliable than the legacy headless shell.
- The downloaded browser is cached by Playwright and reused on later runs.
Usage
# ICP filing (default)
beian baidu.com
beian "北京百度网讯科技有限公司"
# ICP license (增值电信业务经营许可证)
beian --license "小米科技有限责任公司"
# App / miniprogram / quick app
beian --app "微信"
beian --miniprogram "人民法院在线服务"
beian --quickapp "计算器"
# Batch query
beian baidu.com qq.com taobao.com
# JSON output
beian --raw baidu.com
# Screenshot (ICP filing only)
beian --screenshot baidu.com
# Verbose progress
beian -v baidu.com
# Custom retry count
beian --retry 10 "小米科技有限责任公司"
Query Types
| Flag | Type | Source |
|---|---|---|
| (default) | ICP filing — website (备案) | beian.miit.gov.cn |
--app |
ICP filing — app (备案) | beian.miit.gov.cn |
--miniprogram |
ICP filing — miniprogram (备案) | beian.miit.gov.cn |
--quickapp |
ICP filing — quick app (备案) | beian.miit.gov.cn |
--license |
ICP license (许可证) | tsm.miit.gov.cn |
ICP License Features
The --license query automatically fetches:
- License info (许可证信息)
- Business types and scope (业务种类及覆盖范围)
- Authorization info (授权信息)
- Annual report (年报公示)
How It Works
ICP filing: Uses Playwright to control a headless browser, solves slider CAPTCHA via gap detection algorithm (~67% first-try success rate).
ICP license: Uses ddddocr with edge enhancement preprocessing to solve text CAPTCHA (~12% per attempt, ~100% with retries).
Development
uv sync
uv run python -m beian.cli --help
License
GPL 2.0 or later
Metadata
Release files for beian 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| beian-0.2.0.tar.gz | 4.6 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| beian-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.6 MB
Release files / beian-0.2.0.tar.gz
| Download URL | beian-0.2.0.tar.gz |
|---|---|
| Size | 4.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
265df16a3b83063cf6703fa77bc777edf888523b6b0ce39d62418268890a814d
|
|
BLAKE2b-256 checksum How to use checksums |
457f5fd98452692c90bfa817ee21c39426201af691a78044ace2eda025d82279
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / beian-0.2.0-py3-none-any.whl
| Download URL | beian-0.2.0-py3-none-any.whl |
|---|---|
| Size | 22.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4294aaa28df47ffa4eab6274549c1ba4e04c3c0edd70861593fde00633e04815
|
|
BLAKE2b-256 checksum How to use checksums |
2e44d52e2fc344134cf495439b9562a26a3880b3f4ad02db362ad1b7955a52a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|