chinaz-ip-location
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "chinaz-ip-location" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-51879187ff40364cc196a23b1ac2852a1f979b4775cf51c03484a218b066173f. Verify the upstream source and version against https://skillhub.cn/skills/org-1qazsc77/chinaz-ip-location before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
IPv4 street-level geolocation lookup: retrieves street-level ownership information for an IPv4 address, including country, province, city, district/county, street and related geographic data. Suitable for requests like "query IP ownership," "locate IP address," or "view IP geographic location." Invoked via a local Python script calling the IPv4 street-level endpoint and using a dedicated API key from environment variables.
Introduction source: third_party · org-1qazsc77 · 1.0.2 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: chinaz-ip-location
description: 查询 IPv4 地址的街道级归属地信息,包括国家、省份、城市、区县、街道等地理位置数据。适用于"查询IP归属地""定位IP地址位置""查看IP地理位置"等请求。通过本地 Python 脚本调用 IPv4 归属地(街道级)接口,并使用环境变量中的专属 API Key。IPv4 归属地(街道级)查询
查询一个 IPv4 地址的街道级归属地数据。本 Skill 只覆盖"IPv4 归属地(街道级)"接口,不用于域名 Whois、ICP 备案或其他接口。
运行要求
- 支持标准 Agent Skills 的 AI 客户端,且允许执行本地命令。
- Python 3;脚本只使用 Python 标准库,无需安装第三方依赖。
- 能够向
https://openapi.chinaz.net发起 HTTPS 请求。 - 运行 AI 客户端的环境可读取环境变量。
如果使用的 AI 服务不支持本地命令或环境变量,请改用该服务支持的本地客户端、沙盒密钥管理或安全环境变量注入方式;不要在聊天中发送 API Key。
获取与配置 API Key
- 在 IPv4 归属地(街道级)接口购买页 购买接口并获取专属 API Key。该接口提供 0 元/5 次的免费体验额度。
- 将 Key 保存为环境变量,变量名必须是:
CHINAZ_IP_LOCATION_API_KEY
- 重新启动你的 AI 客户端或其运行环境,使新环境变量生效。
Windows 图形界面:搜索并打开"编辑账户的环境变量",在"用户变量"中新增该变量,变量值填入购买后获得的 Key。
macOS/Linux 当前终端会话:
export CHINAZ_IP_LOCATION_API_KEY='你的专属APIKey'
不要把真实 Key 写入 SKILL.md、源代码、命令行参数、日志、仓库或聊天记录。若 AI 客户端提供"Secrets""Environment Variables"或"Credentials"配置页,优先使用其安全存储功能。
查询流程
- 从用户请求中提取
ip:待查询的 IPv4 地址,例如8.8.8.8。 - 在 Skill 根目录执行脚本:
python scripts/query_ip_location.py --ip "8.8.8.8"
如果系统将 Python 3 命令命名为 python3,使用 python3 代替 python。
- 脚本读取环境变量中的 Key,并调用原始 GET 接口
https://openapi.chinaz.net/v1/1048/newip,发送ip、ChinazVer=1.0与APIKey。 - 从脚本输出的 JSON 读取结果;仅依据实际返回回答用户。
结果解读
code: "1"表示查询成功。- 成功结果的地理位置信息位于
data对象中,通常包含以下字段(具体以接口实际返回为准):- 国家、省份、城市、区县、街道等行政区划信息
- 经纬度坐标
- 运营商/ISP 信息
- 若
code非"1",按msg字段说明查询状态。 - IP 归属地信息以接口实时返回为准,仅供参考;街道级定位可能存在一定偏差。
推荐答复格式:
IPv4 归属地查询结果
- IP 地址:8.8.8.8
- 查询状态:成功 / 失败原因
- 国家:接口返回的国家
- 省份:接口返回的省份
- 城市:接口返回的城市
- 区县:接口返回的区县
- 街道:接口返回的街道信息(如有)
- 运营商:接口返回的运营商信息(如有)
错误处理
missing_api_key:环境变量未设置。按"获取与配置 API Key"创建变量后,重启运行环境。- HTTP
431、432、433、434:Key 缺失、格式不正确或无效。确认 Key 来自购买页的"IPv4 归属地(街道级)"产品。 - HTTP
436:Key 不存在或额度不足。检查账户剩余额度;免费体验额度用完后可前往购买页购买付费套餐。 invalid_input:IP 地址格式不正确。确认输入的是有效的 IPv4 地址(如8.8.8.8)。network_error或timeout:检查网络、DNS、代理或防火墙后重试。- 其他失败状态:按返回的
msg或 JSON 错误信息说明问题,不得编造归属地数据。
使用边界
- 一次只查询一个 IP 地址;批量任务须逐条执行。
- 归属地数据仅供参考,街道级定位可能存在偏差,不保证 100% 精确。
- 不输出、复述或保存 API Key。
应用场景
场景一:查询 IP 地址的地理位置
适用问题:"这个 IP 是哪里的?"
建议输入:--ip "8.8.8.8"
结果用途:从 data 对象获取国家、省份、城市等信息,判断 IP 地址的归属地。
场景二:用户访问来源分析
适用问题:"访问我们服务的这个 IP 来自哪个地区?"
建议输入:--ip "114.114.114.114"
结果用途:结合省份、城市、区县信息分析用户访问来源,辅助广告定向或用户画像。
场景三:网络安全异常排查
适用问题:"这个异常请求的 IP 归属地是哪里?是否与预期一致?"
建议输入:--ip "1.1.1.1"
结果用途:查询 IP 归属地,与预期来源对比,辅助判断是否存在异常访问或安全风险。
Current listing version
1.0.2
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供IPv4街道级归属地查询功能,解决网络分析、安全排查等实际需求
- 应用场景明确:IP地理位置查询、用户访问来源分析、网络安全异常排查
- 实用性强,面向网络运维、安全分析等专业用户群体
Highlights
- 触发词精准完整:"查询IP归属地""定位IP地址位置""查看IP地理位置"
- 边界清晰,不与其他Skill重叠
- 在skill_body中进一步细化了使用边界和适用场景
Highlights
- 文档结构完整:运行要求→API配置→查询流程→结果解读→错误处理→使用场景
- 步骤清晰,有明确的出口条件和端到端示例
- frontmatter完整,单文件长度适中(约450行)
Highlights
- 工具来源明确:调用chinaz.net官方API接口
- 参数说明完整,覆盖主要异常情况
- 安全考虑周全:强调API Key安全存储,使用环境变量
- 错误处理全面:涵盖missing_api_key、HTTP错误码、网络异常等
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 3, 17, 19, 21, 38
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- openapi.chinaz.net
- www.chinaz.net
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.