alibabacloud-icpba-sucessdata-query

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Alibaba Cloud ICP Filing Success Data Query

阿里云ICP备案成功数据查询

Scenario Description

场景描述

After successfully completing ICP filing (beian) on Alibaba Cloud, customers need to:
  1. Login to the filing system to view their filing success information
  2. Query filing details including entity information, website information, and APP information
  3. Check if there are any risks associated with their filing that need attention
This skill enables automated querying of ICP filing success data and associated risk information through Alibaba Cloud APIs.
Architecture: Alibaba Cloud Beian Service → QuerySuccessIcpData API → Filing Information (Entity + Websites + APPs + Risks)

在阿里云成功完成ICP备案(beian)后,客户需要:
  1. 登录备案系统查看备案成功信息
  2. 查询备案详情,包括主体信息、网站信息和APP信息
  3. 检查备案是否存在需要关注的风险
本Skill可通过阿里云API自动查询ICP备案成功数据及相关风险信息。
架构:阿里云备案服务 → QuerySuccessIcpData API → 备案信息(主体 + 网站 + APP + 风险)

Installation

安装步骤

Alibaba Cloud CLI

阿里云CLI

This skill requires Aliyun CLI version >= 3.3.3.
Pre-check: Aliyun CLI >= 3.3.3 required
Run
aliyun version
to verify >= 3.3.3. If not installed or version too low, run
curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash
to install/update, or see
references/cli-installation-guide.md
for installation instructions.
Pre-check: Aliyun CLI plugin update required
[MUST] run
aliyun configure set --auto-plugin-install true
to enable automatic plugin installation. [MUST] run
aliyun plugin update
to ensure that any existing plugins are always up-to-date.
本Skill要求Aliyun CLI版本 >= 3.3.3。
预检查:需Aliyun CLI >= 3.3.3
运行
aliyun version
验证版本是否 >= 3.3.3。若未安装或版本过低, 运行
curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash
进行安装/更新, 或查看
references/cli-installation-guide.md
获取安装说明。
预检查:需更新Aliyun CLI插件
[必须] 运行
aliyun configure set --auto-plugin-install true
启用自动插件安装。 [必须] 运行
aliyun plugin update
确保所有现有插件始终保持最新。

Python Dependencies

Python依赖

Since the CLI command is not yet available in the current plugin version, this skill uses the Python Common SDK:
bash
pip install -r scripts/requirements.txt

由于当前插件版本暂不支持相关CLI命令,本Skill使用Python通用SDK:
bash
pip install -r scripts/requirements.txt

Authentication

身份认证

Pre-check: Alibaba Cloud Credentials Required
Security Rules:
  • NEVER read, echo, or print AK/SK values (e.g.,
    echo $ALIBABA_CLOUD_ACCESS_KEY_ID
    is FORBIDDEN)
  • NEVER ask the user to input AK/SK directly in the conversation or command line
  • NEVER use
    aliyun configure set
    with literal credential values
  • ONLY use
    aliyun configure list
    to check credential status
bash
aliyun configure list
Check the output for a valid profile (AK, STS, or OAuth identity).
If no valid profile exists, STOP here.
  1. Obtain credentials from Alibaba Cloud Console
  2. Configure credentials outside of this session (via
    aliyun configure
    in terminal or environment variables in shell profile)
  3. Return and re-run after
    aliyun configure list
    shows a valid profile

预检查:需阿里云凭证
安全规则
  • 严禁读取、回显或打印AK/SK值(例如,
    echo $ALIBABA_CLOUD_ACCESS_KEY_ID
    是禁止操作)
  • 严禁在对话或命令行中直接要求用户输入AK/SK
  • 严禁使用
    aliyun configure set
    并传入明文凭证值
  • 仅可使用
    aliyun configure list
    检查凭证状态
bash
aliyun configure list
检查输出中是否存在有效配置文件(AK、STS或OAuth身份)。
若不存在有效配置文件,请在此处停止操作
  1. 阿里云控制台获取凭证
  2. 在本次会话外配置凭证(通过终端的
    aliyun configure
    或Shell配置文件中的环境变量)
  3. aliyun configure list
    显示有效配置文件后,返回并重新运行

RAM Policy

RAM权限

This skill requires the
beian:QuerySuccessIcpData
permission. For the complete RAM policy JSON and configuration instructions, see references/ram-policies.md.
[MUST] Permission Failure Handling: When any command or API call fails due to permission errors at any point during execution, follow this process:
  1. Read
    references/ram-policies.md
    to get the full list of permissions required by this SKILL
  2. Use
    ram-permission-diagnose
    skill to guide the user through requesting the necessary permissions
  3. Pause and wait until the user confirms that the required permissions have been granted

本Skill需要
beian:QuerySuccessIcpData
权限。完整的RAM策略JSON及配置说明,请查看 references/ram-policies.md
[必须] 权限失败处理:若执行过程中任何命令或API调用因权限错误失败,请遵循以下流程:
  1. 阅读
    references/ram-policies.md
    获取本Skill所需的全部权限列表
  2. 使用
    ram-permission-diagnose
    Skill引导用户申请必要权限
  3. 暂停操作,等待用户确认已授予所需权限

Parameter Confirmation

参数确认

IMPORTANT: Parameter Confirmation — Before executing any command or API call, ALL user-customizable parameters (e.g., RegionId, instance names, CIDR blocks, passwords, domain names, resource specifications, etc.) MUST be confirmed with the user. Do NOT assume or use default values without explicit user approval.
Parameter NameRequired/OptionalDescriptionDefault Value
CallerRequiredCaller identifier for API request
skill
(fixed value)
RegionOptionalAlibaba Cloud region
cn-hangzhou

重要提示:参数确认 — 在执行任何命令或API调用前, 所有用户可自定义的参数(例如RegionId、实例名称、CIDR块、 密码、域名、资源规格等)必须与用户确认。未经用户明确批准,不得假设或使用默认值。
参数名称必填/可选描述默认值
Caller必填API请求的调用方标识
skill
(固定值)
Region可选阿里云地域
cn-hangzhou

Core Workflow

核心工作流程

At the start of the Core Workflow (before any CLI invocation): [MUST] Enable AI-Mode — AI-mode is required for Agent Skill execution. Run the following commands before any CLI invocation:
bash
aliyun configure ai-mode enable
aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-icpba-sucessdata-query"
在核心工作流程开始时(执行任何CLI调用前): [必须] 启用AI模式 — 执行Agent Skill需要AI模式。 在执行任何CLI调用前,运行以下命令:
bash
aliyun configure ai-mode enable
aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-icpba-sucessdata-query"

Step 1: Query ICP Filing Success Data

步骤1:查询ICP备案成功数据

Since the CLI command
aliyun companyreg query-success-icp-data
is not yet available in the current plugin version, we'll use the Python Common SDK to call the API directly.
Create a Python script to query the filing data:
python
#!/usr/bin/env python3
由于当前插件版本暂不支持CLI命令
aliyun companyreg query-success-icp-data
,我们将直接使用Python通用SDK调用API。
创建Python脚本查询备案数据:
python
#!/usr/bin/env python3

-- coding: utf-8 --

-- coding: utf-8 --

from alibabacloud_credentials.client import Client as CredentialClient from alibabacloud_tea_openapi.client import Client as OpenApiClient from alibabacloud_tea_openapi import models as open_api_models from alibabacloud_tea_util import models as util_models import json
def create_client() -> OpenApiClient: """ Create an OpenAPI client with credential authentication. """ credential = CredentialClient()
config = open_api_models.Config(
    credential=credential,
    endpoint='companyreg.aliyuncs.com',
    region_id='cn-hangzhou',
    user_agent='AlibabaCloud-Agent-Skills/alibabacloud-icpba-sucessdata-query'
)

return OpenApiClient(config)
def query_success_icp_data(caller: str = 'skill') -> dict: """ Query ICP filing success data including entity, website, app, and risk information.
Args:
    caller: Caller identifier (fixed value: 'skill')

Returns:
    dict: Filing success data response
"""
client = create_client()

params = open_api_models.Params(
    action='QuerySuccessIcpData',
    version='2026-04-23',
    protocol='HTTPS',
    method='POST',
    auth_type='AK',
    style='RPC',
    pathname='/',
    req_body_type='formData',
    body_type='json'
)

queries = {
    'Caller': caller
}

request = open_api_models.OpenApiRequest(
    query=queries
)

runtime = util_models.RuntimeOptions(
    connect_timeout=5000,
    read_timeout=10000
)

try:
    response = client.call_api(params, request, runtime)
    return response.get('body', {})
except Exception as e:
    print(f"Error querying ICP filing data: {str(e)}")
    raise
def main(): print("Querying ICP Filing Success Data...") print("=" * 60)
# Query filing data
result = query_success_icp_data(caller='skill')

# Print formatted result
print(json.dumps(result, indent=2, ensure_ascii=False))

# Parse and display summary
if result.get('Success'):
    ba_list = result.get('BaSuccessDataWithRiskList', [])
    print("\n" + "=" * 60)
    print(f"Total Filing Records: {len(ba_list)}")

    for idx, ba_data in enumerate(ba_list, 1):
        print(f"\n--- Filing Record {idx} ---")
        print(f"ICP Number: {ba_data.get('IcpNumber')}")
        print(f"Entity Name: {ba_data.get('OrganizersName')}")
        print(f"Entity Type: {ba_data.get('OrganizersNature')}")
        print(f"Responsible Person: {ba_data.get('ResponsiblePersonName')}")

        # Website information
        websites = ba_data.get('WebsiteList', [])
        print(f"\nWebsites: {len(websites)}")
        for site in websites:
            print(f"  - {site.get('SiteName')} ({site.get('SiteRecordNum')})")
            print(f"    Domains: {', '.join(site.get('DomainList', []))}")

        # APP information
        apps = ba_data.get('AppList', [])
        if apps:
            print(f"\nAPPs: {len(apps)}")
            for app in apps:
                print(f"  - {app.get('AppName')} ({app.get('AppRecordNum')})")
                print(f"    Domains: {', '.join(app.get('DomainList', []))}")

        # Risk information
        risks = ba_data.get('RiskList', [])
        if risks:
            print(f"\n⚠️ Risks: {len(risks)}")
            for risk in risks:
                print(f"  Deadline: {risk.get('DeadLine')}")
                for detail in risk.get('RiskDetailList', []):
                    print(f"  Source: {detail.get('RiskSource')}")
                    for suggest in detail.get('rectifySuggest', []):
                        print(f"  Suggestion: {suggest}")
else:
    print("Query failed or returned no data.")
if name == 'main': main()

Save this script as `query_icp_filing.py` and run:

```bash
python3 query_icp_filing.py
from alibabacloud_credentials.client import Client as CredentialClient from alibabacloud_tea_openapi.client import Client as OpenApiClient from alibabacloud_tea_openapi import models as open_api_models from alibabacloud_tea_util import models as util_models import json
def create_client() -> OpenApiClient: """ Create an OpenAPI client with credential authentication. """ credential = CredentialClient()
config = open_api_models.Config(
    credential=credential,
    endpoint='companyreg.aliyuncs.com',
    region_id='cn-hangzhou',
    user_agent='AlibabaCloud-Agent-Skills/alibabacloud-icpba-sucessdata-query'
)

return OpenApiClient(config)
def query_success_icp_data(caller: str = 'skill') -> dict: """ Query ICP filing success data including entity, website, app, and risk information.
Args:
    caller: Caller identifier (fixed value: 'skill')

Returns:
    dict: Filing success data response
"""
client = create_client()

params = open_api_models.Params(
    action='QuerySuccessIcpData',
    version='2026-04-23',
    protocol='HTTPS',
    method='POST',
    auth_type='AK',
    style='RPC',
    pathname='/',
    req_body_type='formData',
    body_type='json'
)

queries = {
    'Caller': caller
}

request = open_api_models.OpenApiRequest(
    query=queries
)

runtime = util_models.RuntimeOptions(
    connect_timeout=5000,
    read_timeout=10000
)

try:
    response = client.call_api(params, request, runtime)
    return response.get('body', {})
except Exception as e:
    print(f"Error querying ICP filing data: {str(e)}")
    raise
def main(): print("Querying ICP Filing Success Data...") print("=" * 60)
# Query filing data
result = query_success_icp_data(caller='skill')

# Print formatted result
print(json.dumps(result, indent=2, ensure_ascii=False))

# Parse and display summary
if result.get('Success'):
    ba_list = result.get('BaSuccessDataWithRiskList', [])
    print("\n" + "=" * 60)
    print(f"Total Filing Records: {len(ba_list)}")

    for idx, ba_data in enumerate(ba_list, 1):
        print(f"\n--- Filing Record {idx} ---")
        print(f"ICP Number: {ba_data.get('IcpNumber')}")
        print(f"Entity Name: {ba_data.get('OrganizersName')}")
        print(f"Entity Type: {ba_data.get('OrganizersNature')}")
        print(f"Responsible Person: {ba_data.get('ResponsiblePersonName')}")

        # Website information
        websites = ba_data.get('WebsiteList', [])
        print(f"\nWebsites: {len(websites)}")
        for site in websites:
            print(f"  - {site.get('SiteName')} ({site.get('SiteRecordNum')})")
            print(f"    Domains: {', '.join(site.get('DomainList', []))}")

        # APP information
        apps = ba_data.get('AppList', [])
        if apps:
            print(f"\nAPPs: {len(apps)}")
            for app in apps:
                print(f"  - {app.get('AppName')} ({app.get('AppRecordNum')})")
                print(f"    Domains: {', '.join(app.get('DomainList', []))}")

        # Risk information
        risks = ba_data.get('RiskList', [])
        if risks:
            print(f"\n⚠️ Risks: {len(risks)}")
            for risk in risks:
                print(f"  Deadline: {risk.get('DeadLine')}")
                for detail in risk.get('RiskDetailList', []):
                    print(f"  Source: {detail.get('RiskSource')}")
                    for suggest in detail.get('rectifySuggest', []):
                        print(f"  Suggestion: {suggest}")
else:
    print("Query failed or returned no data.")
if name == 'main': main()

将此脚本保存为 `query_icp_filing.py` 并运行:

```bash
python3 query_icp_filing.py

Step 2: Analyze Results

步骤2:分析结果

The API returns the following information structure:
  1. Entity Information (主体信息):
    • ICP Number (备案号)
    • Entity Name (主体名称)
    • Entity Type (主体性质: 企业/个人)
    • Responsible Person (负责人)
  2. Website Information (网站信息):
    • Site Record Number (网站备案号)
    • Site Name (网站名称)
    • Domain List (域名列表)
    • Responsible Person (网站负责人)
  3. APP Information (APP信息):
    • APP Record Number (APP备案号)
    • APP Name (APP名称)
    • Domain List (域名列表)
    • Responsible Person (APP负责人)
  4. Risk Information (风险信息):
    • Deadline (处理截止日期)
    • Risk Source (风险来源)
    • Rectify Suggestions (整改建议)
API返回的信息结构如下:
  1. 主体信息
    • ICP编号(备案号)
    • 主体名称
    • 主体类型(企业/个人)
    • 负责人
  2. 网站信息
    • 网站备案号
    • 网站名称
    • 域名列表
    • 网站负责人
  3. APP信息
    • APP备案号
    • APP名称
    • 域名列表
    • APP负责人
  4. 风险信息
    • 处理截止日期
    • 风险来源
    • 整改建议

Example Response Data

响应数据示例

Example 1: Filing with Entity, Websites, and Risks
json
{
  "RequestId": "79732597-AB14-1341-9131-D94F48D1AFD7",
  "Success": true,
  "BaSuccessDataWithRiskList": [
    {
      "IcpNumber": "粤ICP测50000001号",
      "OrganizersName": "深圳市星澜美容有限公司变更",
      "OrganizersNature": "企业",
      "ResponsiblePersonName": "于婷",
      "WebsiteList": [
        {
          "SiteRecordNum": "粤ICP测50000001号-1",
          "DomainList": ["13011160846019.com"],
          "SiteName": "于婷广东",
          "ResponsiblePersonName": "于婷"
        },
        {
          "SiteRecordNum": "津ICP备2023010907号-1",
          "DomainList": ["uijikoxjsu.com"],
          "SiteName": "920企业变更网站001",
          "ResponsiblePersonName": "于婷"
        }
      ],
      "AppList": [],
      "RiskList": [
        {
          "DeadLine": "2026年04月28日0点",
          "RiskDetailList": [
            {
              "RiskSource": "网站/APP信息 - 津ICP备2023010907号-1 - 网站域名 - uijikoxjsu.com",
              "rectifySuggest": [
                "<span style=\"font-weight:bold;\">网站内容涉及金融业务</span>,请提交<span style=\"font-weight:bold; color: red;\">变更备案</span>上传有效期内的金融前置文件许可,牌照或批文,传到备案系统,或者修改网站内容,与备案主体一致,符合最新备案规则。"
              ]
            }
          ]
        }
      ]
    }
  ]
}
Example 2: Filing with Entity, Websites, and APPs
json
{
  "RequestId": "E36C463A-0869-1318-A851-84C53711984A",
  "Success": true,
  "BaSuccessDataWithRiskList": [
    {
      "IcpNumber": "测BA20251231094500051号",
      "OrganizersName": "LXtest001变更测试",
      "OrganizersNature": "企业",
      "ResponsiblePersonName": "李四",
      "WebsiteList": [
        {
          "SiteRecordNum": "测BA20251231094500051号-1",
          "DomainList": ["lxtest001.com"],
          "SiteName": "测试迁移使用11111111111111111111",
          "ResponsiblePersonName": "张三"
        },
        {
          "SiteRecordNum": "测BA20251230112600098号-2",
          "DomainList": ["test89876868.com"],
          "SiteName": "测试test111",
          "ResponsiblePersonName": "张三"
        }
      ],
      "AppList": [
        {
          "AppRecordNum": "测BA20251231094500051号-2",
          "DomainList": ["lxtest002.com"],
          "AppName": "测试测试11",
          "ResponsiblePersonName": "李四"
        }
      ],
      "RiskList": []
    }
  ]
}
[MUST] Disable AI-Mode at EVERY exit point — Before delivering the final response for ANY reason, always disable AI-mode first. This applies to ALL exit paths: workflow success, workflow failure, error/exception, user cancellation, session end, or any other scenario where no further CLI commands will be executed. AI-mode is only used for Agent Skill invocation scenarios and MUST NOT remain enabled after the skill stops running.
bash
aliyun configure ai-mode disable

示例1:包含主体、网站及风险的备案数据
json
{
  "RequestId": "79732597-AB14-1341-9131-D94F48D1AFD7",
  "Success": true,
  "BaSuccessDataWithRiskList": [
    {
      "IcpNumber": "粤ICP测50000001号",
      "OrganizersName": "深圳市星澜美容有限公司变更",
      "OrganizersNature": "企业",
      "ResponsiblePersonName": "于婷",
      "WebsiteList": [
        {
          "SiteRecordNum": "粤ICP测50000001号-1",
          "DomainList": ["13011160846019.com"],
          "SiteName": "于婷广东",
          "ResponsiblePersonName": "于婷"
        },
        {
          "SiteRecordNum": "津ICP备2023010907号-1",
          "DomainList": ["uijikoxjsu.com"],
          "SiteName": "920企业变更网站001",
          "ResponsiblePersonName": "于婷"
        }
      ],
      "AppList": [],
      "RiskList": [
        {
          "DeadLine": "2026年04月28日0点",
          "RiskDetailList": [
            {
              "RiskSource": "网站/APP信息 - 津ICP备2023010907号-1 - 网站域名 - uijikoxjsu.com",
              "rectifySuggest": [
                "<span style=\"font-weight:bold;\">网站内容涉及金融业务</span>,请提交<span style=\"font-weight:bold; color: red;\">变更备案</span>上传有效期内的金融前置文件许可,牌照或批文,传到备案系统,或者修改网站内容,与备案主体一致,符合最新备案规则。"
              ]
            }
          ]
        }
      ]
    }
  ]
}
示例2:包含主体、网站及APP的备案数据
json
{
  "RequestId": "E36C463A-0869-1318-A851-84C53711984A",
  "Success": true,
  "BaSuccessDataWithRiskList": [
    {
      "IcpNumber": "测BA20251231094500051号",
      "OrganizersName": "LXtest001变更测试",
      "OrganizersNature": "企业",
      "ResponsiblePersonName": "李四",
      "WebsiteList": [
        {
          "SiteRecordNum": "测BA20251231094500051号-1",
          "DomainList": ["lxtest001.com"],
          "SiteName": "测试迁移使用11111111111111111111",
          "ResponsiblePersonName": "张三"
        },
        {
          "SiteRecordNum": "测BA20251230112600098号-2",
          "DomainList": ["test89876868.com"],
          "SiteName": "测试test111",
          "ResponsiblePersonName": "张三"
        }
      ],
      "AppList": [
        {
          "AppRecordNum": "测BA20251231094500051号-2",
          "DomainList": ["lxtest002.com"],
          "AppName": "测试测试11",
          "ResponsiblePersonName": "李四"
        }
      ],
      "RiskList": []
    }
  ]
}
[必须] 在所有退出点禁用AI模式 — 无论出于何种原因交付最终响应前,务必先禁用AI模式。这适用于所有退出路径:工作流成功、工作流失败、错误/异常、用户取消、会话结束或任何其他不再执行CLI命令的场景。 AI模式仅用于Agent Skill调用场景,Skill停止运行后必须禁用。
bash
aliyun configure ai-mode disable

Success Verification Method

成功验证方法

To verify the query was successful:
  1. Check the
    Success
    field in the response is
    true
  2. Verify
    BaSuccessDataWithRiskList
    contains filing records
  3. Confirm each record has:
    • Valid
      IcpNumber
    • Entity information (
      OrganizersName
      ,
      OrganizersNature
      )
    • At least one website in
      WebsiteList
      or one app in
      AppList
For detailed verification steps, see references/verification-method.md.

要验证查询是否成功:
  1. 检查响应中的
    Success
    字段是否为
    true
  2. 验证
    BaSuccessDataWithRiskList
    包含备案记录
  3. 确认每条记录包含:
    • 有效的
      IcpNumber
    • 主体信息(
      OrganizersName
      OrganizersNature
    • WebsiteList
      中至少有一个网站或
      AppList
      中至少有一个APP
详细验证步骤,请查看 references/verification-method.md

Cleanup

清理操作

This is a read-only query operation with no resources to clean up.

这是只读查询操作,无需清理任何资源。

Best Practices

最佳实践

  1. Regular Monitoring: Query filing data regularly to stay informed of any new risks
  2. Risk Response: When risks are identified, respond before the deadline to avoid filing cancellation
  3. Data Consistency: Ensure website/APP content matches the filed information to prevent risks
  4. Permission Management: Use RAM policies to grant minimal required permissions
  5. Error Handling: Implement proper error handling and retry logic for API calls
  6. Credential Security: Never hardcode credentials; always use environment variables or credential files
  7. Response Parsing: Handle both scenarios where AppList or RiskList may be empty arrays
  8. HTML Content: Be aware that risk suggestions may contain HTML tags for formatting

  1. 定期监控:定期查询备案数据,及时了解新出现的风险
  2. 风险响应:发现风险后,在截止日期前处理,避免备案被取消
  3. 数据一致性:确保网站/APP内容与备案信息一致,防止产生风险
  4. 权限管理:使用RAM策略授予最小必要权限
  5. 错误处理:为API调用实现适当的错误处理和重试逻辑
  6. 凭证安全:切勿硬编码凭证,始终使用环境变量或凭证文件
  7. 响应解析:处理AppList或RiskList为空数组的情况
  8. HTML内容:注意风险建议可能包含用于格式化的HTML标签

Reference Links

参考链接

ReferenceDescription
references/ram-policies.mdDetailed RAM permission requirements
references/related-commands.mdAll related CLI commands and SDK methods
references/verification-method.mdDetailed verification steps
references/cli-installation-guide.mdAlibaba Cloud CLI installation guide
references/common-sdk-usage.mdPython Common SDK usage patterns
references/error-handling.mdCommon errors and solutions
参考文档描述
references/ram-policies.md详细RAM权限要求
references/related-commands.md所有相关CLI命令和SDK方法
references/verification-method.md详细验证步骤
references/cli-installation-guide.md阿里云CLI安装指南
references/common-sdk-usage.mdPython通用SDK使用模式
references/error-handling.md常见错误及解决方案