🧠 What is JSON?
Knowledge Series #46: Everything you need to know about JSON. What it is, how it works and more.
🔒The Knowledge Series is a collection of easy to read guides and tutorials for product teams and tech / business professionals, designed to help you fill in any gaps in your tech knowledge and level up your skills at work. Clearly explained in plain English. One topic at a time.
If you’re a free subscriber and you’d like to unlock them you can do so below. Or you can learn more about what you get with paid access here.
Hi product people 👋,
In recent years, JSON has emerged as the de-facto standard for data exchange in many of the products we use. Its simplicity and readability make it an ideal candidate for powering different parts of the tech stack like APIs and noSQL databases.
As Uber says in its own API docs:
“The Uber API speaks exclusively in JSON”.
JSON is mostly used by engineering teams but having an understanding of JSON can help non-technical members of product teams, too. Figma plugins support JSON for importing real data so that product designers can populate dashboard designs with real world data and product managers / business execs can also find themselves working with JSON data formats when reading third party API docs or building custom reports.
In this 🧠 Knowledge Series, we’ll dig deeper into JSON, including: what it is, why it’s so pervasive and how it's used in the real world so that the next time you’re tasked with anything relating to JSON you’re fully up to speed the essentials you need to know.
Coming up:
What is JSON - a simple explanation
Key characteristics and syntax - a closer look at some simple syntax examples
The power of JSON in practice: real world examples of how JSON is used for things like API requests, data storage and data exchange
How companies like Reddit, Uber and Stripe use JSON for data analysis, APIs and more
Tools you can use for JSON data visualization and learning more
What is JSON - a simple explanation
JSON is a lightweight data format that is easy for humans to read and write.
It’s actually an acronym which stands for JavScript Object Notation but despite being derived from JavaScript, JSON is completely language-independent which means it can be used across various programming languages and platforms.
The "Object Notation" part of JSON (JavaScript Object Notation) sounds complicated but it simply refers to the way data is structured and represented in JSON format, which is inspired by JavaScript’s object syntax. We’ll look more closely at this when we come onto the syntax in a second.
Who uses JSON and what do they use it for?
JSON is predominantly used by engineers but engineers and non-engineers alike will likely come across JSON at some point during their time in tech since JSON is used for common things including:
Data exchange and analysis - JSON is widely used for data exchanges between different systems and applications.
API communication and web services - most modern APIs now use JSON as their primary data format for request and responses. It’s pretty easy to read and is lightweight and because it’s closely linked to Javascript objects, it makes working with APIs on the web much easier.
Data storage - noSQL databases like MongoDB use JSON-like formats to store documents.
Key characteristics and syntax - the important bits worth knowing
JSON is popular because it’s simple to read and understand. But having said that, if you’re not quite sure what the structure of JSON’s syntax is, reading and understanding it can still be tricky.
Let’s take a look at some of the most important bits worth knowing about JSON’s syntax along with some examples together.
“Object notation” explained
As we mentioned earlier, JSON is an acronym for Javascript Object Notation and the “Object notation” part of this refers to the way data is structured and represented in JSON format, inspired by Javascript.
How object notation in JSON works
JSON is written in key-value pairs, which is similar to how ‘objects’ are structured in javascript. In JSON, an object is a fundamental data structure that represents a collection of key-value pairs enclosed in curly braces {}. It's one of the primary ways to organize and structure data in JSON format.
Let’s imagine we work at a fintech SaaS company for a second and consider how objects might be used.
In this case, you might have a series of different JSON objects which represents the following:
User accounts
Financial transactions
Investment portfolio
Loan application
Technical architects and software engineers would typically decide which objects need to exist in an application and when new features are built, existing objects may be updated to reflect new capabilities or new objects might need to be created to power the new capabilities.
None of this really makes any sense without some examples, though, so let’s take a look at some together now.
The key characteristics of a JSON object
JSON works in key-value pairs. If we were to create an object which represents this newsletter, for example, the JSON object would look like this: