From the course: Learn API Documentation with JSON and XML

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

JSON examples

JSON examples

From the course: Learn API Documentation with JSON and XML

Start my 1-month free trial

JSON examples

- [Narrator] I'll show you examples of JSON files, one simple, and one more complex. I brought up Sublime Text here, and I'll type in an example JSON file that captures information about a song. First thing I want to do is turn on the formatting. So if we go to View, and under Syntax, and then JavaScript, there's something for JSON. So we'll turn this on, and this'll help visually see what the JSON format looks like. I'm going to start off with an object, so that means starting with curly brackets. I just type one, then both the closed and open appear. Give myself a little space. So this object is going to have a key of "song", in quotation marks. We'll put a colon here. And then we've got to have another set of curly brackets. We then indent. And we have some key-value pairs. First one is a title. This'll be the title of the song. I'll call it JSON Lullaby. Next key will be the artist, and its value is going to be The Instructors. That'll be the name of our group here, singing the…

Contents