Problem in movie finder imdb id/ omdb api

I’ve tried writing the js code for movie finder using fetch instead of XMLHttpRequest.
but inside the showMovies() function, the movie.imdbID returns ‘undefined’ value(screenshot attached).

const API_URL = "";
const API_SEARCH_URL = "";

var searchInputBox = document.getElementsByClassName("input_search_text")[0];
var textBox = document.getElementById("text_view");

function searchMovies() 
	var query = searchInputBox.value;

async function getMovies(url) {
	const response = await fetch(url);
	const respData = await response.json();

function showMovies(movies) {
	movies.forEach(async function(movie) {
		const movieData = await fetch(API_SEARCH_URL+movie.imdbID);
		const movieDataObj = await movieData.json();

function displayMovies(iMovie) {
	alert("success in running fun displaymovies");
<!DOCTYPE html>
	<link rel="stylesheet" type="text/css" href="css/stylesheet.css">
	<title>Movie Finder</title>
	<div class="header_layout">
		<div id="college_header_text">
			<p><b>Movie Finder</b></p>

	<div class="full_search_box">
			<input type="text" name="search_text" class="input_search_text" placeholder="Search movies here..">
			<button class="input_search_button" onclick="searchMovies()">

	<div class="website_data_card">
		<p><b id="text_view">The place to explore, filter, research, and browse all the Movies.</b></p>

<script type="text/javascript" src="js/script.js"></script>

Why isn’t it giving any vaid ‘movie.imdbID’ value?

EDIT1:‘movie.Title’ is fully accessible and returns some not null values.

EDIT2: according to this github thread there are some problematic imdbID’s. I just happen to encounter exactly one of them :frowning: .
The issue has been solved (Ans. just don’t use the faulty movies).

1 Like

according to this github thread there are some problematic imdbID’s.

So just don’t use the faulty imdbID’s for API requests :slight_smile:

1 Like