I need to filter a json which i get externally from API. The json file is like this :
{
"get":"players",
"parameters":{
"team":"504",
"season":"2021"
},
"response":[
{
"player":{
"id":1011,
"name":"K. R\u00fcegg",
"firstname":"Kevin",
"lastname":"R\u00fcegg",
[...]
},
{
"player":{
"id":14268,
"name":"I. Pandur",
"firstname":"Ivor",
"lastname":"Pandur",
"age":21,
"birth":{ [...]
Syntax :
fetch(url)
.then(response => response.json())
.then((data) => {
[...]
});
I need to get only the selected player id like this :
"player":{
"id":1011,
"name":"K. R\u00fcegg",
"firstname":"Kevin",
"lastname":"R\u00fcegg",
[...]
},