# IP Info Service - LLMs Index # 本文件遵循 LLMs.txt 标准 (https://llmstxt.org/) # 项目描述 Title: IP Info Service Description: 一个基于 Cloudflare Workers 的轻量级 IP 信息查询服务,返回访问者的 IP 地址、国家代码、时区等信息。 Version: 1.0.0 License: MIT Language: zh-CN Tags: ip, geolocation, cloudflare, api, rest # API 端点 - GET / - 返回 JSON 格式的 IP 信息 - GET /robots.txt - 搜索引擎爬虫规则 - GET /llms.txt - LLM 索引文件(本文件) - GET /llm.txt - LLM 索引文件(兼容) ## 快速使用 ### curl ```bash curl https://ip-info-service.your-subdomain.workers.dev/ ``` ### JavaScript ```javascript const response = await fetch('https://ip-info-service.your-subdomain.workers.dev/'); const data = await response.json(); console.log(data.country); // 国家代码,如 "CN" console.log(data.ipv4); // IPv4 地址 ``` ### Python ```python import requests response = requests.get('https://ip-info-service.your-subdomain.workers.dev/') data = response.json() print(data['country']) # 国家代码 ``` ## 响应格式 ```json { "ipv4": "203.0.113.1", "ipv6": "", "country": "CN", "colo": "HKG", "asn": "13335", "timezone": "Asia/Shanghai", "timestamp": "2024-01-01T12:00:00.000Z" } ``` ## 特性 - ⚡ 全球边缘部署,低延迟 - 🔒 支持 CORS,可从任何域名调用 - 🌍 自动识别国家代码 - 💡 对 AI 和 LLM 友好