const response = {
"code": 200,
"status": "OK",
"result": {
"query": "query",
"total": 34,
"duration": 1245,
"hits": [
{
"ip": "x.x.x.x",
"services": [
{
"port": 21,
"service_name": "FTP",
"transport_protocol": "TCP"
},
{
"port": 22,
"service_name": "SSH",
"transport_protocol": "TCP"
},
]
},
{
"ip": "y.y.y.y",
"services": [
{
"port": 80,
"service_name": "HTTP",
"transport_protocol": "TCP"
},
{
"port": 443,
"service_name": "HTTP",
"certificate": "c3ea28c3a4eaa4075c45bb3740dd4207af099727eb654b974bb0b2a5703406b2",
"transport_protocol": "TCP"
}
],
"location": {
"continent": "Europe",
"country": "France",
"country_code": "FR",
"timezone": "Europe/Paris",
"coordinates": {
"latitude": 48.8582,
"longitude": 2.3387
},
"registered_country": "France",
"registered_country_code": "FR"
},
"autonomous_system": {
"asn": 16276,
"description": "OVH",
"bgp_prefix": "51.38.0.0/16",
"name": "OVH",
"country_code": "FR"
},
"last_updated_at": "2022-07-29T12:59:03.142Z"
}
]
}
};
console.log(response.result.hits.map(a=>a.ip));