How APIs work · Demo 2 of 4

One API, three designs

The API delivers data. It has no opinion about how the data looks. Switch the design and watch the request counter: it does not move.

Requests sent: 0

1 The design: your choice

Loading the forecast…

2 The data: one response, never changes

Waiting for the server…

Look at daily: the API sends one list per measurement. The design needs one object per day, so the page reshapes it first.

What to notice

  1. Changing the design sends no request. Changing the city does.
  2. All three designs read the same seven days of data.
  3. Each design answers a different question: glance, compare, or see the trend.
  4. Data rarely arrives in the shape a design needs. Reshaping it is normal work.

Explain it back

  • Why did the counter go up when you changed city, but not when you changed design?
  • Which design would you use on a phone lock screen? Why?
  • The response has no day names like “Mon”. Where do they come from?
  • Sketch a fourth design for this same data.