how do i get imdb_id from api query with JS

i need to get imdb_id by title using tmdb api and add imdb_id into my div on html website
my code is:

<script>
  const settings = {
    async: true,
    crossDomain: true,
    url: "https://api.themoviedb.org/3/search/multi?api_key=98771c266fc9b4e8718a98a7b1232&language=de-DE&query={title}&page=1&include_adult=false",
    method: "GET",
  };

  $.ajax(settings).done(function (data) {
    const settings = {
      async: true,
      crossDomain: true,
      url:
        "https://api.themoviedb.org/3/movie/" +
        data.results[0].id +
        "/external_ids?api_key=987766fc9b4e8718a2a598a7b1232",
      method: "GET",
    };
  });
  
  $.ajax(settings).done(function (data) {
    document.getElementById("imdbdiv").href =
      "https://example.com/?imdb_id=" + data.imdb_id;
  });
</script>