What is JSON and why does it appear in almost all APIs?

Published on 2026-10-20 by frfrand

JSON explicado para principiantes: objetos, listas, cadenas, números, ejemplo real de una API y errores que impiden leerlo correctamente.

What is JSON and why does it appear in almost all APIs?

JSON is a text format for representing structured information that programs written in different languages can exchange. It is called JavaScript Object Notation, but it also works for Python, Java, Go, mobile applications, and practically any modern environment.

If you ever opened an API and found braces, quotes, and colons, you were probably looking at JSON. The syntax seems strange until you understand that it only describes data.

A simple example of a store

{
  "id": 42,
  "nombre": "Teclado mecánico",
  "precio": 79.90,
  "disponible": true,
  "categorias": ["accesorios", "teclados"]
}

The words on the left are keys; their value appears on the right. Braces contain an object, brackets contain a list, and quotes indicate text. There is no instruction that executes just by writing it.

What types of values exist?

JSON supports text strings, numbers, booleans true and false, the value null, arrays, and objects. You can combine lists and objects to represent more complex information.

It does not support functions, comments, or dates as a special type. A date can be transmitted as text following an agreed format, but the application must interpret it.

Why do APIs use it so much?

Imagine a React frontend that needs to display products stored in a Django backend. Both can agree to exchange a JSON list. The server returns data; the frontend decides how to draw them.

JSON is common in HTTP, but that does not mean an API is required to use it. There are services that exchange XML, binary data, or other formats. HTTP transports messages; JSON describes a possible representation of the data.

JSON is not a database

You can keep a .json file on your disk, but that does not turn it into PostgreSQL. A database engine manages queries, transactions, concurrency, storage, and other problems that the format does not solve.

There are also databases that store JSON documents. There the format is part of how records are represented, but the engine is still another piece.

Errors that appear constantly

Using single quotes. In standard JSON, keys and strings must use double quotes.

Leaving a trailing comma. This produces invalid syntax: {"nombre":"Ana",}. Some languages allow that style in their own objects, JSON does not.

Adding comments. A line starting with // is not valid within pure JSON, although certain variants accept it.

Confusing number and text. 42 is not the same as "42". And null is not equivalent to "null" either.

How a programmer uses it

In JavaScript, JSON.parse transforms a valid JSON string into a language value; JSON.stringify converts compatible values to JSON text. In Python you can use the standard json module.

But there is an important detail: well-written JSON does not mean reliable data. If {"admin":true} arrives from the browser, the server should not grant administrative privileges just because the key exists and has valid syntax.

And in ArduMaker?

Many API interfaces and infrastructure tools exchange data structures. Understanding JSON helps interpret responses, build integrations, and diagnose errors without confusing the format with the operation a server executes.

In summary: JSON is a grammar for writing data. Understanding objects, arrays, and value types allows you to understand many API responses without learning an entire programming language.

Sources: JSON Specification, RFC 8259 · MDN JSON Reference · What is an API.

What is JSON and why does it appear in almost all APIs?
  • JSON
  • API
  • programación
  • backend

Keep reading

All articles · VPS plans