JSON: lunchboxes for data | Master AI Automation in 4 hours Master AI Automation in 4 hours Course About Ayush Modules Sample chapter Toolbox The Microcap Minute Classroom / Module 04: APIs: How Software Talks / Chapter 2 JSON: lunchboxes for data Watch first, then read. Same lesson, your pace. What you will learn – What JSON looks like and why APIs chose it – Objects, arrays, key-value pairs, the whole grammar – Reading any JSON without fear The standard tiffin When an API sends data, it can’t send “a feeling about the weather”, it must pack information so any program on earth can unpack it. The universal lunchbox is JSON (JavaScript Object Notation): text formatted as labelled containers. { “city”: “Mumbai”, “temperature”: 31, “raining”: false, “forecast”: [“sunny”, “humid”, “rain”] } That’s not code to run, it’s just very organised text. And it’s everywhere: API responses, config files, MCP servers, automation tools. Learning to read it is maybe twenty minutes and pays forever. The entire grammar Four building blocks, that’s genuinely all: Block Looks like Meaning Object { … } A box of labelled things Key-value pair “city”: “Mumbai” Label on the left, contents on right Array [ … ] A list, order preserved Value types 31 , false , “text” , nested {} Number, boolean, string, or another box Boxes nest inside boxes, that’s how real data looks: { “student”: { “name”: “Ravi”, “class”: 8 }, “subjects”: [ { “name”: “Maths”, “score”: 92 }, { “name”: “Science”, “score”: 88 } ] } Read aloud: “student is a box containing name and class; subjects is a list; each item in the list is a box with name and score.” If you said that sentence correctly, congratulations, you read JSON. Why you’ll love it Three practical payoffs arriving soon in this course: AI outputs on demand : ask any model “return ONLY valid JSON with keys title, summary, tags” and its answer becomes directly loadable into spreadsheets and scripts (Module 8 leans hard on this). API responses become navigable : Chapter 4’s curl calls return JSON; you’ll skim them like menus instead of squinting like walls of text. Config files stop being scary : MCP servers (Module 5), VS Code, OpenCode, half the software world, configured through little JSON files you’ll now edit confidently. Formatting tip: raw API JSON often arrives as one ugly line. Paste it into jsonlint.com or ask any AI “format this JSON”, indentation restores sanity instantly. Try it yourself Ask Kimi: Return only valid JSON representing my week: keys monday..sunday, each with keys plan (string) and hours (number). Paste the result into a file called week.json . Then reverse-engineer: hand-write JSON describing your school bag (object with array of items, each item an object with name and category). Validate both at jsonlint.com. One generated, one authored, you’ve now done both directions. Key takeaways – JSON = labelled text boxes: objects {} , pairs, arrays [] , values. – Boxes nest; reading them aloud is the trick to understanding them. – Asking AI for “only valid JSON” turns chat into structured data. – It’s the format of API responses, configs and MCP, reading it unlocks Modules 5-8. Download the exercise sheet (PDF) Module workbook (PDF) โ Prev: The waiter in the restaurant Next: Keys, secrets and .env files โ Classroom / Module 04: APIs: How Software Talks / Chapter 2 JSON: lunchboxes for data What you will learn – What JSON looks like and why APIs chose it – Objects, arrays, key-value pairs, the whole grammar – Reading any JSON without fear The standard tiffin When an API sends data, it can’t send “a feeling about the weather”, it must pack information so any program on earth can unpack it. The universal lunchbox is JSON (JavaScript Object Notation): text formatted as labelled containers. { “city”: “Mumbai”, “temperature”: 31, “raining”: false, “forecast”: [“sunny”, “humid”, “rain”] } That’s not code to run, it’s just very organised text. And it’s everywhere: API responses, config files, MCP servers, autom
JSON: lunchboxes for data
Written by
in