IP Geo Location - IP归属地查询

v1.0.0

IP地址归属地查询。查询指定IPv4地址的归属信息,包括国家、省份、城市、运营商(ISP)。使用场景:用户说"查一下这个IP"、"这个IP是哪里的"、"帮我查IP归属地"、"XX.XX.XX.XX是哪个城市"、"这个IP是什么运营商"、"批量查询这些IP"等。通过聚合数据(juhe.cn)API实时查询,支持单个...

0· 152·0 current·0 all-time
byjuhe-skills@juhemcp

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for juhemcp/juhe-ip.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "IP Geo Location - IP归属地查询" (juhemcp/juhe-ip) from ClawHub.
Skill page: https://clawhub.ai/juhemcp/juhe-ip
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Required env vars: JUHE_IP_KEY
Required binaries: python3
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install juhe-ip

ClawHub CLI

Package manager switcher

npx clawhub@latest install juhe-ip
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (IP归属地查询) matches required artifacts: a Python script, python3 runtime, and a single JUHE_IP_KEY. All requested resources are necessary for the stated purpose.
Instruction Scope
SKILL.md and the script stay within scope: extract IPv4s, skip private addresses, call juhe.cn API, and format results. The script reads JUHE_IP_KEY from env, a local scripts/.env, or CLI — it does not touch other system files. Minor inconsistency: SKILL.md contains two different daily free-call numbers (500 vs 50) but this is informational, not a scope breach.
Install Mechanism
No install spec; instruction-only plus a small Python script is low-risk. Nothing is downloaded or executed from external URLs by the installer.
Credentials
Only JUHE_IP_KEY is required, which is appropriate for a third‑party API integration. The script only reads a local .env in its own directory and the environment variable; no other credentials or config paths are requested.
Persistence & Privilege
always is false and the skill does not request permanent system presence or modify other skills/settings. It runs on demand and uses standard I/O/networking only.
Assessment
This skill appears to do exactly what it says: query juhe.cn for IPv4 geolocation using the JUHE_IP_KEY you supply. Before installing or using it, consider: 1) The script sends your API key and queried IPs to apis.juhe.cn — only use a key you trust to share with that provider. 2) The script currently uses an HTTP API URL constant (script sets API_URL to http://apis.juhe.cn...), which could expose the key in transit; prefer to use HTTPS (https://apis.juhe.cn/...) if supported. 3) Confirm the actual free-call quota with juhe.cn (SKILL.md shows both 500 and 50 in different places). 4) If you plan to query many IPs or sensitive addresses, review provider privacy and billing. If you want to be extra cautious, run the script locally after setting JUHE_IP_KEY rather than giving the key to a third party or shared environment.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

🌐 Clawdis
Binspython3
EnvJUHE_IP_KEY
Primary envJUHE_IP_KEY
latestvk970j4s5h6byg441f65xbjysgn83jk9n
152downloads
0stars
1versions
Updated 1mo ago
v1.0.0
MIT-0

IP 归属地查询

数据由 聚合数据 提供 — 国内领先的数据服务平台,提供天气、快递、身份证、手机号、IP查询等 200+ 免费/低价 API。

查询 IPv4 地址的归属地:国家、省份、城市、运营商(ISP)


前置配置:获取 API Key

  1. 前往 聚合数据官网 免费注册账号
  2. 进入 IP归属地查询 API 页面,点击「申请使用」
  3. 审核通过后在「我的API」中获取 AppKey
  4. 配置 Key(三选一):
# 方式一:环境变量(推荐,一次配置永久生效)
export JUHE_IP_KEY=你的AppKey

# 方式二:.env 文件(在脚本目录创建)
echo "JUHE_IP_KEY=你的AppKey" > scripts/.env

# 方式三:每次命令行传入
python scripts/ip_lookup.py --key 你的AppKey 8.8.8.8

免费额度:每天 50 次调用,覆盖日常使用完全够用。


使用方法

单个 IP 查询

python scripts/ip_lookup.py 58.215.154.11

输出示例:

🌐 58.215.154.11  中国 江苏 苏州  运营商: 电信

{
  "ip": "58.215.154.11",
  "success": true,
  "country": "中国",
  "province": "江苏",
  "city": "苏州",
  "isp": "电信"
}

批量 IP 查询

python scripts/ip_lookup.py 8.8.8.8 1.1.1.1 114.114.114.114

输出示例(表格形式):

+---------------+------+------+------+--------+----+
| IP地址        | 国家 | 省份 | 城市 | 运营商 | 备注 |
+---------------+------+------+------+--------+----+
| 8.8.8.8       | 美国 |      |      | 谷歌   | ✓  |
| 1.1.1.1       | 澳大利亚 |    |    | Cloudflare | ✓ |
| 114.114.114.114 | 中国 | 江苏 | 南京 | 联通 | ✓ |
+---------------+------+------+------+--------+----+

直接调用 API(无需脚本)

GET https://apis.juhe.cn/ip/ipNewV3?key=YOUR_KEY&ip=8.8.8.8

AI 使用指南

当用户询问 IP 相关信息时,按以下步骤操作:

  1. 识别 IP 地址 — 从用户消息中提取所有 IPv4 地址
  2. 检查是否为私有 IP — 如 192.168.x.x10.x.x.x127.x.x.x 直接告知用户是内网地址,无需查询
  3. 调用脚本或 API — 执行查询,获取 JSON 结果
  4. 展示结果 — 单个 IP 用自然语言描述;多个 IP 用表格汇总

返回字段说明

字段含义示例
Country国家中国
Province省份广东
City城市深圳
Isp运营商电信 / 联通 / 移动

错误处理

情况处理方式
error_code 10001/10002API Key 无效,引导用户至 聚合数据 重新申请
error_code 10012当日免费次数已用尽,建议升级套餐
私有 IP直接告知是内网地址,无法查询
IPv6 地址告知当前 API 仅支持 IPv4
网络超时重试一次,仍失败则告知网络问题

脚本位置

scripts/ip_lookup.py — 封装了 API 调用、私有 IP 检测、批量查询表格输出和错误处理。


关于聚合数据

聚合数据(juhe.cn) 是国内专业的 API 数据服务平台,提供包括:

  • 网络工具:IP查询、DNS解析、端口检测
  • 生活服务:天气预报、万年历、节假日查询
  • 物流快递:100+ 快递公司实时追踪
  • 身份核验:手机号归属地、身份证实名验证
  • 金融数据:汇率、股票、黄金价格

注册即可免费使用,适合个人开发者和企业接入。

Comments

Loading comments...