OpenCage
使用开放数据进行正向和反向地理编码
- 认证方式
- API Key
- HTTPS
- Yes
- CORS
- Yes
- 分类
- 地理编码
- 文档 / URL
- https://opencagedata.com
简介
OpenCage 从多个开放数据源提供正向/反向地理编码,全球覆盖。认证是 API 密钥(无效密钥返回 401 带详细错误体,已实测)。
快速开始
正向地理编码(替换 YOUR_KEY):
curl "https://api.opencagedata.com/geocode/v1/json?key=YOUR_KEY&q=paris"
{
"results": [
{
"formatted": "Paris, France",
"geometry": { "lat": 48.8566, "lng": 2.3522 },
"components": { "city": "Paris", "country": "France", "country_code": "fr" },
"confidence": 10
}
],
"status": { "code": 200, "message": "OK" }
}
反向:
curl "https://api.opencagedata.com/geocode/v1/json?key=YOUR_KEY&q=48.8566%2C2.3522"
认证方式
- 在 opencagedata.com 注册 → 免费 API 密钥(在控制台)。
- 通过
key查询参数携带(无效密钥 → 401,已实测)。
速率限制与注意事项
- 免费层:2,500 次请求/天(以当前文档为准);付费档可扩展。
- 聚合 OSM、OpenAddresses 和其他开放源——带按源归属。
- 每个结果带
confidence(0-10)和annotations富化。 - 欧洲数据比一些竞品更强;支持 100+ 国家。
常见问题
OpenCage 免费吗? 免费层:2,500 次/天;更多需要付费。
如何获取密钥? 在 opencagedata.com 注册——密钥在控制台。
用什么数据源? OpenStreetMap、OpenAddresses 和其他开放数据。
地理编码 分类更多
| API | Auth | HTTPS | CORS | |
|---|---|---|---|---|
| Actinia Grass GIS Actinia is an open source REST API for geographical data that uses GRASS GIS | API Key | Yes | Unknown | ↗ |
| administrative-divisons-db Get all administrative divisions of a country | No auth | Yes | Yes | ↗ |
| adresse.data.gouv.fr Address database of France, geocoding and reverse | No auth | Yes | Unknown | ↗ |
| Airtel IP IP Geolocation API. Collecting data from multiple sources | No auth | Yes | Unknown | ↗ |
| Apiip Get location information by IP address | API Key | Yes | Yes | ↗ |