Web and APIs
What Is JSON?
Also called: JavaScript Object Notation
JSON (JavaScript Object Notation) is a lightweight text format for storing and exchanging data as key-value pairs and lists.
Definition
JSON is a plain-text format for structured data. It uses objects (key-value pairs in curly braces), arrays (lists in square brackets), strings, numbers, true, false and null.
Although it came from JavaScript, almost every language can read and write it, so it is the standard format for web APIs and many configuration files.
How it works
Keys must be strings in double quotes. Trailing commas and comments are not allowed, which are the most common causes of "invalid JSON" errors.
Turning data into JSON text is called serializing (JSON.stringify in JavaScript, json.dumps in Python). Reading it back is called parsing (JSON.parse, json.loads).