技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
geo-places【数据与研究】Use when a task needs live geographic lookups - "geocode this address", "what's at these coordinates" (reverse geocoding), "lat/lon for this city", "which country/state is this ZIP or postal code in", or "country facts: capital, currency, population, flag". Nominatim (OpenStreetMap) is the geocoding default; Zippopotam for postal codes; APICountries …
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Turn place names, addresses, coordinates, and postal codes into structured geography with keyless APIs. The mistake this prevents: reaching for the Google Maps/Places API from training memory - key-walled, billing-enabled - when Nominatim answers the same lookup free, or stalling on which of the dozens of directory-listed geocoders actually works.
lat/lon come back as JSON strings, not numbers. Parse before arithmetic.Ask the user only if missing: the place/coordinate input itself, and country context for ambiguous names ("Springfield" - default: take Nominatim's top-ranked hit and say which one it was).
Geocode (search):
https://nominatim.openstreetmap.org/search?q={URL-encoded query}&format=jsonv2&limit=1
[{"lat":"48.8582599","lon":"2.2945006","name":"Tour Eiffel",
"display_name":"Tour Eiffel, 5, Avenue Anatole France, ..., 75007, France",
"category":"man_made","type":"tower","importance":0.62}]
Top-level is an array; empty array = no match. Add &addressdetails=1 for a structured address object, &countrycodes=us to constrain the country.
Reverse geocode:
https://nominatim.openstreetmap.org/reverse?lat={lat}&lon={lon}&format=jsonv2
Returns a single object (not an array): display_name, plus address.{road,city,state,postcode,country_code} with &addressdetails=1 (on by default for reverse).
City name → lat/lon (when you don't need full addresses):
https://geocoding-api.open-meteo.com/v1/search?name={city}&count=1
{"results":[{"name":"Berlin","latitude":52.52437,"longitude":13.41053,
"country_code":"DE","timezone":"Europe/Berlin","population":3426354}]}
No results key at all when nothing matches - check for the key, not an empty array.
Postal code:
https://api.zippopotam.us/{country}/{code} ← e.g. /us/90210, /de/10115
{"country":"United States","places":[{"place name":"Beverly Hills",
"state":"California","state abbreviation":"CA","latitude":"34.0901","longitude":"-118.4065"}]}
Gotchas: keys contain spaces ("place name", "post code"); coordinates are strings; unknown codes return 404 with an empty body, not JSON.
Country facts:
https://www.apicountries.com/name/{name} ← fuzzy, returns array
https://www.apicountries.com/alpha/{code} ← ISO alpha-2/alpha-3, returns object
[{"name":"Japan","capital":"Tokyo","region":"Asia","population":126476461,
"currencies":[{"code":"JPY","symbol":"¥"}],"languages":[{"name":"Japanese"}],
"alpha2Code":"JP","flags":{"png":"https://flagcdn.com/w320/jp.png"}}]
The structured result (coordinates as numbers, address parts, or country facts) plus the exact URL used. For batches: the loop actually throttled, with the rate stated.
Sourced and liveness-verified from the public-apis project (MIT).