Two chained Open-Meteo requests, run in your browser.

Connect a place search to a weather forecast

To check a place’s weather, first turn its name into map coordinates. Then send those coordinates to the forecast service. This page makes those requests and shows their replies.

Loading Seattle…

1. Geocode 2. Forecast 3. Decide

…

Fetching Open-Meteo…

50% 20% 0% +1h 0% +2h 0% +3h 0% +4h 0% +5h 0% +6h

Select an hour or press Left/Right arrow keys to inspect its values.

Try another place

Your browser talks only to Open-Meteo to look up the weather. Pressing Use my location shares your rough coordinates with that weather request.

Starting default Seattle chain…

What the agent actually sees

The place search returns the coordinates that the weather request needs. That is how the two tools connect.

Tool 1: geocode

Step 1: Look up the city name to find its latitude and longitude.

Request URL

Waiting…

Trimmed JSON response

Waiting…

Tool 2: forecast

Step 2: Ask the weather service for the next 6 hours using those coordinates.

Request URL

Waiting…

Trimmed JSON response

Waiting…

Local rule (not an API)

The page checks the next 6 hours. It says Yes if any hour has at least a 50% chance of rain or 0.5 mm of rain. It says No if every hour stays under 20% and 0.1 mm. Anything in between is Maybe.

Local time Precip. probability (%) Precipitation (mm)

For teachers

Grade band: grades 9–12 / intro CS (estimated one class period).

Keyless student activity

Any modern browser, including Chromebooks.

  1. Open this page. Read the Seattle answer in the first screen (live or saved example).
  2. Scroll to “What the agent actually sees.” Copy the geocode request URL into a new tab and confirm the JSON includes latitude and longitude.
  3. Copy the forecast request URL into a new tab. Confirm hourly precipitation_probability and precipitation arrays.
  4. Use “City or coordinates” to run the chain for a second city. Write one sentence: what changed between tool 1 and tool 2?
  5. Optional: open the browser console and run the fetch snippet in the handout. No API key and no install.

Printable one-page handout (use your browser’s Print on that section).

Exit-ticket rubric

Score Student can…
3 Name both tools in order, point to lat/lon leaving geocode and entering forecast, and state the yes/no/maybe rule inputs.
2 Name both tools and describe chaining in plain words, with one specific field from the JSON.
1 Recognizes that two API calls happened, but cannot connect an output field to the next input.
0 No evidence of reading the request URLs or JSON.
If the school network blocks Open-Meteo

Press “Show saved example.” The full lesson still completes with a bundled Seattle recording. The banner will say “Showing a saved example.”

Student handout (one page)

Connect a place search to a weather forecast / Open-Meteo / Grades 9–12

  1. What two tools does the agent call, and in what order?
  2. Which fields from the geocode JSON become inputs to the forecast URL?
  3. For your second city, what was the answer (yes / no / maybe), and which peak numbers drove it?
  4. Console (optional, no key):
const g = await fetch('https://geocoding-api.open-meteo.com/v1/search?name=Seattle&count=1&language=en&format=json').then(r => r.json());
const { latitude, longitude } = g.results[0];
const f = await fetch('https://api.open-meteo.com/v1/forecast?latitude=' + latitude + '&longitude=' + longitude + '&hourly=precipitation_probability,precipitation&forecast_hours=6&timezone=auto').then(r => r.json());
console.log(g.results[0], f.hourly);

Weather data by Open-Meteo, CC BY 4.0.

Credits

Jonathan Simone, Simone Systems Research. First edition, October 2026.

Weather data by Open-Meteo, CC BY 4.0.

README / LICENSE

File details on this page

Format, size and a short SHA-256 identifier, measured when this page was built.