The example
The JSON above is the example. Explore it in the Tree tab, press Download to save it as a .json file, or Share to send someone a link to it. All names, ids, emails and values are invented.
Fields explained
| Path | Type | Notes |
|---|---|---|
location | object | Place details including the timezone name. |
current | object | A snapshot of the conditions now. |
forecast | array of objects | One entry per day, ideal for a chart. |
units | object | Stating units explicitly avoids misreading 12 as Celsius or Fahrenheit. |
Read it in code
JavaScript:
const highs = data.forecast.map((d) => d.maxC); // [12, 10, 9]Python:
highs = [d["maxC"] for d in data["forecast"]] # [12, 10, 9]What this example is good for
- Building a weather widget or dashboard
- Drawing a chart of minC and maxC
- Mocking an external API in tests
Tips
- Include units in key names (temperatureC) or in a units object.
- Send timestamps in UTC and convert to the viewer's timezone in the client.
Convert this example
Open it in a converter, then switch the output in the Code tab:
- JSON to TypeScript
- JSON to Zod
- JSON to Python (Pydantic)
- JSON to Go
- JSON to JSON Schema
- JSON to CSV
- JSON to YAML
- JSON to XML