What I need to do decode this json?

I already tested if RESPONSE is really my JSON. when i run the project on this page it gives error, what to do to save the homeTeam information from the fullTime from score?

{
“head2head”: {
“numberOfMatches”: 1,
“totalGoals”: 2,
“homeTeam”: {
“id”: 507,
“name”: “FC Paços de Ferreira”,
“wins”: 0,
“draws”: 1,
“losses”: 0
},
“awayTeam”: {
“id”: 5529,
“name”: “CD Nacional”,
“wins”: 0,
“draws”: 1,
“losses”: 0
}
},
“match”: {
“id”: 310783,
“competition”: {
“id”: 2017,
“name”: “Primeira Liga”,
“area”: {
“name”: “Portugal”,
“code”: “PRT”,
“ensignUrl”: “https://upload.wikimedia.org/wikipedia/commons/5/5c/Flag_of_Portugal.svg
}
},
“season”: {
“id”: 644,
“startDate”: “2020-09-20”,
“endDate”: “2021-05-19”,
“currentMatchday”: 22,
“winner”: null
},
“utcDate”: “2021-03-05T18:30:00Z”,
“status”: “SCHEDULED”,
“venue”: “Estádio da Capital do Móvel”,
“matchday”: 22,
“stage”: “REGULAR_SEASON”,
“group”: “Regular Season”,
“lastUpdated”: “2021-03-04T00:00:18Z”,
“odds”: {
“msg”: “Activate Odds-Package in User-Panel to retrieve odds.”
},
“score”: {
“winner”: null,
“duration”: “REGULAR”,
“fullTime”: {
“homeTeam”: null,
“awayTeam”: null
},
“halfTime”: {
“homeTeam”: null,
“awayTeam”: null
},
“extraTime”: {
“homeTeam”: null,
“awayTeam”: null
},
“penalties”: {
“homeTeam”: null,
“awayTeam”: null
}
},
“homeTeam”: {
“id”: 507,
“name”: “FC Paços de Ferreira”
},
“awayTeam”: {
“id”: 5529,
“name”: “CD Nacional”
},
“referees”:
}
}

1 Like

Your blocks look correct but it’s hard for me to tell because the JSON you posted isn’t complete and I can’t format it in an easier-to-read way. Can you post the full JSON response? It seems like it’s maybe missing a few characters.

The problem might be that you’re getting a “null” response from the API server for that value. Try getting a value that exists and see if that works. For example, object–>score–>duration.

Also, you need to check the green “error” blocks by adding them to a label. What is the value of each error block when you run that code?

Have you tried the Web API Get block by itself without the block above/around it?

1 Like

In the JSON presented score->fullTime->homeTeam is null which will result in an error.