Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Robert Torres
Robert Torres
2,736 Points

Anyone know how I would get a random movie search on a button click for Omdb Api? Using Jquery

Just trying to get random movies from omdb api every time I click the button.

1 Answer

Steven Parker
Steven Parker
231,007 Points

The OMDB API doesn't have a "random" function.

Every request is required to contain at least one of these three items: a title, an IMDB movie ID, or a search term. I suppose you could keep your own list of one of these three things and randomly pick one to show, but your "randomness" would be limited to the items you had previously chosen for your list.

You might send Brian a suggestion to add such a feature (perhaps along with a donation!).

By the way, due to increasingly heavy traffic, OMDB will be going private soon. But at least for now, a patron level of just $1/month will keep you connected. See the OMDB Patreon page for details.