---
title: "Geocode City (birthplace → coordinates + timezone)"
method: GET
path: "/api/trpc/geocode.city"
tags: ["Product"]
---

# Geocode City (birthplace → coordinates + timezone)

`GET /api/trpc/geocode.city`

## Request

- Base URL: `https://api.asktian.com`
- URL: `https://api.asktian.com/api/trpc/geocode.city`
- Auth: HTTP bearer

The shared place-resolution utility: a free-text city (or 'City, Region, Country', or a native-script name like 上海/서울/東京) → { latitude, longitude, timezone (IANA), tzOffset (hours, DST-CORRECT for the given date), label, country, admin1, population, source, resolved, triedVariants }. Codifies what asktian.com home validated: (1) LOCALE DETECTION — a CJK name must be queried in its own language or the geocoder returns nothing, so the query language is auto-detected from the script (Han→zh, kana→ja, Hangul→ko, else en) with an en fallback; (2) a VARIANT-FALLBACK LADDER — progressively looser forms ('Nanchang, Jiangxi, China' → 'Nanchang'; 'Jiang Xi' → 'Jiangxi', full-width commas handled) until one resolves; (3) DATE-AWARE OFFSET — the IANA timezone is converted to a UTC offset FOR THE GIVEN date (pass the birth date), so DST is correct for that day incl. historical rules (a summer-1990 China birth is +9, not +8). Primary source is open-meteo (keyless, global, CJK-aware, fail-soft ~8s); falls back to a bundled gazetteer of major cities when the network is unavailable or open-meteo misses (source tells you which). A utility for the OTHER readings' accuracy — resolve once and CACHE latitude/longitude/tzOffset on the profile; never re-geocode per read (re-geocode only when the user edits their birthplace). Not a divination system → absent from the catalogue by design.

Cost: 1 TIAN Points per call. tRPC procedure `geocode.city`.

## Query parameters

- `input` string

## Response `200`

tRPC result envelope

- TrpcResult: tRPC HTTP response envelope.
  - `result` object
    - `data` object: The procedure's return value (system-specific).

---

[API](https://skmtc.dev/asktian/apis/asktian-metaphysics-api.md) · [All operations](https://skmtc.dev/asktian/apis/asktian-metaphysics-api/llms.txt) · [OpenAPI document](https://skmtc.dev/asktian/apis/asktian-metaphysics-api/revisions/3c8fdc979206?raw)
