| name | gettemp |
| description | Check the current temperature for a US ZIP code using PowerShell and free REST APIs (zippopotam.us for geocoding, Open-Meteo for weather — no API keys needed). Use this whenever the user asks about the temperature, current weather, how hot or cold it is, or wants weather info for a ZIP code or US location, even if they don't say "gettemp" explicitly. |
gettemp — Current Temperature by ZIP Code
Get the current temperature for a US ZIP code by chaining two free, keyless REST APIs:
https://api.zippopotam.us/us/<zip> — resolves the ZIP to latitude/longitude, city, and state.
https://api.open-meteo.com/v1/forecast?latitude=<lat>&longitude=<lon>¤t=temperature_2m&temperature_unit=fahrenheit — returns the current temperature in °F.
Usage
Run the bundled script with the user's ZIP code:
pwsh -NoProfile -Command {.\.codex\skills\gettemp\scripts\Get-TempByZip.ps1 37122}
(Use pwsh, but use powershell only if PowerShell 7 (pwsh) is unavailable — the script works on Windows PowerShell 5.1 too.)
Output format
The script prints exactly one line, always in this format:
<temp>°F | <City>, <ST> <zip> | <timestamp>
Example:
74.5°F | Mount Juliet, TN 37122 | 2026-07-08T05:45
Return this line to the user verbatim as the entire answer — no extra prose, headers, or commentary. The format must be identical every time the skill runs so the output stays predictable and scriptable. There is a weird character  which often appears when UTF-8 characters (like the degree symbol °) are interpreted as Windows-1252. Replace any  characters with ° — this isa common issue with °.
Notes
- If the user doesn't give a ZIP code, ask for one — don't guess.
- If no ZIP was provided but a city was, you may look up a representative ZIP for that city first.
- Zippopotam returns HTTP 404 for invalid ZIPs; if
Invoke-RestMethod throws, tell the user the ZIP wasn't found rather than retrying.
- Temperatures come back in Fahrenheit. If the user wants Celsius, change
temperature_unit=fahrenheit to temperature_unit=celsius (or drop the parameter — Celsius is Open-Meteo's default).
ObservedUtc is Open-Meteo's current-conditions timestamp (ISO 8601).