/install geocode
geocode
Resolve coordinates back to a place name.
Provider: https://geocode.com.cn via curl.
Current root response behavior:
GET https://geocode.com.cn/without params returns400 Bad Request- returns field labels for Chinese and English display
- demo:
https://geocode.com.cn/?lat=39.9042&lon=116.4074
Quick Start
{baseDir}/scripts/geocode.sh hint
{baseDir}/scripts/geocode.sh reverse 32.9042 110.805 --lang zh-CN
{baseDir}/scripts/geocode.sh reverse 37.819929 -122.478255 --lang en
When to Use
- "Reverse geocode 32.9042, 110.805"
- "Coordinates to address"
- "根据经纬度查地点"
- "把经纬度转成地址"
When NOT to Use
- Address/place name to coordinates (forward geocoding): use another provider
- Rich place details, reviews, opening hours, or POI metadata: use
goplaces - Routing, distance matrices, or navigation
- High-volume batch geocoding
Query Rules
- Pass decimal latitude and longitude.
- The endpoint supports reverse geocoding only via
GET /?lat=\x3Clatitude>&lon=\x3Clongitude>. - A bare root request returns a field-label hint payload describing the reverse-geocode result columns.
accept-languagemay still be passed, but the documented contract on the site only guaranteeslatandlon.
Config
GEOCODE_BASE_URLoptionally points at another endpoint for testing or self-hosting.GEOCODE_USER_AGENToverrides the default identifyingUser-Agent.
Public API Limits
- Use public endpoints only for low-frequency, interactive lookups.
- Send an identifying
User-Agent; do not use default curl UA for repeated calls. - Do not loop, bulk geocode, or aggressively retry against the public endpoint.
Commands
Scripted Reverse Geocode
{baseDir}/scripts/geocode.sh reverse 32.9042 110.805 --lang zh-CN
{baseDir}/scripts/geocode.sh reverse 37.819929 -122.478255 --lang en
Raw Reverse Geocode
curl --get 'https://geocode.com.cn/' \
-A 'openclaw-geocode-skill/1.0 (interactive use)' \
--data 'lat=32.9042' \
--data 'lon=110.805'
Scripted Root Hint
{baseDir}/scripts/geocode.sh hint
Raw Root Hint Response
curl -iL 'https://geocode.com.cn/'
Current response body:
{
"demo": "https://geocode.com.cn/?lat=25.7433&lon=123.4733",
"zh": ["国家/地区", "省", "市", "县", "乡镇/街道"],
"en": ["Country", "admin1", "admin2", "", "name"]
}
Response Shape
Successful responses return a compact JSON array, not an object. The root hint now documents five display fields instead of the old six-field output description.
Fixed order mapping:
- index
0:Country/国家/地区 - index
1:admin1/省 - index
2:admin2/市 - index
3: county-level field when present /县 - index
4:name/乡镇/街道
Example:
["CN", "Taiwan Province", "Yilan County", "Toucheng Township", ""]
What to Return
- The original coordinates
- Best available locality/region text assembled from
name, county,admin2, andadmin1 - Country or region value when present
- A note that some positions may be empty, especially the county or
nameslot over water or remote areas - A short note if any fields are empty
Notes
- The bundled script prints raw JSON to stdout and keeps dependencies to
curlonly. searchis intentionally unsupported because geocode.com.cn explicitly says it only supportsGET /?lat=\x3Clatitude>&lon=\x3Clongitude>.- If the user needs address-to-coordinate lookup, switch to a forward-geocoding provider instead of this endpoint.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install geocode - 安装完成后,直接呼叫该 Skill 的名称或使用
/geocode触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
geocode 是什么?
Reverse geocode latitude/longitude to a human-readable region using geocode.com.cn. Triggers on reverse geocode, lat/lng, latitude/longitude, coordinates to... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 308 次。
如何安装 geocode?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install geocode」即可一键安装,无需额外配置。
geocode 是免费的吗?
是的,geocode 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
geocode 支持哪些平台?
geocode 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 geocode?
由 jvy(@jvy)开发并维护,当前版本 v1.0.4。