4

So I can get a single query with, for example:

`http://www.omdbapi.com/?t=inception`

How do I get all the movies from the api?

mrtaz
  • 446
  • 1
  • 6
  • 16

1 Answers1

8

You can't get all the movies from OMDb API, even if you use * it will return an error Too many results.

But you can return multiple results using s parameter. Look at the code sample below using jQuery.

<!DOCTYPE html>
<html>
  <head>
    <title>Ajax Request</title>
  </head>
  <body>

    <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
    <script>
      $.get("http://www.omdbapi.com/?s=inception&apikey=[yourkey]", function(data) {
        console.table(data);
      });
    </script>
  </body>
</html>

Check your browser console to view the result.

Aminu Kano
  • 2,595
  • 1
  • 24
  • 26