Как из ответа API вывести данные в чисто м виде а не ссылками js Нужны данные про people с этими id?

const API_URL =  "https://swapi.dev/api/films/2/";
getMovies(API_URL);
async function getMovies(url) {
  const resp = await fetch(url);
  const respData = await resp.json();
  console.log(respData);
return respData
}

вывод characters: Array(16) 0: "https://swapi.dev/api/people/1/" 1: "https://swapi.dev/api/people/2/" 2: "https://swapi.dev/api/people/3/" 3: "https://swapi.dev/api/people/4/" 4: "https://swapi.dev/api/people/5/" 5: "https://swapi.dev/api/people/10/" 6: "https://swapi.dev/api/people/13/" 7: "https://swapi.dev/api/people/14/" 8: "https://swapi.dev/api/people/18/" 9: "https://swapi.dev/api/people/20/" 10: "https://swapi.dev/api/people/21/"введите сюда код 11: "https://swapi.dev/api/people/22/" 12: "https://swapi.dev/api/people/23/" 13: "https://swapi.dev/api/people/24/" 14: "https://swapi.dev/api/people/25/" 15: "https://swapi.dev/api/people/26/"


Ответы (1 шт):

Автор решения: another_login

Например так:

const API_URL = "https://swapi.dev/api/films/2/";
async function getData(url) {
  const resp = await fetch(url);
  const respData = await resp.json();
  return respData;
}
async function getCharacters() {
  const movie = await getData(API_URL);
  let charactersPromises = [];
  for (ch in movie.characters) {
    charactersPromises.push(getData(movie.characters[ch]));
  }
  const charactersList = await Promise.all(charactersPromises);
  console.log(charactersList);
  return charactersList;
}
getCharacters();

→ Ссылка