freeapis

IPInfoDB

按 IP 地址查询国家、地区、城市和时区的免费地理定位工具和 API

认证方式
API Key
HTTPS
Yes
CORS
Unknown
数据来源
public-apis + marcelscruz

简介

IPInfoDB 把 IP 地址解析为国家、地区、城市和时区——轻量级密钥式 IP 查询 API。

注(2026-08 实测):无效密钥返回 HTTP 200 且 body 里 "statusCode": "ERROR"(不是 4xx)——请检查 statusCode 字段,而不是 HTTP 状态码。

快速开始

IP 查询(替换 YOUR_KEY):

curl "https://api.ipinfodb.com/v3/ip-city/?key=YOUR_KEY&ip=8.8.8.8&format=json"
{
  "statusCode": "OK",
  "statusMessage": "",
  "ipAddress": "8.8.8.8",
  "countryCode": "US",
  "countryName": "United States",
  "regionName": "California",
  "cityName": "Mountain View",
  "zipCode": "94035",
  "latitude": 37.386,
  "longitude": -122.0838,
  "timeZone": "-08:00"
}

认证方式

  • 在 ipinfodb.com 注册 → 免费 API 密钥。
  • 通过 key 查询参数携带。
  • 无效密钥返回 200 + "statusCode": "ERROR"(已实测)——请检查 JSON。

速率限制与注意事项

  • 免费层:约 2 次请求/秒(以官网为准)——额度小;付费档可扩展。
  • format=json(或 xml)选择响应格式。
  • 端点:/v3/ip-city/(完整查询)、/v3/ip-country/(仅国家,更便宜)。

常见问题

IPInfoDB 免费吗? 免费层带低限流;更多需要付费。

为什么 200 但 statusCode ERROR? API 在 body 里报告错误(已实测)——请检查 statusCode。

两个端点有什么区别? ip-city 给城市级数据;ip-country 只有国家。

地理编码 分类更多

APIAuthHTTPSCORS
Actinia Grass GIS

Actinia is an open source REST API for geographical data that uses GRASS GIS

API KeyYesUnknown↗
administrative-divisons-db

Get all administrative divisions of a country

No authYesYes↗
adresse.data.gouv.fr

Address database of France, geocoding and reverse

No authYesUnknown↗
Airtel IP

IP Geolocation API. Collecting data from multiple sources

No authYesUnknown↗
Apiip

Get location information by IP address

API KeyYesYes↗