{"id":13453434,"url":"https://github.com/ccbikai/ip-api","last_synced_at":"2025-05-16T18:07:56.357Z","repository":{"id":219922712,"uuid":"732649680","full_name":"ccbikai/ip-api","owner":"ccbikai","description":"利用 Cloudflare Workers / Vercel Edge / Netlify Edge 快速搭一个获取 IP 地址和地理位置信息的接口。","archived":false,"fork":false,"pushed_at":"2025-03-16T06:31:16.000Z","size":152,"stargazers_count":220,"open_issues_count":0,"forks_count":97,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T22:06:57.805Z","etag":null,"topics":["cloudflare","ip","ipgeo","ipgeolocation","myip","vercel"],"latest_commit_sha":null,"homepage":"https://html.zone/ip","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ccbikai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-17T11:52:30.000Z","updated_at":"2025-03-29T17:38:20.000Z","dependencies_parsed_at":"2024-01-30T11:49:29.322Z","dependency_job_id":"c2be4afd-3e7b-447d-8c03-eb62b3387c2f","html_url":"https://github.com/ccbikai/ip-api","commit_stats":{"total_commits":9,"total_committers":3,"mean_commits":3.0,"dds":"0.33333333333333337","last_synced_commit":"7984ab6dfb7e41f15c54e866eb0c857cb474b58e"},"previous_names":["ccbikai/ip-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccbikai%2Fip-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccbikai%2Fip-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccbikai%2Fip-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccbikai%2Fip-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ccbikai","download_url":"https://codeload.github.com/ccbikai/ip-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248606864,"owners_count":21132429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudflare","ip","ipgeo","ipgeolocation","myip","vercel"],"created_at":"2024-07-31T08:00:40.005Z","updated_at":"2025-04-12T17:38:54.343Z","avatar_url":"https://github.com/ccbikai.png","language":"JavaScript","funding_links":[],"categories":["Sonstiges","🛠️ 开发与脚手架"],"sub_categories":[],"readme":"# IP-API\n\n利用 Cloudflare Workers / Vercel Edge / Netlify Edge 快速搭一个获取 IP 地址和地理位置信息的接口。\n\n## 使用方式\n\n### IP\n\n1. 通过访问 Cloudflare 获取本机 IP： `curl https://cloudflare-ip.html.zone/` 或者直接访问 \u003chttps://cloudflare-ip.html.zone/\u003e\n2. 通过访问 Vercel 获取本机 IP： `curl https://vercel-ip.html.zone/` 或者直接访问 \u003chttps://vercel-ip.html.zone/\u003e\n3. 通过访问 Netlify 获取本机 IP： `curl https://netlify-ip.html.zone/` 或者直接访问 \u003chttps://netlify-ip.html.zone/\u003e\n\n### IP GEO\n\n1. 通过访问 Cloudflare 获取本机 IP 地理位置信息, `curl https://cloudflare-ip.html.zone/geo` 或者直接访问 \u003chttps://cloudflare-ip.html.zone/geo\u003e\n2. 通过访问 Vercel 获取本机 IP 地理位置信息, `curl https://vercel-ip.html.zone/geo` 或者直接访问 \u003chttps://vercel-ip.html.zone/geo\u003e\n3. 通过访问 Netlify 获取本机 IP 地理位置信息, `curl https://netlify-ip.html.zone/geo` 或者直接访问 \u003chttps://netlify-ip.html.zone/geo\u003e\n\n\u003e HTTP 响应头 `x-client-ip` 也是用户 IP 地址。\n\nGEO 信息格式：\n\n```json\n{\n    \"ip\": \"142.171.116.110\",\n    \"city\": \"Los Angeles\",\n    \"country\": \"US\",\n    \"flag\": \"🇺🇸\",\n    \"countryRegion\": \"California\",\n    \"region\": \"LAX\",\n    \"latitude\": \"34.05440\",\n    \"longitude\": \"-118.24410\",\n    \"asOrganization\": \"Multacom Corporation\"\n}\n```\n\n## 部署方式\n\n### 1. 部署代码\n\n```bash\n# clone 此项目\ngit clone https://github.com/ccbikai/ip-api.git\n\n# 进入项目目录\ncd ip-api\n# 安装依赖\nnpm i\n\n## 部署到 Cloudflare Workers\nnpm run deploy:cloudflare\n\n## 部署到 Vercel Edge\nnpm run deploy:vercel\n\n## 部署到 Netlify Edge\nnpm run deploy:netlify\n```\n\n### 2. 绑定域名\n\n按照 Cloudflare/Vercel/Netlify 文档绑定域名即可。\n\n### 3. IPv4/IPv6 Only\n\nCloudflare 支持 IPv4 和 IPv6 访问，如果想只支持单栈，可以只解析 A/AAAA 记录到 Cloudflare 的泛拨 IP。\n\n比如: \u003chttps://cloudflare-ip-v4.html.zone/\u003e 和 \u003chttp://cloudflare-ip-v6.html.zone/\u003e\n\n## 问题反馈\n\n1. 提 Issue / Pull Request\n2. 联系 \u003chttps://twitter.com/ccbikai\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccbikai%2Fip-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fccbikai%2Fip-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccbikai%2Fip-api/lists"}