Geocode for Openclaw

A lightweight reverse geocoding utility that converts latitude and longitude coordinates into human-readable place names and administrative regions.

jvy
v1.0.4
Mar 21, 2026
0
1k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install geocode

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install geocode using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Geocode?

The Geocode skill is a specialized tool designed to transform decimal coordinates into structured location data. By leveraging the geocode.com.cn API via curl, it provides a fast and reliable way for developers and AI agents to understand the geographical context of a specific set of coordinates. This skill is a core component for those building location-aware applications within the ecosystem of Openclaw Skills.

It specifically focuses on reverse geocoding, making it ideal for scenarios where you have GPS data but need to know the country, province, city, or street name. The skill is optimized for low-frequency, interactive lookups and provides responses in both English and Chinese labels, ensuring broad usability across different regions.

Geocode Use Cases

  • Converting raw GPS coordinates from mobile devices or logs into readable address strings.
  • Identifying the specific administrative region (such as province, city, or county) of a latitude/longitude point.
  • Enriching dataset metadata with human-readable location names for better data visualization.
  • Supporting multilingual applications that require location lookups in both Chinese and English.

How Geocode Works

  1. The user or agent provides decimal latitude and longitude coordinates as input.
  2. The skill initiates a GET request to the geocode.com.cn provider using a specialized curl command.
  3. The provider processes the coordinates and returns a compact JSON array containing five levels of geographical data.
  4. The skill maps the returned indices to specific fields: Country, Admin1, Admin2, County, and Name.
  5. A formatted response is generated, synthesizing the locality text into a user-friendly format for the Openclaw Skills environment.

Geocode Setup

To integrate this functionality into your Openclaw Skills setup, ensure you have curl installed on your system. You can perform lookups using the provided shell scripts or raw API calls.

# Scripted reverse geocode example
./scripts/geocode.sh reverse 32.9042 110.805 --lang zh-CN

# Raw curl command for manual lookups
curl --get 'https://geocode.com.cn/' \
  -A 'openclaw-geocode-skill/1.0 (interactive use)' \
  --data 'lat=37.819929' \
  --data 'lon=-122.478255'

Geocode Data Schema & Taxonomy

The skill returns a compact JSON array. Unlike standard object-based APIs, this allows for high-speed parsing within Openclaw Skills by following a fixed index mapping:

Index Field (English) Field (Chinese) Description
0 Country 国家/地区 The top-level country or region code
1 admin1 省 Primary administrative division (e.g., Province)
2 admin2 市 Secondary administrative division (e.g., City)
3 County 县 Local county or district level
4 Name 乡镇/街道 Most specific locality name available

Note: In remote areas or over water, some fields (particularly County or Name) may return empty strings.

Geocode Advanced Features

  • Custom Endpoint Support: Use the GEOCODE_BASE_URL environment variable to point at self-hosted or proxy endpoints.
  • User-Agent Control: Override default identifiers with GEOCODE_USER_AGENT to meet specific API provider requirements.
  • Multilingual labels: Support for both English and Chinese field labels out of the box.
  • Root Hinting: Built-in hint command to verify the current API response structure and ensure compatibility.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Requires
Bins curl
Github Stars: 0
forks: 0

Featured*