What’s behind the popularity of JSON?
It’s used widely across the internet for almost every single API that you will access, as well as for config files and things such as games and text editors.
JSON has taken over the world. Today, when any two applications communicate with each other across the internet, odds are they do so using JSON. It has been adopted by all the big players: Of the ten most popular web APIs, a list consisting mostly of APIs offered by major companies like Google, Facebook, and Twitter, only one API exposes data in XML rather than JSON. Twitter, to take an illustrative example from that list, supported XML until 2013, when it released a new version of its API that dropped XML in favor of using JSON exclusively.
The history and evolutionary path of the web have played a significant role in the popularization of JSON. According to Stack Overflow, more questions are now asked about JSON than about other data interchange formats
According to Google Trends, a similar profile is seen comparing search interest for JSON and XML.
XML still survives in many places. It is used across the web for SVGs and for RSS and Atom feeds. When Android developers want to declare that their app requires permission from the user, they do so in their app’s manifest, which is written in XML. XML also isn’t the only alternative to JSON—some people now use technologies like YAML or Google’s Protocol Buffers. But these are nowhere near as popular as JSON. For the time being, JSON appears to be the go-to format for communicating with other programs over the internet.
We use JSON because it’s extremely lightweight to send back and forth in HTTP requests and responses due to the small file size.
It’s easy to read compared to something like XML since it’s much cleaner and there’s not as many opening and closing tags to worry about.
Almost every single major language has some form of library or built-in functionality to parse JSON strings into objects or classes in that language.
This makes working with JSON data extremely easy inside of a programming language.