1 / 8
📄 Lesson: What is JSON?
Understanding JSON Structure & Syntax
Learning Objectives:
📋 What JSON stands for and what it is
🏗️ Understand JSON's two main structures
🔤 Learn JSON data types
📝 Master JSON syntax rules
🤔 What is JSON?
JSON = JavaScript Object Notation
- 📝 Text-based data format - Just plain text
- 🌐 Language independent - Works with any programming language
- 📱 Lightweight - Minimal syntax, easy to read
- 🔄 Data exchange standard - How systems share information
Important: Despite the name "JavaScript", JSON is used by ALL programming languages - Python, Java, C#, PHP, etc.
🏗️ JSON Has Only 2 Structures
Everything in JSON is built from these two simple structures:
📦 OBJECTS
Collection of key-value pairs
{ "key": "value" }
📋 ARRAYS
Ordered list of values
[ "value1", "value2" ]
That's it! Every JSON document is either an object, an array, or a combination of both.
📦 JSON Objects
Objects store data as key-value pairs inside curly braces { }
Object Rules:
• Wrapped in curly braces { }
• Keys must be strings (in quotes)
• Key and value separated by colon :
• Pairs separated by commas ,
📋 JSON Arrays
Arrays store ordered lists of values inside square brackets [ ]
Array Rules:
• Wrapped in square brackets [ ]
• Values separated by commas ,
• Can contain any data type
• Order matters (first, second, third...)
🔤 JSON Data Types
JSON supports exactly 6 data types:
String
"GBPUSD"
Number
1.35084
Boolean
true/false
Null
null
Object
{ }
Array
[ ]
📝 JSON Syntax Rules
JSON has strict rules that must be followed:
- ✅ Keys must be strings - Always in double quotes
- ✅ Use double quotes - Never single quotes
- ✅ No trailing commas - Last item has no comma
- ✅ No comments allowed - Pure data only
- ✅ Case sensitive - "Symbol" ≠ "symbol"
🎯 What You've Learned
JSON Structure Fundamentals:
- ✅ JSON = JavaScript Object Notation
- ✅ Two main structures: Objects { } and Arrays [ ]
- ✅ Six data types: string, number, boolean, null, object, array
- ✅ Strict syntax rules must be followed
🚀 Next: We'll see how this structure works with real trading data!