xiaohongshu
xiaohongshu
chgis-tgaz
Query the China Historical GIS (CHGIS) Temporal Gazetteer (TGAZ) API to search for historical Chinese placenames from 222 BCE to 1911 CE. Use this skill when searching for information about historical Chinese places, administrative units, or geographic locations during the dynastic period. Applic...
Full skill instructions
The CHGIS Temporal Gazetteer (TGAZ) skill enables querying the China Historical GIS database to search for historical Chinese placenames and administrative units from 222 BCE to 1911 CE. The API accepts UTF-8 encoded Chinese characters and Romanized transcriptions, making it accessible for searches in multiple languages.
Apply this skill when users:
Search for places using Chinese characters or Romanized names.
When to use: User provides a place name and wants to find matching records.
Basic approach:
import requests
# Basic search
url = "https://chgis.hudci.org/tgaz/placename"
params = {
"n": "beijing", # or "北京"
"fmt": "json"
}
response = requests.get(url, params=params)
data = response.json()
Example user requests:
Search for places as they existed in a specific historical year.
When to use: User specifies or implies a particular time period.
Approach:
# Search with specific year
params = {
"n": "suzhou",
"yr": "1820", # Use negative for BCE: "-100"
"fmt": "json"
}
response = requests.get(url, params=params)
Example user requests:
Important: The valid year range is -222 to 1911 (222 BCE to 1911 CE).
Search for specific types of administrative units.
When to use: User asks about a specific administrative level or type.
Approach:
# Search for a specific administrative type
params = {
"n": "suzhou",
"yr": "1820",
"ftyp": "fu", # Superior prefecture
"fmt": "json"
}
response = requests.get(url, params=params)
Common feature types:
xian (县) - Countyzhou (州) - Prefecturefu (府) - Superior prefecturesheng (省) - Provincedao (道) - Circuitlu (路) - Routejun (郡) - CommanderyExample user requests:
Search for places within a specific parent administrative unit.
When to use: User specifies a place within a broader geographic region.
Approach:
# Search within a parent unit
params = {
"n": "ningbo",
"ipar": "zhejiang", # Immediate parent
"yr": "1850",
"fmt": "json"
}
response = requests.get(url, params=params)
Example user requests:
Fetch a complete record when the unique TGAZ ID is known.
When to use: User provides or you've discovered a specific TGAZ ID.
Approach:
# Retrieve specific record
tgaz_id = "hvd_32180"
url = f"https://chgis.hudci.org/tgaz/placename/{tgaz_id}"
params = {"fmt": "json"}
response = requests.get(url, params=params)
ID format: TGAZ IDs use the prefix hvd_ (e.g., CHGIS ID 32180 becomes TGAZ ID hvd_32180)
Begin with simple queries and add parameters progressively:
First attempt: Basic placename only
params = {"n": "guangzhou", "fmt": "json"}
If too many results: Add year
params = {"n": "guangzhou", "yr": "1820", "fmt": "json"}
If still ambiguous: Add feature type or parent
params = {"n": "guangzhou", "yr": "1820", "ftyp": "fu", "fmt": "json"}
Always use UTF-8 encoding directly:
"n": "北京"The API accepts both Chinese and Romanized names:
"n": "beijing" and "n": "北京" both workAlways request JSON format for easier parsing:
params = {"n": "place_name", "fmt": "json"}
Without fmt=json, the API returns XML by default.
Faceted searches often return multiple records because:
Approach: Present all relevant results to the user or ask for clarification.
Records include:
If a search returns no results, try:
User asks about a place in a historical context.
# Example: "What was Yangzhou during the Qing dynasty?"
params = {
"n": "yangzhou",
"yr": "1750", # Mid-Qing approximate year
"fmt": "json"
}
User wants to understand administrative structure.
# Example: "What were the counties in Jiangsu in 1850?"
# First get Jiangsu, then search with it as parent
params = {
"n": "jiangsu",
"yr": "1850",
"ftyp": "sheng",
"fmt": "json"
}
# Then search for counties
params = {
"ipar": "jiangsu",
"yr": "1850",
"ftyp": "xian",
"fmt": "json"
}
User wants to verify a place name or identification.
# Example: "Is this the correct ID for Beijing?"
tgaz_id = "hvd_12345"
url = f"https://chgis.hudci.org/tgaz/placename/{tgaz_id}"
params = {"fmt": "json"}
Detailed API specifications, query parameters, and examples are available in:
references/api_reference.md - Complete API documentationWhen to read the reference:
import requests
def search_tgaz(placename, year=None, feature_type=None, parent=None):
"""
Search CHGIS TGAZ for historical placenames.
Args:
placename: Name of place (Chinese or Romanized)
year: Historical year (-222 to 1911)
feature_type: Admin type (xian, fu, zhou, etc.)
parent: Parent administrative unit
Returns:
JSON response from API
"""
url = "https://chgis.hudci.org/tgaz/placename"
params = {"n": placename, "fmt": "json"}
if year:
params["yr"] = str(year)
if feature_type:
params["ftyp"] = feature_type
if parent:
params["ipar"] = parent
response = requests.get(url, params=params)
response.raise_for_status()
return response.json()
def get_placename_by_id(tgaz_id):
"""
Retrieve specific placename record by TGAZ ID.
Args:
tgaz_id: TGAZ unique identifier (format: hvd_XXXXX)
Returns:
JSON response from API
"""
url = f"https://chgis.hudci.org/tgaz/placename/{tgaz_id}"
params = {"fmt": "json"}
response = requests.get(url, params=params)
response.raise_for_status()
return response.json()
# Example usage
results = search_tgaz("beijing", year=1800)
specific_record = get_placename_by_id("hvd_32180")
"fmt": "json" for easier parsingxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience