使用Python开发一个ICP备案查询接口
实现目标
- 支持通过域名、APP名称、快应用名称、小程序名称来查询对应的备案信息
- 支持通过公司主体名称来查询所有备案信息,并支持分页查询
- 支持通过备案号来查询备案信息
- 构建一个高性能的模块
- 基于模块构建一个高性能的本地化Api,并提供更人性化的输出
效果预览
- 通过域名查询备案信息
Input:
Out:curl http://127.0.0.1:16181/query/web?search=baidu.com
{ "code": 200, "msg": "操作成功", "params": { "endRow": 0, "firstPage": 1, "hasNextPage": false, "hasPreviousPage": false, "isFirstPage": true, "isLastPage": true, "lastPage": 1, "list": [ { "contentTypeName": "", "domain": "baidu.com", "domainId": 10000245113, "leaderName": "", "limitAccess": "否", "mainId": 282751, "mainLicence": "京ICP证030173号", "natureName": "企业", "serviceId": 282911, "serviceLicence": "京ICP证030173号-1", "unitName": "北京百度网讯科技有限公司", "updateRecordTime": "2023-08-15 11:32:09" } ], "navigatePages": 8, "navigatepageNums": [ 1 ], "nextPage": 1, "pageNum": 1, "pageSize": 10, "pages": 1, "prePage": 1, "size": 1, "startRow": 0, "total": 1 }, "success": true }
- 通过备案号来查询备案信息
Input:
Out:curl http://127.0.0.1:16181/query/web?search=京ICP证030173号-1
{ "code": 200, "msg": "操作成功", "params": { "endRow": 0, "firstPage": 1, "hasNextPage": false, "hasPreviousPage": false, "isFirstPage": true, "isLastPage": true, "lastPage": 1, "list": [ { "contentTypeName": "", "domain": "baidu.com", "domainId": 10000245113, "leaderName": "", "limitAccess": "否", "mainId": 282751, "mainLicence": "京ICP证030173号", "natureName": "企业", "serviceId": 282911, "serviceLicence": "京ICP证030173号-1", "unitName": "北京百度网讯科技有限公司", "updateRecordTime": "2023-08-15 11:32:09" } ], "navigatePages": 8, "navigatepageNums": [ 1 ], "nextPage": 1, "pageNum": 1, "pageSize": 10, "pages": 1, "prePage": 1, "size": 1, "startRow": 0, "total": 1 }, "success": true }
- 在代码中使用
import asyncio from ymicp import beian async def main(name): icp = beian() query = await icp.ymApp(name) print(query) asyncio.run(main("微信"))
- 使用本地化Api
Linux下
Windows下./icpApi.bin
# 可直接双击运行 ./icpApi.exe
完整代码以及程序下载
- 完整代码已开源到Github项目 ICP_Query
https://github.com/HG-ha/ICP_Query - Linux程序下载
https://github.com/HG-ha/ICP_Query/releases/download/v0.2-icpApi/linux_icpApi.zip - Windows程序下载
https://github.com/HG-ha/ICP_Query/releases/download/v0.2-icpApi/windows_icpApi.zip
在线Api接口
https://api.wer.plus/inteface?id=6