Parsing json data

Hi all,

I am trying to parse this JSON DATA

It starts with a [

so i don’t know how to create the model. Is it the same procedure if it was to start with {

This is what i got

struct CalorieResponse: Decodable{
var results: [Detail]

struct Detail: Decodable, Identifiable{
var id: Int?
var title: String?
var image: String?
var imageType: String?
var calories: Int?
var protein: String?
var fat: String?
var carbs: String?


Your later post shows that you have now solved the issue. A very good tool to use to arrive at the correct data model is

You simply paste the json code into the window on the left of the tool and it will generate the Data Model.