score:2

i'm not sure this is the answer you are looking to but it seems that you just have to use map to create an array of object with the shape you are looking for.

function callingapis() {

    const promises = urls.map(url => axios.get(url, { headers }));

    promise.all(promises).then(responses => 
        responses.map(({data}) => {
           return [
             {"id": data.id},
             {"source": data.source},
             {"pathname": data.paths.name}
             {"pathdescription": data.paths.description},
          ]
     ).then(filtereddata => setdata(filtereddata))
   
   
};

Related Query

More Query from same tag