使用 ExtractIP /distance API 检查地理坐标与 IP 位置之间的距离
使用距离 API 验证接近度
ExtractIP 距离 API 是一款功能强大的工具,专为安全和欺诈防范而设计。它允许您验证 IP 地址是否位于特定地理坐标的一定半径范围内。这对于验证用户位置、 检测潜在的 GPS 欺骗或确保请求来自预期区域特别有用。
工作原理
/geolocate/distance 端点接受带有地理坐标(纬度和经度)和半径(距离)的 POST 请求。然后,API 将这些坐标与检测到的传入请求 IP 地址的位置进行比较。
评分逻辑 (Score)
API 根据提供的坐标与 IP 的实际位置之间的距离返回接近度评分:
- 评分 0: 提供的坐标与 IP 的位置完全匹配。
- 评分 100: 坐标远离 IP 的位置,达到或超过指定的半径边缘。
该评分系统提供了一种细粒度的方法来评估用户报告位置的风险或有效性。
使用示例:
您可以使用简单的 curl 命令测试距离 API。以下是如何检查 IP 是否在特定坐标 100 公里范围内的示例:
curl -X 'POST' \
'https://api.extractip.com/geolocate/distance' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"lat": 5.4282,
"lon": 4.9041,
"distance": 100
}'
通过将此 API 集成到您的工作流程中,您可以为安全协议添加额外的验证层,确保您的用户确实位于他们所声称的位置。
Tags
机器人检测API 安全欺诈防范
Related articles
blog_post.md
>cat metadata.json
[29.Apr.2026]
>cat excerpt.txt
Meet ipwho — a lightweight CLI tool by ExtractIP that lets you instantly retrieve geographical and administrative data for any IP address right in your terminal.
blog_post.md
>cat metadata.json
[28.Apr.2026]
>cat excerpt.txt
Check distance between provided geo coordinate and IP location using ExtractIP API
blog_post.md
>cat metadata.json
[25.Sep.2025]
>cat excerpt.txt
Find out if an IP belongs to a known AI agent or web crawler — a simple way to filter bots and automated traffic