PASS WITH FIXESTested on Composer 2.5, , result: PASS WITH FIXES.We built this tracker from the prompt and ran it on live Kalshi weather markets, the Kalshi weather index and NWS forecasts, then scored it with settle.py. Kalshi demo orders were not run (paper log only): no real keys, orders or money. The prompt below includes the fixes from that run.
Short answer:Kalshi and Polymarket US temperature markets settle on official sources: Polymarket US uses the NWS Daily Climate Report from the local forecast office, and each Kalshi market names its source in rules_primary. This recipe builds a paper-mode bot that pulls the free NWS API plus Kalshi's public weather index and logs what your rule would do, measured against the settlement source.
Polymarket US temperature contracts settle on the official NWS Daily Climate Report (CLI) from the local forecast office, e.g. New York City = KNYC (Central Park), Chicago = KMDW (Midway). Settlement is 8:00 AM ET the next day (may slip to 11:00 AM ET for review).
Kalshi publishes a weather index behind its hourly temperature markets: GET /live_data/weather/{city} (e.g. miami), minute-resolution, °F rounded to 0.01. Public, no auth.
Kalshi market rules (rules_primary on GET /markets/{ticker}) name each market's exact source. Read them; don't assume they match Polymarket's.
Free forecast data: the US National Weather Service API at https://api.weather.gov (requires a User-Agent header identifying your app).
Paper mode: Kalshi demo for orders, a local ledger for Polymarket US.
DifficultyIntermediate
Time3 hours
Cost$0
Works withClaude Code, Cursor, ChatGPT / Codex, Grok
What will you build?
A paper-mode bot that tracks temperature markets for a city, pulls the relevant forecast and observations, and logs what your rule would do, measured against the official settlement source.
Who is it for?
Data-minded builders. Weather markets have public, official settlement data, which makes them great for learning to test a bot honestly.
Not for:Anyone who thinks a free forecast is an edge. Everyone else can read it too.
What prompt do you paste into your AI coding tool?
Works in Claude Code, Cursor, Codex/ChatGPT, Grok or any agent that can write files. Paste it into an empty folder. Read what it builds before you run anything.
Build a PAPER-MODE weather market tracker/bot in Python for one city.
Use only documented endpoints; ask me if unsure.
Data sources:
- Kalshi (public): GET https://external-api.kalshi.com/trade-api/v2/markets
(filter by series_ticker or event_ticker that I put in config.toml),
GET /markets/{ticker} (read rules_primary and *_dollars prices),
GET /live_data/weather/{city}?last_sec=86400 (Kalshi weather index, °F).
- Polymarket US (public): GET https://gateway.polymarket.us/v1/search
?query=<city> temperature, then GET /v1/markets/{slug}/bbo.
- NWS: https://api.weather.gov (send a User-Agent header with my app name and
email from config). Use /points/{lat},{lon} to find the forecast URL, then
fetch the forecast.
Logic:
- For each tracked market, store: market id, threshold/condition parsed
from the market text (show me the parse; if unsure, mark "needs review"),
handling Kalshi title formats such as "Will the maximum temperature be
>67° on Oct 19, 2026?" (no F after the degree sign) as well as "above 88F";
write a parse_threshold test for each format,
current YES bid/ask, latest forecast, latest observed index value.
- strategy.py: MY placeholder rule using a configurable margin between my
own probability estimate and the market price. Keep it explainable.
- risk.py: limits.json + KILL file, same as the BotCookery Safety Pack.
- Paper execution: Kalshi -> optionally place orders on the DEMO exchange
(https://external-api.demo.kalshi.co/trade-api/v2, POST
/portfolio/events/orders, demo keys from env); Polymarket US -> local
paper ledger only (simulate at the ask, limited by displayed size).
- settle.py: the next day, record the official result I enter (or that
the market shows as settled) and score each paper decision. Brier score
for my probability estimates.
- Log everything to logs/. Tests for parsing and scoring.
Show the plan first.
How do you build it, step by step?
Pick one city that both venues list (check Polymarket US's Weather FAQ table and Kalshi's markets). Note each venue's settlement source for it.
Read the rules. For each market, read rules_primary (Kalshi) and the market description (Polymarket US). Write down the station, the report, the time window and how ties are handled.
Paste the prompt in a fresh folder with the Safety Pack. Set your NWS User-Agent (app name + email) in config.
Check the parser. The bot must correctly read each market's threshold. Kalshi titles look like Will the maximum temperature be >67° on Oct 19, 2026?, often with no F after the degree sign, so make sure there's a test for that form. Anything it isn't sure about is "needs review" and never traded, even on paper.
Run daily for 2–4 weeks in paper mode. Run settle.py each morning after settlement.
Look at your Brier score and paper PnL after fees. If your estimates aren't clearly better calibrated than the market's prices, you have your answer.
How do you test it in paper or demo mode first?
Kalshi: optional orders on the demo exchange (mock funds, separate keys). Weather markets on demo may not mirror production prices, so score your estimates against real outcomes rather than trusting demo PnL.
Polymarket US: local paper ledger simulating fills at the ask with displayed size.
Scoring: log every probability you estimate and compute a Brier score against outcomes. That's the honest test of whether the model behind your rule is any good.
What safety checks does it need before real money?
Tick every box before the bot touches real money. The full rules file, .gitignore and pre-commit hook are in the Safety Pack.
Key handling: API keys and private-key files live in environment variables or a secrets manager. Never in code, prompts, chat logs, screenshots or git. .env and *.pem are in .gitignore, and your AI tool is blocked from reading them (see the Safety Pack).
Position limits: hard caps in config (max contracts per order, max total exposure, max daily loss). The bot refuses any order above them, and the caps are checked in code, not just in the prompt.
Kill switch: one command or one file (touch KILL) stops new orders immediately, and a second command cancels every resting order through the venue's cancel-all endpoint.
Paper first: paper or demo mode is the default. Live trading needs an explicit --live flag and a typed confirmation, and you only flip it after days of clean paper logs.
Never trade a market whose threshold or settlement source your code couldn't parse with confidence.
Send a proper User-Agent to api.weather.gov and keep polling modest; it's a free public service.
Weather markets resolve on specific stations and reports. A city-wide forecast isn't the same thing as the settlement station's reading.
Endpoints and rules were checked against these pages on Oct 19, 2026. APIs change, so if something here disagrees with the official docs, trust the docs and tell us.
Frequently asked questions
How are Polymarket US weather markets settled?
According to Polymarket US's Weather FAQ, temperature contracts settle on the official NWS Daily Climate Report (CLI) from the local Weather Forecast Office, for a named station (for example KNYC Central Park for New York City). Settlement happens at 8:00 AM ET the next day, possibly delayed to 11:00 AM ET for review.
Does Kalshi have a weather API?
Kalshi's API includes a weather index endpoint, GET /live_data/weather/{city}, that returns the minute-resolution temperature index behind its hourly temperature markets, in Fahrenheit. Check each market's rules for its exact settlement source.
Is a weather bot profitable?
We don't know, and nobody can promise it. Forecasts are public, so markets often price them in. A paper-mode bot with honest scoring is how you find out for yourself without risking money.
The Daily Bot Recipe
One new build recipe, one safety tip, and API changes worth knowing about. Free. No picks, ever.
A copy-paste AI prompt and step-by-step guide to the Polymarket US API: public market data with no key, then authenticated reads. Includes the international Gamma API, read-only, with a geoblock check.
Step-by-step: use Claude Code to build a Polymarket US trading bot that runs in paper mode by default, with a local paper ledger, order preview, hard position limits and a kill switch.
Get started with the Kalshi API using an AI coding tool: public market data with no key, then RSA-PSS or Ed25519 signed requests against the Kalshi demo environment. Endpoints checked against the official docs.