← Back to Skills Marketplace
jvy

geocode

by jvy · GitHub ↗ · v1.0.4 · MIT-0
cross-platform ✓ Security Clean
308
Downloads
0
Stars
2
Active Installs
5
Versions
Install in OpenClaw
/install geocode
Description
Reverse geocode latitude/longitude to a human-readable region using geocode.com.cn. Triggers on reverse geocode, lat/lng, latitude/longitude, coordinates to...
README (SKILL.md)

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 returns 400 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-language may still be passed, but the documented contract on the site only guarantees lat and lon.

Config

  • GEOCODE_BASE_URL optionally points at another endpoint for testing or self-hosting.
  • GEOCODE_USER_AGENT overrides the default identifying User-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, and admin1
  • Country or region value when present
  • A note that some positions may be empty, especially the county or name slot 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 curl only.
  • search is intentionally unsupported because geocode.com.cn explicitly says it only supports GET /?lat=\x3Clatitude>&lon=\x3Clongitude>.
  • If the user needs address-to-coordinate lookup, switch to a forward-geocoding provider instead of this endpoint.
Usage Guidance
This skill appears to do exactly what it says: small bash script that issues GET requests to https://geocode.com.cn/ to reverse-geocode coordinates. Before installing, note that (1) the script makes outbound HTTPS requests to the provider — don't pass sensitive coordinates you don't want sent to that service, (2) GEOCODE_BASE_URL can be set to point to another host (use only trusted endpoints), and (3) respect the provider's usage guidance (no bulk/batched high-volume lookups). No secrets or broad system access are requested.
Capability Analysis
Type: OpenClaw Skill Name: geocode Version: 1.0.4 The geocode skill is a legitimate utility for reverse geocoding coordinates using the geocode.com.cn API. The bash script (scripts/geocode.sh) includes proper input validation for latitude and longitude using regex, uses safe argument passing for curl to prevent injection, and follows standard configuration patterns via environment variables. No evidence of data exfiltration, malicious execution, or prompt injection was found.
Capability Assessment
Purpose & Capability
Name/description are consistent with the included script and SKILL.md. The only required binary is curl (declared), and optional env vars (GEOCODE_BASE_URL, GEOCODE_USER_AGENT) are directly relevant to choosing the endpoint and user-agent.
Instruction Scope
SKILL.md and scripts instruct only to call the provider's root or reverse endpoint and to assemble a short response. The script does not read unrelated files, does not attempt to access other credentials, and does not transmit data to unexpected endpoints by default. Note: the user-configurable GEOCODE_BASE_URL means a user (or operator) could point requests at a different host, which would then receive coordinates — this is expected behavior but worth being aware of.
Install Mechanism
No install spec; this is an instruction-only skill with one small bash script bundled. Nothing is downloaded or extracted at install time.
Credentials
The skill requires no credentials and only optionally honors GEOCODE_BASE_URL and GEOCODE_USER_AGENT. The requested environment access is minimal and proportional to the stated function.
Persistence & Privilege
The skill is user-invocable, not always-enabled, and does not request persistent or elevated privileges or modify other skills or system settings.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install geocode
  3. After installation, invoke the skill by name or use /geocode
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.4
- Root API hint response now describes a five-field display format (previously six fields). - Chinese and English field labels are included in the hint response for improved clarity. - Response mapping updated: now structured as [Country, admin1, admin2, county, name]. - Documentation reflects these API updates and clarifies which fields may be empty, especially for remote or ambiguous locations. - No code changes; this update is documentation only.
v1.0.3
- Updated documentation to clarify the required API parameters and current error message for root endpoint usage. - Added explicit guidance on using GET /?lat=<latitude>&lon=<longitude>, including demo and hint commands. - Expanded response array documentation with new indices, now including normalized coordinates. - Provided examples of error and success responses from the current API. - Removed homepage field from metadata for consistency with service capabilities.
v1.0.2
**Reverse geocoding only; forward geocoding removed.** - Now supports only reverse geocoding (coordinates to place name) using geocode.com.cn. - All forward geocoding triggers, logic, and documentation removed; use another provider for address-to-coordinates. - Updated documentation to clarify accepted triggers, examples, and API limits. - Response is now a compact array with a fixed order for place name, region, and country code. - Notes and usage sections streamlined to reflect the new single-focus functionality.
v1.0.1
- Switched geocoding provider reference from Nominatim/OpenStreetMap API to geocode.com.cn in documentation and examples. - Updated service description and homepage URL to match the new provider. - Adjusted usage recommendations, config, and usage limits to reflect generic/public endpoints instead of Nominatim-specific details. - Example raw curl commands now point to the new provider for reverse geocoding; forward search examples still reference Nominatim as illustration. - No file changes detected in code; this update concerns documentation only.
v1.0.0
Initial release: convert place names/addresses to coordinates (and vice versa) using the public Nominatim (OpenStreetMap) API via curl. - Supports both forward and reverse geocoding. - Triggers on multiple English and Chinese keywords for geocoding tasks. - Includes command-line and raw curl examples for usage. - Geocoding results are returned as JSON; latitude, longitude, and normalized place names provided. - Usage guidelines clarify when to use or avoid the skill and note public API limits.
Metadata
Slug geocode
Version 1.0.4
License MIT-0
All-time Installs 2
Active Installs 2
Total Versions 5
Frequently Asked Questions

What is geocode?

Reverse geocode latitude/longitude to a human-readable region using geocode.com.cn. Triggers on reverse geocode, lat/lng, latitude/longitude, coordinates to... It is an AI Agent Skill for Claude Code / OpenClaw, with 308 downloads so far.

How do I install geocode?

Run "/install geocode" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is geocode free?

Yes, geocode is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does geocode support?

geocode is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created geocode?

It is built and maintained by jvy (@jvy); the current version is v1.0.4.

💬 Comments