0

I am trying to view all the movies from IMDB. I am unabke to do it. THerefore I decided to use a search bar that will send the string of the name of the movie and then show the movies of that string. But it gives me error even though I generated the key.

Here is the snippet, Please help!

axios.get('http://www.omdbapi.com/?i=tt3896198&apikey=5657bf65'+searchText) What have I done wrong in the code?

Also if possible, please tell me the code to view all the movies in imdb starting from the recent without any search query.

Shivangi
  • 95
  • 1
  • 2
  • 9

2 Answers2

1

I dont think omdbapi has the option to display all videos, but for the search you can use it like this:

axios.get('http://www.omdbapi.com/?apikey=5657bf65&s='+searchText)
ptothep
  • 415
  • 3
  • 10
0

As I see you are using search API but calling isn't correct.

pass &search like this

axios.get(http://www.omdbapi.com/?i=tt3896198&apikey=5657bf65&search=searchText)

you need to pass your searched movie name like this

axios.get(`http://www.omdbapi.com/?i=tt3896198&apikey=5657bf65&search=${pass searched movie name}`);
akhtarvahid
  • 9,445
  • 2
  • 26
  • 29